jared.fail

How I use Language Tool

This post first appeared on my other blog here

I set up LanguageTool in offline mode today and wired up the Chrome extension (among others, Obsidian post forthcoming) in an effort to improve my somewhat poor writing. Writing has never been my strong suit nor of particular interest to me, and so I've always leaned on tools to help me through it.

Fun fact, I used the corrections like 10 times while writing this post.

Most tools are privacy nightmares so when I found out you can self-host the open source server for LanguageTool I had to take a few minutes to give it a try. I have documented the steps below in case anyone else is interested.

  1. Install the server brew install languagetool
  2. Setup n-gram data
  3. Install fasttext for much better language recognition.
    1. Binary: https://fasttext.cc/docs/en/support.html
    2. Prebuilt model: https://fasttext.cc/docs/en/language-identification.html
    3. I dropped the model in a directory alongside the n-gram data
  4. Create a config file
fasttextBinary=/usr/local/bin/fasttext
fasttextModel=/Users/jwelch/.languagetool-config/lid.176.bin
languageModel=/Users/jwelch/.languagetool-config/
  1. Create a script to start up the server. You could also make a launch daemon or whatever, I don't like figuring out plists, and sometimes I need the extra memory to run docker.
#!/bin/bash

languagetool-server --port 8081 \ 
--allow-origin "*" \ 
--config /Users/jwelch/.languagetool-config/languagetool.cfg
  1. Install the Chrome extension and configure the server address to be localhost instead of their public API.
  2. Profit from spelling and grammar checking everywhere!

Addendum

I also installed the Obsidian plugin so that I can write in Obsidian and still get support from LanguageTool. It recently added an automatic mode that sends deltas to the language server and provides fast feedback much like the tools on other platforms.

#howto #writing