Re: Spelling suggestions for common words - ispell, etc.
- From: Ben Bullock <benkasminbullock@xxxxxxxxx>
- Date: Thu, 3 Apr 2008 23:27:56 -0700 (PDT)
On Apr 3, 6:47 pm, sftriman <ironma...@xxxxxxxxx> wrote:
I am looking for a way to, without custom defining a dictionary, to
get a list of suggested words for a misspelled word. Or better, "the"
most likely intended word for a misspelled word.
from which I could easily pass on the dmr suggestions, but, scoring
and evaluating the suggestions for wjite is harder. "white" and
"write" are 'ranked' (I guess) 3rd, 4th, and 7th.
One thing which might help you rank the strings is the "Levenshtein
distance". This gives you the "difference" between two strings as a
number. I don't know if it is on CPAN but there is a module found
here:
http://world.std.com/~swmcd/steven/perl/lib/String/Levenshtein/index.html
The documentation is here:
http://world.std.com/~swmcd/steven/perl/lib/String/Levenshtein/Levenshtein.html
Presumably the string with the smallest Levenshtein distance from the
input string would be the most likely candidate for the spelling
checker, although some very rare words might have small distances.
.
- Follow-Ups:
- Re: Spelling suggestions for common words - ispell, etc.
- From: Ted Zlatanov
- Re: Spelling suggestions for common words - ispell, etc.
- References:
- Spelling suggestions for common words - ispell, etc.
- From: sftriman
- Spelling suggestions for common words - ispell, etc.
- Prev by Date: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.8 $)
- Next by Date: Re: Creating a 'load simulator' by calling Perl Programs - or Forking?
- Previous by thread: Re: Spelling suggestions for common words - ispell, etc.
- Next by thread: Re: Spelling suggestions for common words - ispell, etc.
- Index(es):
Relevant Pages
|