Next: A. Changelog
Up: Aspell .28.2.1 alpha A
Previous: 5. International Support
  Contents
6. How Aspell Works
The magic behind my spell checker comes from merging Lawrence Philips excellent
metaphone algorithm and Ispell's near miss strategy which is inserting a space
or hyphen, interchanging two adjacent letters, changing one letter, deleting
a letter, or adding a letter.
The process goes something like this.
- Convert the misspelled word to its soundslike equivalent (its metaphone for
English words).
- Find words that have the same soundslike pattern.
- Find words that have similar soundslike patterns. A similar soundlike pattern
is a pattern that is obtained by interchanging two adjacent letters, changing
one letter, deleting a letter, or adding a letter.
- FInd misspelled words that have a correctly spelled replacement by the same
criteria of step number 2 and 3. That is the misspelled word in the word pair
(such as teh->the) would appear in the suggestions list as if it was a correct
spelling.
- Score the result list and return the words with the lowest score. The score
is roughly the weighed average of the edit distance of the word to the misspelled
word, the soundslike equivalent of the two words, and the phoneme of the two
words. The edit distance is the weighed total of the number of deletions, insertions,
exchanges, or adjacent swaps needed to make one string equivalent to the other.
- Replace the misspelled words that have correctly spelled replacements with their
replacements and remove any duplicates that might arise because of this.
Please note that the soundslike equivalent is a rough approximation of how the
words sounds. It is not the phoneme of the word by any means. For more details
about exactly how each step is performed please see the file suggest.cc.
For more information on the metaphone algorithm please see the file metaphone.cc
which included a detailed description of it.
Next: A. Changelog
Up: Aspell .28.2.1 alpha A
Previous: 5. International Support
  Contents
Kevin Atkinson
1999-08-25