2.0.0-alpha.3 • Published 4 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/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 } ]
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 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
Parameter Description Type Default UncompleteText Uncompleted Text. String | Required None
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