Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
languagetool on TexStudio
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
iandoug
l33t
l33t


Joined: 11 Feb 2005
Posts: 849
Location: Cape Town, South Africa

PostPosted: Thu Nov 09, 2023 7:03 am    Post subject: languagetool on TexStudio Reply with quote

Hi

Anyone got any experience getting languagetool to work with TexStudio?

I tried ideas on https://tex.stackexchange.com/questions/155148/installing-language-tool-in-texstudio but no joy.

Code:

 java -jar ./languagetool-server.jar
Usage: HTTPSServer --config propertyFile [--port|-p port] [--public]
  --config file  a Java property file (one key=value entry per line) with values for:
                 'keystore' - a Java keystore with an SSL certificate
                 'password' - the keystore's password
                 'maxTextLength' - maximum text length, longer texts will cause an error (optional)
                 'maxTextHardLength' - maximum text length, applies even to users with a special secret 'token' parameter (optional)
                 'secretTokenKey' - secret JWT token key, if set by user and valid, maxTextLength can be increased by the user (optional)
                 'maxCheckTimeMillis' - maximum time in milliseconds allowed per check (optional)
rest cut


Do I need some config file?

Code:

eix languagetool
[I] app-officeext/languagetool
     Available versions:  (~)5.6 {OFFICE_IMPLEMENTATION="libreoffice"}
     Installed versions:  5.6(13:38:42 25/03/2022)(OFFICE_IMPLEMENTATION="libreoffice")
     Homepage:            https://www.languagetool.org/
     Description:         Style and Grammar Checker for libreoffice

[I] app-text/languagetool
     Available versions:  (~)5.4-r2
     Installed versions:  5.4-r2(12:31:49 02/10/2023)
     Homepage:            https://www.languagetool.org/
     Description:         A proof-reading tool for many languages


Code:

fractal /var/log # /etc/init.d/languagetool start
 * Starting languagetool [server] ...                                                                                                                                                                                                                                                                                 [ ok ]
fractal /var/log # /etc/init.d/languagetool status
 * status: crashed


Am totally at sea here.

Any ideas?

Thanks, Ian
_________________
Asus X570-PRO, Ryzen 7 5800X, GeForce GTX 1650, 32 GB RAM | Asus Sabertooth P990, AMD FX-8150, GeForce GTX 560, 16GB Ram
Back to top
View user's profile Send private message
iandoug
l33t
l33t


Joined: 11 Feb 2005
Posts: 849
Location: Cape Town, South Africa

PostPosted: Tue Apr 16, 2024 6:06 pm    Post subject: Reply with quote

Bump... still not working.

Texstudio's built in checker says

Code:

which java: /usr/bin/java


JAVA: java
openjdk version "17.0.10" 2024-01-16
OpenJDK Runtime Environment Temurin-17.0.10+7 (build 17.0.10+7)
OpenJDK 64-Bit Server VM Temurin-17.0.10+7 (build 17.0.10+7, mixed mode, sharing)

Real-time checking is enabled.
Grammar checking is enabled.

Tries to start automatically.

LT current status: error
Exception in thread "main" java.lang.NoClassDefFoundError: org/languagetool/GlobalConfig
   at org.languagetool.server.HTTPServerConfig.<init>(HTTPServerConfig.java:103)
   at org.languagetool.server.HTTPServer.main(HTTPServer.java:139)
Caused by: java.lang.ClassNotFoundException: org.languagetool.GlobalConfig
   at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
   at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
   at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
   ... 2 more



Thanks, ian
_________________
Asus X570-PRO, Ryzen 7 5800X, GeForce GTX 1650, 32 GB RAM | Asus Sabertooth P990, AMD FX-8150, GeForce GTX 560, 16GB Ram
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2175

PostPosted: Fri Jul 12, 2024 2:18 pm    Post subject: Re: languagetool on TexStudio Reply with quote

iandoug wrote:
Anyone got any experience getting languagetool to work with TexStudio?
...

Ian,

If you're still looking, I'm in a similar situation, wanting to use LanguageTool with lyx and Libreoffice.
There's now a minimal ebuild for app-text/languagetool in the Gentoo repository.
(I could have sworn that when I found it and started using it yesterday it was in the "guru" repository", but it's Gentoo now!)

It provides all the application code, and three scripts:
  • languagetool-gui # Opens a (Java) window where you can paste text and read its opinion
  • languagetool-server # Starts the server on port 8081.
  • languagetool # Command line version - pass it a file to process.

They all respond to "--help".

You should probably read LanguageTool's installation instructions, especially the bit about FastText.
The server configuration it talks about is /etc/languagetool.cfg in the ebuild below.

For lyx use, the trick is to run a script "lyx-gc" from their wiki. It communicates to the LanguageTool http daemon - i.e. languagetool-server from that list.
Libreoffice can be configured to use the daemon (see the instructions - you point it at "https://localhost:8082/v2").

The service script included in the ebuild (/etc/init.d/languagetool) for OpenRc is overcomplex. The following,
after choosing a user to run it under, works better and lets you stop it!:
Code:
#!/sbin/openrc-run
# Distributed under the terms of the GNU General Public License v2

pidfile="/run/languagetool.pid"
description="languagetool [server]"

# Should not be run as root.  Choose your own userid.
command_user="haven:haven"

command_background="true"
command_args="--config /etc/languagetool.cfg --allow-origin '*' --port 8081"
command="/usr/bin/languagetool-server"

depend() {
        after modules
}

_________________
Greybeard
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum