/micro-levenshtein

Spell check based on contexts where each context has its dictionary

Primary LanguageJavaScript

Micro Levenshtein

Spell check and sanatizer based on contexts where each context has its dictionary.

Getting Started

Requirements

Node >= 8
Yarn | NPM

Installing

Install dependencies

yarn | npm install

Run the project

yarn start | npm start

The service starts on port 3000 by default if you do not set the PORT environment variable

Usage

Send a GET request to http://localhost:3000

Headers

At the moment there are no security validations

Content-Type application/json

Body

You can change the dict parameter for your own dictionary

{
	"text": "chivitooooo comn de jamon con muzarela yyyyyyyy rucula #~#@#~|@#|@ con 1kg de requesoooooon",
	"dict": "chivito"
}

Output

You will get a clean text and the suggestions to the words with possible grammatical errors ordered by best match

{
    "suggestion": {
        "chivito": null,
        "comn": [
            "común",
            "con",
            "lomo"
        ],
        "de": null,
        "jamon": [
            "jamón"
        ],
        "con": null,
        "muzarela": [
            "muzzarella"
        ],
        "y": null,
        "rucula": [
            "rúcula"
        ],
        "": [],
        "1kg": [],
        "requeson": null
    }
}

Add your own dictionary

Add a new .dic file in the dict folder. Each word must be separated by a line break and must not contain spaces at the end of it

TODO

Improve effectiveness and speed and much more

Built With

  • Micro - Asynchronous HTTP microservices