diff --git a/README.md b/README.md index 2359c8f..97a6248 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,25 @@ If you want to apply a particular suggestion from a `Match`, use `Match.select_r 'There is a book on the table.' ``` +### Determine whether a text is grammatically correct + +If you want to determine whether a text is grammatically correct, you can use the `classify_matches` function from `language_tool_python.utils`. It will return a `TextStatus` enum value indicating whether the text is correct, faulty, or garbage. Here is an example: + +```python +>>> import language_tool_python +>>> from language_tool_python.utils import classify_matches +>>> tool = language_tool_python.LanguageTool('en-US') +>>> matches = tool.check('This is a cat.') +>>> matches_1 = tool.check('This is a cats.') +>>> matches_2 = tool.check('fabafbafzabfabfz') +>>> classify_matches(matches) + +>>> classify_matches(matches_1) + +>>> classify_matches(matches_2) + +``` + ## Example usage From the interpreter: diff --git a/pyproject.toml b/pyproject.toml index 21bb765..a9adac3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "language_tool_python" -version = "2.9.3" +version = "2.9.4" requires-python = ">=3.9" description = "Checks grammar using LanguageTool." readme = { file = "README.md", content-type = "text/markdown" }