myint / language-check

Python wrapper for LanguageTool grammar checker
https://pypi.python.org/pypi/language-check
GNU Lesser General Public License v3.0
326 stars 102 forks source link

Language Checking Error Due To Punctuation. #73

Open kandarpkakkad opened 4 years ago

kandarpkakkad commented 4 years ago

Language Checking Error Due To Punctuation.

import language_tool_python as ltp
import sys

text = "Hello How Is You"
print(text)

tool = ltp.LanguageTool('en-US')

matches = tool.check(text)
print(matches)

corrected_text = tool.correct(text)
print(corrected_text)

When the punctuation is not correct, the grammar is not checked correctly.

Without correct punctuation.

Hello How Is You?
[]
Hello How Is You?

With correct punctuation.

Hello! How Is You?
[Match({'ruleId': 'NON3PRS_VERB', 'message': 'The pronoun \'Is\' must be used with "are".', 'replacements': ['Are'], 'context': 'Hello! How Is You?', 'offset': 11, 'errorLength': 2, 'category': 'GRAMMAR', 'ruleIssueType': 'grammar'})]
Hello! How Are You?