backend/app/search/services/spell_check.py
2022-10-22 17:31:40 +03:00

11 lines
226 B
Python

import requests as r
from spellchecker import SpellChecker
speller = SpellChecker(language='ru')
def spell_check(word: str) -> str:
res = speller.correction(word)
if not len(res):
return word
return res