Cristina Cerqueira
Cristina Cerqueira

Reputation: 127

wordnet getDict() could not find Wordnet dictionary

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!

Upvotes: 1

Views: 2848

Answers (1)

Carlos Gomes
Carlos Gomes

Reputation: 26

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()

Upvotes: 1

Related Questions