1.3.2 • Published 3 months ago

string-similarity-alg v1.3.2

Weekly downloads
-
License
ISC
Repository
-
Last release
3 months ago

Usage

This package can be used when need to check how similar two words are. You can choose among some implemented algorithms that suits your best use case.

Below you will find all the implemented algorithms and when to use each. You can import a specific algorithm or use the strinSimilarity function.

It is very useful when you need different parameters for the same algorithm, such as jaroWinkler.

import stringSimilarity, { sorensenDice } from "string-similarity-alg";

const jaroWinklerResult = stringSimilarity("jaro-winkler").compare("game of thrones", "lord of the rings");
const sorensenDiceResult = sorensenDice.compare("game of thrones", "lord of the rings");

Installation

You can install this package using populars package managers:

npm

npm install string-similarity-alg

yarn

yarn add string-similarity-alg

pnpm

pnpm add string-similarity-alg

Algorithms

AlgorithmSinceBest use caseExample
Levenshtein1.0.0Small strings / similar wordsfarmville / faremviel
Soresen-Dice1.0.0Fuzzy matching, very mispelled words or poorly writtenuser-home-page.component.ts / usrhompcomp
Jaro-Winkler1.0.0Same as Jaro similarity, gives more weight to strings that have the same first letters-
Jaro Similarity1.0.0General purpose, use this if you don't think any of the others are valid-

Contributing

Anyone is welcome contribute to this project, implementing new algorithms or fixing something.

1.2.0

3 months ago

1.3.2

3 months ago

1.3.1

3 months ago

1.3.0

3 months ago

1.1.5

4 months ago

1.1.4

4 months ago

1.1.3

4 months ago

1.1.2

4 months ago

1.1.1

4 months ago

1.1.0

4 months ago

1.0.0

4 months ago