Skip to content

Instantly share code, notes, and snippets.

@quicksilver0
Created July 12, 2025 08:28
Show Gist options
  • Save quicksilver0/efbe59c4ee9e2a324033141257e69578 to your computer and use it in GitHub Desktop.
Save quicksilver0/efbe59c4ee9e2a324033141257e69578 to your computer and use it in GitHub Desktop.
Check for grammatical, style and spelling errors
# Поддерживает русский язык, находит грамматические, стилистические и орфографические ошибки.
pip install language-tool-python
import language_tool_python
# Создаём инструмент для русского языка
tool = language_tool_python.LanguageTool('ru-RU')
text = "Он пошол в школу. Я будеть дома."
# Получаем ошибки
matches = tool.check(text)
# Печатаем найденные ошибки
for match in matches:
print(f"Ошибка: {match.message}")
print(f"Текст: {text[match.offset:match.offset + match.errorLength]}")
print(f"Предложение: {match.replacements}\n")
# Output
# Ошибка: Возможная орфографическая ошибка
# Текст: пошол
# Предложение: ['пошёл']
# Ошибка: Глагол "будеть" не существует
# Текст: будеть
# Предложение: ['будет', 'будьте']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment