language_tool_python: Python wrapper for LanguageToollanguage_tool_python is a Python wrapper for LanguageTool,
a free, multilingual, non-AI, open-source grammar, style, and spell checker. This python wrapper lets you detect and fix errors from
a Python script or from the command line, against a local Java server, the public
LanguageTool API, or your own remote server.
>=3.10 (tested up to 3.15)>=17 to run a local LanguageTool server (default download: 6.8). See the
installation docs
for full Java version details.pip install --upgrade language_tool_python
import language_tool_python
with language_tool_python.LanguageTool("en-US") as tool:
matches = tool.check("A sentence with a error in the Hitchhiker's Guide tot he Galaxy")
print(len(matches))
# β 2
print(matches[0].message)
# β 'Use "an" instead of "a" if the following word starts with a vowel sound'
print(matches[0].replacements)
# β ['an']
print(matches[0].offset)
# β 16
import language_tool_python
with language_tool_python.LanguageToolPublicAPI("en-US") as tool:
matches = tool.check("This are wrong.")
print(len(matches))
# β 2
import language_tool_python
with language_tool_python.LanguageTool(
"en-US",
remote_server="http://my-languagetool-server:8081",
) as tool:
print(tool.correct("I has a problem."))
# β I have a problem.
echo "This are bad." | language_tool_python -l en-US -
language_tool_python -l en-US --apply input.txt
For the full API reference, configuration options, CLI usage, and more examples, see the documentation.
This project follows Semantic Versioning (MAJOR.MINOR.PATCH):
Versions are tagged in the git repository and can be found on PyPI.
make install # Install dev dependencies
make format # Format code
make check # Lint / format / types
make test # Tests
GPL-3.0-only. See LICENSE.
This project is based on the original language-check project:
https://github.com/myint/language-check/
Overall
Maintained
Code review
Latest release
Releases this year
64 followers Β· starred Mar 2022
language_tool_python: Python wrapper for LanguageToollanguage_tool_python is a Python wrapper for LanguageTool,
a free, multilingual, non-AI, open-source grammar, style, and spell checker. This python wrapper lets you detect and fix errors from
a Python script or from the command line, against a local Java server, the public
LanguageTool API, or your own remote server.
>=3.10 (tested up to 3.15)>=17 to run a local LanguageTool server (default download: 6.8). See the
installation docs
for full Java version details.pip install --upgrade language_tool_python
import language_tool_python
with language_tool_python.LanguageTool("en-US") as tool:
matches = tool.check("A sentence with a error in the Hitchhiker's Guide tot he Galaxy")
print(len(matches))
# β 2
print(matches[0].message)
# β 'Use "an" instead of "a" if the following word starts with a vowel sound'
print(matches[0].replacements)
# β ['an']
print(matches[0].offset)
# β 16
import language_tool_python
with language_tool_python.LanguageToolPublicAPI("en-US") as tool:
matches = tool.check("This are wrong.")
print(len(matches))
# β 2
import language_tool_python
with language_tool_python.LanguageTool(
"en-US",
remote_server="http://my-languagetool-server:8081",
) as tool:
print(tool.correct("I has a problem."))
# β I have a problem.
echo "This are bad." | language_tool_python -l en-US -
language_tool_python -l en-US --apply input.txt
For the full API reference, configuration options, CLI usage, and more examples, see the documentation.
This project follows Semantic Versioning (MAJOR.MINOR.PATCH):
Versions are tagged in the git repository and can be found on PyPI.
make install # Install dev dependencies
make format # Format code
make check # Lint / format / types
make test # Tests
GPL-3.0-only. See LICENSE.
This project is based on the original language-check project:
https://github.com/myint/language-check/
Overall
Maintained
Code review
Latest release
Releases this year
64 followers Β· starred Mar 2022