Skip to content
프로젝트

jxmorris12/language_tool_python

GitHub에서 보기

소개

무료로 사용할 수 있는 비AI Python 문법 검사기 📝✅

AI 및 머신러닝

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
+1
in 15 days
+1
in 1 month
+2

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

language_tool_python: Python wrapper for LanguageTool

language tool python on pypi Documentation Status Test with PyTest Coverage Status Downloads License: GPL v3 Contributions Welcome

language_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.

Demo

Requirements

  • Python >=3.10 (tested up to 3.15)
  • Java >=17 to run a local LanguageTool server (default download: 6.8). See the installation docs for full Java version details.

Installation

pip install --upgrade language_tool_python

Quick Start

Local server

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

Public LanguageTool API

import language_tool_python

with language_tool_python.LanguageToolPublicAPI("en-US") as tool:
    matches = tool.check("This are wrong.")

print(len(matches))
# → 2

Your own remote LanguageTool server

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.

CLI

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.

Documentation

Versioning

This project follows Semantic Versioning (MAJOR.MINOR.PATCH):

  • PATCH - backwards-compatible bug fixes.
  • MINOR - new backwards-compatible features.
  • MAJOR - breaking changes. Deprecated APIs are removed at the next major version.

Versions are tagged in the git repository and can be found on PyPI.

Development

make install  # Install dev dependencies
make format   # Format code
make check    # Lint / format / types
make test     # Tests

License

GPL-3.0-only. See LICENSE.

Acknowledgements

This project is based on the original language-check project: https://github.com/myint/language-check/

관련 프로젝트 살펴보기

불러오는 중…