2017-03-08 101 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外