While not exactly what you are looking for, I thought : couln't you get something approaching using the Soundex and other phonetic algorithms ?

There seems to be a few different on the CPAN.

And then, paf ! Serendipity and CPAN search brings you : Text::Approx Which looks a lot like a solution to your problem.

And of course, if you have a function calculating Levensthein distance database side (which is relatively simple to write as stored procedure when it does not already exists), you could write something like:
SELECT word FROM words WHERE leven_dist(word,myword) < some_limit

As an exemple, a postgresql PGSQL version can be found there, a MYSQL stored procedure doing that there, and an Oracle PL/SQL there.

Please note that I did not check the correctness or efficiency of those implementations.

An optimisation wasting space vs CPU would be to precompute the most distances for the most commonly used words and typos (my guess being that the most common typos for the most commonly used words would heavily be dominating the use cases).

Thank you again CPAN.


In reply to Re: Module to provide suggested terms for search? by goupilInside
in thread Module to provide suggested terms for search? by punch_card_don

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.