问题
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