2.0.0-alpha.3 • Published 5 years ago
@hiyurigi/nlp v2.0.0-alpha.3
NLP by Hiyurigi
A simple implementation of NLP in JS.
How to use
Installation
npm i @hiyurigi/nlpFunction
- Text CorrectionExample: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 } ]Parameter Description Type Default Needle Text you want to fix. String | Required None NgramsLength how many grams you want. integer | Optional 1 Threshold Text correction threshold. float | Optional 0.3 ThresholdOperator Threshold js comparison operator. String | Optional >= KeyRange Key distance on the keyboard. Integer | Optional 2 Autofix Auto fix word (works only with NgramsLength = 1). Boolean | Optional true RemoveArray Remove array when output just 1. Boolean | Optional false 
- Text CompletionExample:const NLP = require('@hiyurigi/nlp')("TextCompletion"); let v = new NLP(["stats", "menu", "xzxz"]); let result = v.TextCompletion("m"); console.log(result);Output:menuParameter Description Type Default UncompleteText Uncompleted Text. String | Required None 
Testing
npm testTODO 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
5 years ago
2.0.0-alpha.2
5 years ago
2.0.0-alpha.1
5 years ago
1.1.0-1
5 years ago
1.1.0
5 years ago
1.0.0-2
5 years ago
1.0.0-1
5 years ago
1.0.0
5 years ago