0

由于我是尝试使用 korpus 与 R 一起工作的初学者,因此任何建议都会很棒。

我在我的 Windows 机器上安装了 TreeTagger,然后我安装了 koRpus 包。我的问题是如何使用带有 R 的 koRpus 使用 treetagger?

有什么要添加的设置吗?

我尝试使用此命令:

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"

非常感谢您的帮助

最好的

4

2 回答 2

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 之外工作。

于 2017-03-13T14:03:49.180 回答
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")
于 2017-03-09T01:44:58.107 回答