B
B
bqio2018-02-06 09:25:27
JavaScript
bqio, 2018-02-06 09:25:27

How to implement inaccurate string comparison?

There are two lines:
Erin Fitzgerald
OEridn Fitzgserdalds
There may be a completely different number of words and letters represented in them. How to determine the similarity of strings in percent?
For example, line 2 is similar to line 1 by 40% .

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Shelemetiev, 2018-02-06
@bqio

Similarity can be calculated, for example, from the Levenshtein distance .
example another example
The smaller the distance, the more similar the strings.
How to convert this distance into percentages, decide for yourself if you need it

A
Alexander Aksentiev, 2018-02-06
@Sanasol

https://github.com/bevacqua/fuzzysearch

R
RidgeA, 2018-02-06
@RidgeA

https://github.com/NaturalNode/natural

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question