2017-03-08 102 views
0

因爲我是一個嘗試korpus與R一起工作的初學者,任何建議都會很棒。使用koRpus函數treetagger與R

我在我的windows機器上安裝了TreeTagger,然後我安裝了koRpus軟件包。 我的問題是如何使用treoagger與R使用koRpus?

是否有任何設置要添加?

我嘗試用這個命令:

writeLines(text = 'All human beings are born free and equal in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood.', con = "myfile.txt"); treetag("myfile.txt") 
Error: could not find function "treetag" 

非常感謝您的幫助

最好成績

回答

0

我不熟悉koRpus,但你可以嘗試調用這樣的功能:

koRpus::treetag("test") 

或像這樣:

library(koRpus) 
writeLines(text = 'All human beings are born free and equal in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood.', con = "myfile.txt"); treetag("myfile.txt") 
0

當使用TreeTagger和koRpus時,還需要設置koRpus環境的信息(即,告訴它在你的計算機上的什麼地方找到TreeTagger等),你可以用set.kRp.env函數來做到這一點。這裏是你將不得不調整到您的計算機上的路徑和您的要求的例子:

set.kRp.env(TT.cmd="C:/Program Files/TreeTagger/bin/tag-english.bat", lang="en", 
      TT.options=list(path="C:/Program Files/TreeTagger", preset="en"), validate=TRUE) 

您可能還需要在R.

使用它之前嘗試TreeTagger是否有效的R外