Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Linux Installation Instructions #649

Open
mslinn opened this issue Dec 6, 2023 · 4 comments
Open

Better Linux Installation Instructions #649

mslinn opened this issue Dec 6, 2023 · 4 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@mslinn
Copy link

mslinn commented Dec 6, 2023

The Wiki says:

Linux
Use [LinuxBrew](https://docs.brew.sh/Homebrew-on-Linux) (now HomeBrew on Linux).

brew install languagetool
The LanguageTool server jar will be installed to:

/home/linuxbrew/.linuxbrew/opt/languagetool/libexec/languagetool-server.jar

Run a Local LanguageTool Service

I do not know anyone who uses LinuxBrew. The most popular Linux distro is Ubuntu, and it can use either PPA packages (installed using apt) and snaps.

The official snap package for languagetool is here: https://snapcraft.io/install/languagetool/ubuntu

You could just copy their installation instructions:

image

@davidlday
Copy link
Owner

Thanks for the feedback, @mslinn - I agree, my instructions are a bit outdated. My original thinking was to stick with relatively easy, cross-Linux instructions. LinuxBrew is no more, as it's been folded into Homebrew, which works on both MacOS and Linux.

I'll put this on my todo list. I'm reluctant to copy/paste from other sites as that means more work for keeping things updated, but I will link to instructions for some of the more popular distributions. I use Ubuntu as well as Homebrew. Alpine has come up as well in prior issues, and I suppose CentOS makes sense, too. If you have other distros you think would cover a broad group, let me know.

@davidlday davidlday added the documentation Improvements or additions to documentation label Dec 20, 2023
@davidlday davidlday self-assigned this Dec 20, 2023
@mslinn
Copy link
Author

mslinn commented Dec 20, 2023

CentOS has been discontinued. Linux is so diverse that it would be difficult to provide instructions for all distros. Just telling people the snap installation line, then providing a link to the Ubuntu page would likely be enough.

@edouard-lopez
Copy link

Thanks, for the time you spent on the project ❤️

Same here, I never used *brew and was surprised to see it in the wiki. When I set up the server locally I used LanguageTool doc on how to setup the server using the jar file (it was a few years back).

Now some distro have package for it. You can find package availability for other distros on:

@ryan-carpenter
Copy link

ryan-carpenter commented Mar 8, 2024

Configuring the linter was definitely confusing for me, but mostly because of gaps in the LanguageTool documentation (and in my knowledge about using java and .jar files).

To install on openSUSE Tumbleweed, this is what I did:

  1. Install LanguageTool from the official openSUSE repository.
zypper install languagetool

I did not know if this was the same as the "desktop version for offline use" available from https://dev.languagetool.org/http-server. The openSUSE package installed LanguageTool in /usr/share/languagetool/, which is where I found language-server.jar.

  1. Install fastText from openSUSE.
zypper install python311-fasttext

Again, I was not sure if this was what I needed, but it worked successfully and created a fasttext shell command. Note that the repo also includes python39-fasttext, python310-fastext, and python312-fasttext packages. I chose python311-fasttext to match the Python version (default) already on my system.

  1. Download the fastText language identification model.
cd /usr/bin/
wget https://dl.fbaipublicfiles.com/fasttext/supervised-models/lid.176.bin 

The instructions did not suggest where to save the model, so I used the same directory as the fastText executable.

  1. Create a server.properties file in with the following contents.
fasttextModel=/usr/bin/lid.176.bin
fasttextBinary=/usr/bin/fasttext

The instructions did not suggest where to create the properties file or explain how to use an 'external' directory, so I used the same directory as languagetool-server.jar (/usr/share/languagetool/)

  1. Start the LanguageTool server (from the usr/share/languagetool/ directory, as a regular user)
java -cp languagetool-server.jar org.languagetool.server.HTTPServer --config server.properties --port 8081 --allow-origin "*"

Note the asterisk, which is not shown in the LanguageTool documentation. The server failed to start until I added "*".

  1. Follow the rest of the vscode-languagetool-linter instructions.

Edit: corrected server.properties contents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants