Languagetool

Run LanguageTool as a local writing-assistance service with lab-specific dictionary support. The custom image uses a pinned LanguageTool upstream version and incorporates the shared dictionary. Rerunning the role rebuilds the image and recreates the service only when an input, such as the upstream version or dictionary, has changed.

ansible-playbook -i inventory -K playbooks/lab-stack.yml --tags languagetool

✅ Verify the LanguageTool service

# Health check — expected: 200
curl -s -o /dev/null -w "%{http_code}\n" \
  -d "text=Test sentence.&language=en-US" \
  http://localhost:8081/v2/check

# Grammar check — expected: messages for “This” and “are”
curl -s -d "text=This are bad sentence.&language=en-US" \
  http://localhost:8081/v2/check \
  | jq -r '.matches[].message'

# Shared dictionary check — expected: []
curl -s -d "text=This is fs-ise and it should not be flagged.&language=en-US" \
  http://localhost:8081/v2/check \
  | jq '.matches'

flowchart LR
    spelling["<a href='https://github.com/fs-ise/handbook/blob/main/data/spelling.txt' target=_blank>handbook/data/spelling.txt</a><br/>(shared dictionary)"]

    subgraph apps["Writing applications"]
        languagetool["LanguageTool server<br/>local Docker container"]
        thunderbird["Thunderbird"]
        chrome["Chrome"]
        vscode["Visual Studio Code"]
        obsidian["Obsidian"]
    end

    spelling --> languagetool

    languagetool --> thunderbird
    languagetool --> chrome
    languagetool --> vscode
    languagetool --> obsidian

Chrome: Advanced settings (only for professional users) - LanguageTool server: Local server

To update the shared dictionary, edit the data/spelling.txt.

To update the local instance with the latest shared dictionary terminology, run:

ansible-playbook -i inventory -K playbooks/lab-stack.yml --tags languagetool

Note: this downloads and includes the data/spelling.txt from the handbook. The previous version may be cached and it may take a few minutes until GitHub provisions the new file.