dmcc / PyStanfordDependencies

Python interface for converting Penn Treebank trees to Stanford Dependencies and Universal Depenencies
https://pypi.python.org/pypi/PyStanfordDependencies
68 stars 17 forks source link

AttributeError: type object 'edu.stanford.nlp.process.Morphology' has no attribute 'stemStaticSynchronized' #28

Closed feng-1985 closed 5 years ago

feng-1985 commented 5 years ago
import StanfordDependencies
sd = StanfordDependencies.get_instance(backend='jpype', jar_filename='C:/project_ck/stanford-corenlp-full-2018-10-05/stanford-corenlp-3.9.2.jar')

Rase this error.

Beside, how to use multiple jar file?

feng-1985 commented 5 years ago

Add following code in source code:

        try:
            self.stemmer = \
                self.corenlp.process.Morphology.stemStaticSynchronized
        except AttributeError:
            # stemStaticSynchronized was renamed in CoreNLP 3.6.0 to stemStatic
            self.stemmer = \
                self.corenlp.process.Morphology.stemStatic

It seems the pip installed source code is not updated.

dmcc commented 5 years ago

Thanks for investigating! Would you mind sending your change as a pull request?