在R中设置和使用TreeTagger时出现问题

时间:2018-04-22 09:24:51

标签: r macos text-analysis part-of-speech treetagger

我正在尝试使用R中的TreeTagger功能进行POS分析(在Mac笔记本电脑上)。

但是,在运行以下代码时,我不断收到错误消息:

tagged.text <- treetag(reviews, 
    treetagger = "kRp.env", 
    rm.sgml = TRUE, 
    lang = "en", 
    apply.sentc.end = TRUE, 
    sentc.end = c(".", "!", "?", ";", ":"), 
    encoding = NULL, 
    TT.options=list(path="~/Desktop/TreeTagger/", preset="en"), 
    debug = FALSE, 
    TT.tknz = TRUE, 
    format = "file", 
    stopwords = NULL, 
    stemmer = NULL)

错误讯息: path.expand(path)出错:invalid&#39; path&#39;参数

我按如下方式设置了包:

set.kRp.env(TT.cmd = "manual", lang = "en", 
        path = "~/Desktop/TreeTagger/", 
                       preset = "eng", 
        validate = TRUE)
set.kRp.env(TT.cmd = "manual", lang = "en", 
        path = "~/Desktop/TreeTagger/bin", 
                       preset = "eng", 
        validate = TRUE)
set.kRp.env(TT.cmd = "manual", lang = "en", 
        path = "~/Desktop/TreeTagger/cmd", 
                       preset = "eng", 
        validate = TRUE)

有谁知道这里的问题是什么?

0 个答案:

没有答案