jxmorris12 / language_tool_python

a free python grammar checker 📝✅
GNU General Public License v3.0
434 stars 64 forks source link

Use system version of languagetool if available #84

Closed bobbens closed 7 months ago

bobbens commented 12 months ago

Arch Linux provides a bash script /usr/bin/languagetool that is a simple wrapper and the jar binaries. Would be great if the library could be made to use the system version if applicable instead of downloading it and bloating the home directory.

ravendinata commented 11 months ago

You can try to set your environment variable LTP_PATH to that path and try if it works. Disclaimer: I did not check if this works on Arch or not but I do a similar thing on Windows pointing to a folder where I pre-downloaded Language Tools into.

More information: https://github.com/jxmorris12/language_tool_python#customizing-download-url-or-path

pidefrem commented 7 months ago

@ravendinata It looks like it will download the LanguageTool zip anyway even if LTP_PATH env var is defined.

https://github.com/jxmorris12/language_tool_python/blob/6246cdf8a5b89496b027036eb9bb20cc0f41314e/language_tool_python/server.py#L246C1-L249C19

https://github.com/jxmorris12/language_tool_python/blob/6246cdf8a5b89496b027036eb9bb20cc0f41314e/language_tool_python/download_lt.py#L131C1-L151C1