str-similarity
v1.0.0
Published
to check similarity between string using various algorithms
Downloads
4
Readme
str-similarity
- Reference:- Click here
Description
- Levenshtein Algorithm
- Cosine Similarity
- Jaro-Winkler Algorithm
How to implement
- For using Levenshtein Algorithm
Here is the code required to implement the code
const strSimilarity = require("str-similarity");
console.log(
strSimilarity.levenshtein("Hi my name is John", "Hi my name is Mary")
);
- For using Cosine Similarity Algorithm
Here is the code required to implement the code
const strSimilarity = require("str-similarity");
console.log(strSimilarity.cosine("Hi my name is John", "Hi my name is Mary"));
- For using Jaro-Winkler Algorithm
Here is the code required to implement the code
const strSimilarity = require("str-similarity");
console.log(
strSimilarity.jaroWrinker("Hi my name is John", "Hi my name is Mary")
);