similarity
Returns a difference between two strings using soundex, levenshtein distance or both.
Installation
npm install npm-similarity --save
Usage
var similarity = Similarity Similarity - Soundex ✓ Should have method soundex ✓ 00) Compare with : 0000 and 0000 = true ✓ 01) Compare with MARIA V C BATISTA: 0000 and M612 = false ✓ 10) Compare MARIA VELOSO CAVALVANTI BATISTA with : M614 and 0000 = false ✓ 11) Compare MARIA VELOSO CAVALVANTI BATISTA with MARIA V C BATISTA: M614 and M612 = false Similarity - Levenshtein Distance ✓ Should have method levenshteinDistance ✓ 00) Compare with : 100% true ✓ 01) Compare with MARIA V C BATISTA: 5% false ✓ 10) Compare MARIA VELOSO CAVALVANTI BATISTA with : 3% false ✓ 11) Compare MARIA VELOSO CAVALVANTI BATISTA with MARIA V C BATISTA: 54% false Similarity - combined Soundex and Levenshtein Distance ✓ 00) Compare with : 0000 and 0000 = true: 100% true ✓ 01) Compare with MARIA V C BATISTA: 0000 and M612 = false: 25% false ✓ 10) Compare MARIA VELOSO CAVALVANTI BATISTA with : M614 and 0000 = false: 25% false ✓ 11) Compare MARIA VELOSO CAVALVANTI BATISTA with MARIA V C BATISTA: M614 and M612 = false: 100% true