# Re: Mini quiz (Was: Detecting similar strings)

**URL:** <https://www.ruby-forum.com/t/re-mini-quiz-was-detecting-similar-strings/101075>\
**Category:** Ruby\
**Created:** [August 3, 2006, 12:18pm UTC](https://www.ruby-forum.com/t/re-mini-quiz-was-detecting-similar-strings/101075 "2006-08-03T12:18:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 3, 2006, 12:18pm UTC](https://www.ruby-forum.com/t/re-mini-quiz-was-detecting-similar-strings/101075/1 "2006-08-03T12:18:19Z")

</div>

> You will need to calculate the distance for all values in the field to  
> compare it with the user \>input, then pick the small distances and  
> display them  
> as options. As the list of values \>grows larger, your app will bog  
> down.

That’s an interesting point: I once used Levenstein distance in a  
self-written typo correcting  
program, where I used a list of about 200000 English words as a  
reference,  
and tried  
to correct words that couldn’t be found by suggesting words of small  
Levenstein distance …  
Then it took several minutes to correct a text of 100 pages with quite a  
lot  
of typos  
in it (I corrected each typo only once for all the document), which was  
nevertheless acceptable for me in that case.  
One could speed this up a little bit by excluding some comparison pairs  
right from  
the start, because they consist of long and short words which would have  
too  
great Levenstein distance anyway…

But if you are working on person’s names in a database, I doubt that  
there  
are going to  
be that many different names in them…

Best regards,

Axel
