3
NLTK
을 사용하여 파이썬의 문장 철자를 검사하고 싶습니다. 내장 된 spell checker
이 올바르게 작동하지 않습니다. with
과 'and'를 잘못된 철자로 사용하고 있습니다.NLTK의 맞춤법 검사기가 올바르게 작동하지 않습니다.
def tokens(sent):
return nltk.word_tokenize(sent)
def SpellChecker(line):
for i in tokens(line):
strip = i.rstrip()
if not WN.synsets(strip):
print("Wrong spellings : " +i)
else:
print("No mistakes :" + i)
def removePunct(str):
return "".join(c for c in str if c not in ('!','.',':',','))
l = "Attempting artiness With black & white and clever camera angles, the movie disappointed - became even more ridiculous - as the acting was poor and the plot and lines almost non-existent. "
noPunct = removePunct(l.lower())
if(SpellChecker(noPunct)):
print(l)
print(noPunct)
누군가 내게 이유를 줄 수 있습니까? 사람들은 워드 넷에 포함되지 않은 stopwords
이기 때문에