language_tool_python icon indicating copy to clipboard operation
language_tool_python copied to clipboard

Use locally downloaded language tool instead of downloading it from url?

Open asnashafiq opened this issue 3 years ago • 5 comments

When using the local server, there is a download from a url for the language tool during initialization. Is it possible to add a local configuration that lets you use an already downloaded tool under LTP_PATH and bypass the download code? Wondering if there's a way to bypass the download from the url with 100% certainty.

asnashafiq avatar Jan 17 '22 20:01 asnashafiq

I wonder if you have solved this problem? I've been trying to use a locally stored Language Tool as the local server so that my python scripts can run totally offline. But sadly I don't know how to configure it. I've tried to replace LTP_PATH with a path to my project but it didn't work.

Zhao-Qiao avatar Sep 23 '22 17:09 Zhao-Qiao

I had the same issue. For me the following worked:

pip download the installation files on a device with internet connection. Then use these files on the device without internet connection to pip install the module (!pip install language_tool_python --no-index --find-links=file:///PATHTOINSTALLFILES).

To avoid that the python import of the module tries to download LanguageTool{version}.zip and put it in the cache of your device, you need to download the LanguageTool{version}.zip on another device with internet connection (from here https://languagetool.org/download/?C=S;O=D) and always (if cache gets deleted after usage) move these files in the cache of your offline device before importing the module. I used this command: !mv {unzipped folder which needs to be moved to cache} {path to your cache} inside my python script before the import function.

Hope that helps!

Dabirius avatar Oct 13 '22 08:10 Dabirius

I'm having the same issue

I have tried your approach but I'm getting the same error as before. Could you please specify which cache I should move the files to? Is ist the directory of the language-tool library? Thats where I moved it.

Thanks!

pyagoubi avatar Oct 14 '22 09:10 pyagoubi

I'm having the same issue

I have tried your approach but I'm getting the same error as before. Could you please specify which cache I should move the files to? Is ist the directory of the language-tool library? Thats where I moved it.

Thanks!

I downloaded LanguageTool{version}.zip and moved the unzipped folder to `~/.cache/language_tool_python/' and it worked. Hope that would help.

Zhao-Qiao avatar Oct 14 '22 10:10 Zhao-Qiao

@pyagoubi it was the same path @Zhao-Qiao mentioned above.

Dabirius avatar Oct 14 '22 11:10 Dabirius

@jxmorris12 it should be fixed now. The user now can use LTP_JAR_DIR_PATH as mentioned in the README to specify local installation and bypass the download for sure.

pidefrem avatar Apr 11 '24 21:04 pidefrem