R_concordancer の変更点 - アールメカブ

アールメカブ


R_concordancer の変更点


Rでコンコーダンサー (とか言ってみる)

 library(languageR)
 
 place <- which(alice == "place")
 
 for(i in place){
   x <- i - 2; y <- i + 2
   if(x< 0) x <- 0
   if(y > length(alice)) y <- length(alice)
 #  cat(alice[x:y],"\n")
   for(z in x:y){
    cat(sprintf("%10s", alice[z]))
 #    if(z == y){
 #      cat("\n")
 #    }
   }
   cat("\n")
 }

        in     bill's      place        for          a
        an       open      place       with          a
        at        the      place      where         it
      move        one      place         on         he
       the dormouse's      place        and      alice
      took        the      place         of        the
       the      whole      place     around        her
      take        the      place         of        the

# 実際の出力表示は揃っているんです.