How can I measure the similarity between 2 strings? [closed]

There are various different ways of doing this. Have a look at the Wikipedia “String similarity measures” page for links to other pages with algorithms.

I don’t think any of those algorithms take sounds into consideration, however – so “staq overflow” would be as similar to “stack overflow” as “staw overflow” despite the first being more similar in terms of pronunciation.

I’ve just found another page which gives rather more options… in particular, the Soundex algorithm (Wikipedia) may be closer to what you’re after.

Leave a Comment