kartik1998 / phonetics

A nodejs library for phonetic string matching which supports phonetic algorithms like soundex, metaphone and double-metaphone.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A nodejs library for phonetic string matching which exposes: soundex, metaphone and double-metaphone algorithms.

Usage

  • Soundex
const Phonetics = require('phonetics');
// or import * as Phonetics from 'phonetics'
console.log(Phonetics.soundex('phonetic'));

output: p532

  • Soundex match
const Phonetics = require('phonetics');
console.log(Phonetics.soundexMatch('phonetic', 'phonetics'));

output: true

  • Metaphone
const Phonetics = require('phonetics');
console.log(Phonetics.metaphone('phonetic'));

output: FNTK

  • Metaphone match
const Phonetics = require('phonetics');
console.log(Phonetics.metaphoneMatch('phonetic', 'phonetics'));

output: false

  • Double Metaphone
const Phonetics = require('phonetics');
console.log(Phonetics.doubleMetaphone('phonetic'));

output: [ 'FNTK', 'FNTK' ]

  • Double Metaphone match
const Phonetics = require('phonetics');
console.log(Phonetics.doubleMetaphoneMatch('phonetic', 'phonetics'));

output: false

About

A nodejs library for phonetic string matching which supports phonetic algorithms like soundex, metaphone and double-metaphone.

License:MIT License


Languages

Language:TypeScript 100.0%