2.0.0-alpha.3 • Published 4 years ago

@hiyurigi/nlp v2.0.0-alpha.3

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
4 years ago

NLP by Hiyurigi

A simple implementation of NLP in JS.

How to use

Installation

npm i @hiyurigi/nlp

Function

  • Text Correction

    Example:

    const NLP = require('@hiyurigi/nlp')("TextCorrection");
    let v = new NLP(["stats", "menu", "xzxz"]);
    let result = v.TextCorrection({Needle: "mqnts", Threshold: 0.4, NgramsLength: 1});
    console.log(result);

    Output:

    [
        { Key: 'menu', Text: [ 'm', 'e', 'n', 'u'], similarity: 1 },
        { Key: 'stats', Text: [ 'm', 'q', 'n', 't', 's' ], similarity: 0.4 }
    ]
    ParameterDescriptionTypeDefault
    NeedleText you want to fix.String | RequiredNone
    NgramsLengthhow many grams you want.integer | Optional1
    ThresholdText correction threshold.float | Optional0.3
    ThresholdOperatorThreshold js comparison operator.String | Optional>=
    KeyRangeKey distance on the keyboard.Integer | Optional2
    AutofixAuto fix word (works only with NgramsLength = 1).Boolean | Optionaltrue
    RemoveArrayRemove array when output just 1.Boolean | Optionalfalse
  • Text Completion

    Example:

    const NLP = require('@hiyurigi/nlp')("TextCompletion");
    let v = new NLP(["stats", "menu", "xzxz"]);
    let result = v.TextCompletion("m");
    console.log(result);

    Output:

    menu
    ParameterDescriptionTypeDefault
    UncompleteTextUncompleted Text.String | RequiredNone

Read More

Testing

npm test

TODO List

  • Create text correction
  • Create text completion

If you have a Idea feel free to suggest me

License

License - GNU GPLv3

2.0.0-alpha.3

4 years ago

2.0.0-alpha.2

4 years ago

2.0.0-alpha.1

4 years ago

1.1.0-1

4 years ago

1.1.0

4 years ago

1.0.0-2

4 years ago

1.0.0-1

4 years ago

1.0.0

4 years ago