Problem running methods in .jar files

2 Ansichten (letzte 30 Tage)
Mehmet OZC
Mehmet OZC am 7 Jan. 2020
Bearbeitet: Mehmet OZC am 8 Jan. 2020
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'.

Akzeptierte Antwort

Steven Lord
Steven Lord am 7 Jan. 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")

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by