http://www.perlmonks.org?node_id=804191


in reply to Search for similar strings - to standardise

For the string comparison, using the Levenshtein distance is probably your best bet. This is often used in spell-checking to suggest corrections.

For implementations, there is a Text::Levenshtein module on CPAN. But also, take a look at this node and this node.

  • Comment on Re: Search for similar strings - to standardise

Replies are listed 'Best First'.
Re^2: Search for similar strings - to standardise
by educated_foo (Vicar) on Oct 31, 2009 at 03:33 UTC
    Edit distance would be useful for comparison, but not so much for clustering strings with their common misspellings. For that, you might try n-grams (mentioned above) or locality-sensitive hashing (basically the same thing, but with gaps).