wordnet getDict() could not find Wordnet dictionary

a 夏天 提交于 2019-12-19 10:52:37

问题


when using the following code to use the Lemmatizer algorithm from WordNet

> initDict("C:/Program Files (x86)/WordNet/2.1/dict")
[1] TRUE

if(initDict("C:/Program Files (x86)/WordNet/2.1/dict"))
    getDict()

I have the following error when trying to get the dictionary:

Error in getDict() : could not find Wordnet dictionary

Thanks!


回答1:


The problem is that the package is looking for the environment variable WNHOME

Try this:

>     setDict("C:/Program Files (x86)/WordNet/2.1/dict")

-

getDict()
[1] "Java-Object{com.nexagis.jawbone.Dictionary@46993aaa}"

EDIT

Adding OSX version

brew install wordnet

install.packages('wordnet')
library(wordnet)
setDict("/usr/local/Cellar/wordnet/3.1")
initDict()
getDict()


来源:https://stackoverflow.com/questions/25129073/wordnet-getdict-could-not-find-wordnet-dictionary

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!