jxmorris12 / language_tool_python

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

Introduce new env var `LTP_JAR_DIR_PATH` to let the user specify a custom installation path of LT #86

Closed pidefrem closed 7 months ago

pidefrem commented 7 months ago

Fixes https://github.com/jxmorris12/language_tool_python/issues/84 Fixes https://github.com/jxmorris12/language_tool_python/issues/82

At the moment, language_tool_python will download a fixed version of LanguageTool (LT).

There was also a inconsistency in the code when a more recent version of LT is installed in the download path:

Now the user can specify the LTP_JAR_DIR_PATH environment variable. If this variable is defined, the package will look for the LanguageTool jar files in this folder. Otherwise it will download LanguageTool is the download folder.

The user can also change the LanguageTool version that is downloaded:

tool = LanguageTool(language_tool_download_version="6.3")

I also took the liberty to fix some formatting.

Note that in the tests tests/test_local.bash, the sentence 'These are "dumb" quotes.' is now accepted by the 6.4 version of the LanguageTool. Using the 6.4 version, I also got a different ordering of the suggestions, so I only check the set and I am flexible on the order.

pidefrem commented 7 months ago

@jxmorris12 I fixed some typos, the CI should run fine now.

jxmorris12 commented 7 months ago

thanks -- this is really helpful :)