Skip to content

Instantly share code, notes, and snippets.

@RinatValiullov
Created November 29, 2019 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RinatValiullov/2842a2f259d17364667d093bc6acd894 to your computer and use it in GitHub Desktop.
Save RinatValiullov/2842a2f259d17364667d093bc6acd894 to your computer and use it in GitHub Desktop.
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))
console.log('They sound alike!');
// We can also obtain the raw phonetics of a word using process()
console.log(metaphone.process('phonetics'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment