NaturalNode / natural

general natural language facilities for node
MIT License
10.65k stars 859 forks source link

DoubleMetaphone #301

Open jloveric opened 8 years ago

jloveric commented 8 years ago

I'm trying to use the DoubleMetaphone comparison and it does not seem to be returning the correct answer (though maybe it is!). Below are the result of comparing the string 'is' to 'a' for both the Metaphone and DoubleMetaphone. Obviously these don't sound the same but the DoubleMetaphone seems to be saying that they do - not totally sure that this is a bug or a limitation of the algorithm. The Metaphone on the other hand seems to be working properly.

let natural=require('natural') undefined natural.DoubleMetaphone.compare('is','a') true natural.Metaphone.compare('is','a') false

kkoch986 commented 7 years ago

there are some reference implementations here and here im not super familiar with the algorithm but it does seem like a possible bug. ill check into it and try to get to the bottom of it.