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
`
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
`