Error NLTK was unable to find the java file

0

I have a code written in Python that uses a particular tokenizer. In particular it is necessary to read a java file, which I have installed in the corresponding directory.

german_postagger = StanfordPOSTagger(r'/Users/test/stanford-postagger/models/german-hgc.tagger', r'/Users/test/stanford-postagger/stanford-postagger.jar')
german_tokenizer = nltk.data.load('tokenizers/punkt/german.pickle')
stemmer = SnowballStemmer("german")

When running the program I get the following error:

LookupError: 
===========================================================================
NLTK was unable to find the java file!
Use software specific configuration paramaters or set the JAVAHOME environment variable.
===========================================================================

I have tried a thousand things, but I can not find the key. Is anyone familiar with this error?

Thank you very much.

    
asked by pyring 26.11.2017 в 21:13
source

0 answers