Problem running methods in .jar files

1 visualizzazione (ultimi 30 giorni)
There is a .jar file (https://github.com/ahmetaa/zemberek-nlp) called "zemberek" which is a Natural Language Processing tools for Turkish language.
I have downloaded 0.17.1 jar file and added to the path
>> cd(prefdir)
>> edit javaaddpath.txt
Added the jar file path to the text, saved, closed and restarted MATLAB.
Then I import tokenizer and listed the methods as follow
>> import zemberek.tokenization.TurkishTokenizer
>> methods TurkishTokenizer
Methods for class TurkishTokenizer:
builder isTypeIgnored
convert notify
convertType notifyAll
equals toString
getClass tokenize
getTokenIterator tokenizeToStrings
hashCode wait
isTypeAccepted
>>
however I cannot run any methods listed above.
>> TurkishTokenizer.tokenize("kalemlerim")
No method 'tokenize' with matching signature found for class 'zemberek.tokenization.TurkishTokenizer'.

Risposta accettata

Steven Lord
Steven Lord il 7 Gen 2020
Check whether or not the tokenize method of the TurkishTokenizer class is static (whether the Qualifiers column of the window opened by the following command lists "static")
methodsview zemberek.tokenization.TurkishTokenizer
If it's not it requires an instance of the class as input. From the examples in the Usage section on the GitHub page I believe it is not static. If that's the case try something like:
>> import zemberek.tokenization.TurkishTokenizer
>> TT = TurkishTokenizer.DEFAULT;
>> TT.tokenize("kalemlerim")

Più risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by