项目作者: kartik1998

项目描述 :
A nodejs library for phonetic string matching which exposes implementation of phonetic algorithms like soundex, metaphone and double-metaphone algorithms.
高级语言: JavaScript
项目地址: git://github.com/kartik1998/phonetics.git
创建时间: 2021-05-09T17:09:55Z
项目社区:https://github.com/kartik1998/phonetics

开源协议:MIT License

下载



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

Usage

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

output: p532

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

output: true

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

output: FNTK

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

output: false

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

output: [ 'FNTK', 'FNTK' ]

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

output: false