Javier-varez / ltapiserv-rs

Server implementation of the LanguageTool API for offline grammar and spell checking, based on nlprule and symspel. And a small graphical command-line client.

Home Page:https://c.pgdm.ch/eps-projects/ltapiserv-rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ltapiserv-rs

Server implementation of the LanguageTool API for offline grammar and spell checking, based on:

This also contains a simple command-line client, displaying results graphically with ariadne.

See https://c.pgdm.ch/eps-projects/ltapiserv-rs

Installation

The recommended method is to get a binary from the releases page and install it as a systemd service:

$ sudo cp ltapiserv-rs /usr/local/bin
$ sudo chmod +x /usr/local/bin/ltapiserv-rs
$ ln -s $(pwd)/ltapiserv-rs.service ~/.config/systemd/user/ltapiserv-rs.service
$ systemctl --user daemon-reload && systemctl --user enable --now ltapiserv-rs
$ systemctl --user status ltapiserv-rs

A path to a custom dictionary can be passed to the server via the --dictionary option. The default systemd configuration places it in ~/dictionary.txt.

From source

Alternatively, binaries can be built from source as follows:

$ # Create en_US.tar.gz data archive (will be embedded in the binary).
$ bash create_archive.sh
$ cargo build --release

Usage

Browser extension

Install the official LanguageTool browser extension (e.g. for Chrome or Firefox) and configure it to use your local server:

Chrome extension settings

Command line client

A command line client, ltapi-client, is also included in this codebase.

$ cat text.txt | ltapi-client --server http://localhost:8875
$ ltapi-client --server http://localhost:8875 test.txt

Command line interface

The return code will be 1 if any error is detected.

The server address can be configured through the LTAPI_SERVER environment variable.

Formats like Markdown, HTML, LaTeX etc. can be processed through pandoc:

$ pandoc README.md -t plain | ltapi-client

Flycheck (emacs)

(use-package flycheck-languagetool
  :ensure t
  :hook (text-mode . flycheck-languagetool-setup)
  :init
  (setq flycheck-languagetool-url "http://127.0.0.1:8875")
)

About

Server implementation of the LanguageTool API for offline grammar and spell checking, based on nlprule and symspel. And a small graphical command-line client.

https://c.pgdm.ch/eps-projects/ltapiserv-rs

License:GNU General Public License v3.0


Languages

Language:Rust 87.9%Language:Handlebars 8.3%Language:Shell 3.8%