Skip to content

Instantly share code, notes, and snippets.

View RinatValiullov's full-sized avatar
👷‍♂️
Looking for a job

Rinat Valiullov RinatValiullov

👷‍♂️
Looking for a job
View GitHub Profile
@RinatValiullov
RinatValiullov / spell-index.js
Created November 29, 2019 20:52
For translation of article "Natural language processing for Node.js" - https://bit.ly/2QZsts1
// index.js
var natural = require('natural');
var corpus = ['something', 'soothing'];
var spellcheck = new natural.Spellcheck(corpus);
console.log(spellcheck.getCorrections('soemthing', 1));
console.log(spellcheck.getCorrections('soemthing', 2));
@RinatValiullov
RinatValiullov / phonetic-output.js
Created November 29, 2019 20:51
For translation of article "Natural language processing for Node.js" - https://bit.ly/2QZsts1
They sound alike!
FNTKS
@RinatValiullov
RinatValiullov / phonetic-index.js
Created November 29, 2019 20:51
For translation of article "Natural language processing for Node.js" - https://bit.ly/2QZsts1
// index.js
var natural = require('natural');
var metaphone = natural.Metaphone;
var soundEx = natural.SoundEx;
var wordA = 'phonetics';
var wordB = 'fonetix';
if (metaphone.compare(wordA, wordB))
@RinatValiullov
RinatValiullov / sentiment-output.js
Created November 29, 2019 20:50
For translation of article "Natural language processing for Node.js" - https://bit.ly/2QZsts1
0.42857142857142855 // указывает на относительно отрицательное утверждение
@RinatValiullov
RinatValiullov / classification-output.js
Created November 29, 2019 20:49
For translation of article "Natural language processing for Node.js" - https://bit.ly/2QZsts1
sell
buy
@RinatValiullov
RinatValiullov / string_distance-output.js
Created November 29, 2019 20:48
For translation of article "Natural language processing for Node.js" - https://bit.ly/2QZsts1
3
3
-1
@RinatValiullov
RinatValiullov / stemming-output.js
Created November 29, 2019 20:47
For translation of article "Natural language processing for Node.js" - https://bit.ly/2QZsts1
[ 'go', 'friend' ]
@RinatValiullov
RinatValiullov / stemming-index.js
Created November 29, 2019 20:46
For translation of article "Natural language processing for Node.js" - https://bit.ly/2QZsts1
// index.js
var natural = require('natural');
natural.PorterStemmer.attach();
console.log("I can see that we are going to be friends".tokenizeAndStem());
@RinatValiullov
RinatValiullov / tokenization-output.js
Created November 29, 2019 20:46
For translation of article "Natural language processing for Node.js" - https://bit.ly/2QZsts1
[ 'The',
'quick',
'brown',
'fox',
'jumps',
'over',
'the',
'lazy',
'dog' ]
@RinatValiullov
RinatValiullov / tokenization-index.js
Created November 29, 2019 20:44
For translation of article "Natural language processing for Node.js" - https://bit.ly/2QZsts1
// index.js
var natural = require('natural');
var tokenizer = new natural.WordTokenizer();
console.log(tokenizer.tokenize("The quick brown fox jumps over the lazy dog"));