StarlangSoftware / TurkishSpellChecker-Py

Turkish Spell Checker Library
GNU General Public License v3.0
49 stars 12 forks source link

pyhon 3.7.3 te aldığım hata mesajı: AttributeError: 'FsmMorphologicalAnalyzer' object has no attribute 'morphologicalAnalysisSurfaceForm' #1

Closed aerkanc closed 4 years ago

aerkanc commented 4 years ago

Kütüphaneyi denemek için şöyle bir kod bloğu yazdım ancak hata aldım: ` from Corpus.Sentence import Sentence from MorphologicalAnalysis.FsmMorphologicalAnalyzer import FsmMorphologicalAnalyzer from SpellChecker.SimpleSpellChecker import SimpleSpellChecker

text = "Yaızm denetleyci, veriilen mtndki yazım hatlarını bulup düzelten Nlptoolkit bilşenidir." fsmM = FsmMorphologicalAnalyzer(dictionaryFileName='../data/turkish_dictionary.txt', misspelledFileName=None, fileName='../data/turkish_finite_state_machine.xml') s = SimpleSpellChecker(fsmM) sentence = Sentence(fileOrStr=text) res = s.spellCheck(sentence) print(res) `

Hata Mesajı: Traceback (most recent call last): File "/snap/pycharm-professional/176/plugins/python/helpers/pydev/pydevd.py", line 1434, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "/snap/pycharm-professional/176/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/aerkanc/Workspaces/Python/IssueIntelligence/notebooks/spellchek-test.py", line 9, in res = s.spellCheck(sentence) File "/home/aerkanc/.pyenv/versions/3.7.3/lib/python3.7/site-packages/SpellChecker/SimpleSpellChecker.py", line 111, in spellCheck fsmParseList = self.fsm.morphologicalAnalysisSurfaceForm(word.getName()) AttributeError: 'FsmMorphologicalAnalyzer' object has no attribute 'morphologicalAnalysisSurfaceForm `

olcaytaner commented 4 years ago

Yeni versiyonda problem çözüldü. Eski versiyon morfolojik analizin eski bir versiyonuna bağlıydı.