!!!checkWordList.R *語彙リストを比較する *一単語一行 *types2にチェックしたい単語リスト(例えば学生のエッセイ) *wordlistに参照したい語彙リスト(例えばJACET8000等の語彙リスト) *一般的な語彙リストには含まれない「珍しい」単語の一覧が出る {{pre checkWordList <- function(){ i <- 0 k <- 0 koreda <- 0 k <- length(types2) w <- length(wordlist) cat("words to check:", k, "\n") cat("base word list:", w) for(i in 1:k){ are <- types2[i] fuitti <- 0 itti <- 0 for(j in 1:w){ kore <- wordlist[j] if(are == kore){ itti <- itti + 1 } else { fuitti <- fuitti + 1 } if(length(wordlist) == fuitti){ koreda <- c(koreda, i) } } } for(h in 1:length(koreda)){ m <- koreda[h] print(types2[m]) } cat(length(koreda), "rare words") } }}