GithubHelp home page GithubHelp logo

funbox / languagetool-node Goto Github PK

View Code? Open in Web Editor NEW
13.0 12.0 2.0 364 KB

CLI spell and grammar checker

License: MIT License

JavaScript 100.00%
spelling spellcheck grammar grammar-checker languagetool

languagetool-node's Introduction

⛔ THIS REPO IS UNMAINTAINED

Future development moved to https://github.com/343dev/languagetool-node.

@funboxteam/languagetool-node

npm

CLI spell and grammar checker. Uses LanguageTool under the hood.

По-русски

Rationale

Some projects have a lot of documentation inside the repos. Once we decided to start linting their grammar and check for spelling errors. But we didn't want to send our docs to the unknown servers of the well-known services.

Hence, we decided to build our own CLI tool upon the LanguageTool.

Getting Started

LanguageTool requires Java to work, so first of all go to java.com and download it.

Then install the package:

npm i -g @funboxteam/languagetool-node

It's recommended to install the package globally, because archive with LanguageTool will be downloaded (≈250 MB) and unzipped it into the package directory.

Usage

The tool can check the passed files or the text from STDIN.

Check files:

languagetool-node README.md CHANGELOG.md

Check files defined using globs:

languagetool-node ~/project1/**/*.txt ~/project2/*.md

Check the text from STDIN:

echo "Insert your text here .. or check this textt. LanguageTool 4.0 were releasd on Thursday 29 december 2017." | languagetool-node
Output example
$ echo "Insert your text here .. or check this textt. LanguageTool 4.0 were releasd on Thursday 29 december 2017." | languagetool-node

<stdin>
  1:23  warning  Two consecutive dots                                        typographical  spell
Context: «Insert your text here .. or check this textt. LanguageTool 4.0 w...»
Possible replacements: «.»

  1:26  warning  This sentence does not start with an uppercase letter       typographical  spell
Context: «Insert your text here .. or check this textt. LanguageTool 4.0 were...»
Possible replacements: «Or»

  1:40  warning  Possible spelling mistake found                             misspelling    spell
Context: «Insert your text here .. or check this textt. LanguageTool 4.0 were releasd on Thurs...»
Possible replacements: «text, texts, text t»

  1:69  warning  Possible spelling mistake found                             misspelling    spell
Context: «...check this textt. LanguageTool 4.0 were releasd on Thursday 29 december 2017. »
Possible replacements: «released, release»

  1:80  warning  The date 29 december 2017 is not a Thursday, but a Friday.  inconsistency  spell
Context: «...textt. LanguageTool 4.0 were releasd on Thursday 29 december 2017. »

⚠ 5 warnings

External configuration file

It's possible to override default options by creating file ~/.languagetoolrc.js. It will be merged with default config.

Example of external config:

module.exports = {
  // allowed words (regexps are supported)
  ignore: [
    '(T|O)TF',
  ],
};

Credits

The picture for the project was made by Sergey Mylnikov & Igor Garybaldi.

Sponsored by FunBox

languagetool-node's People

Contributors

343dev avatar dependabot[bot] avatar dissimulazione avatar igoradamenko avatar netdead avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

languagetool-node's Issues

Using an external LanguageTool server

I'm looking at this project and will likely be modifying it for my own purposes, specifically, using an external LanguageTool server instead of the locally downloaded java app. Is this something for which you would be interested in seeing a PR?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.