This section is relevant to you if you are using
aspell_AND_espell
mode with DYM enabled. It describes
the interaction of both spelling modes with DYM and explains why in some
instances, suggestions that should have been found by Aspell or Espell are not
considered by DYM. In other words, you may observe that in some instances
user-entered words with misspellings in them do not return DYM suggestions, if
the
aspell_AND_espell
mode is used.
The following statements describe the reasons behind this behavior in more detail:
Both spelling modes, Aspell or Espell, work by generating a list of suggestion results. These suggestions are weighted based on the lowest score, according to a scoring algorithm.
Aspell and Espell generate scores based on different scoring algorithms (described below in this section).
When both modes are used, as is the case with
aspell_AND_espell
, DYM uses the union of the scored suggestions provided by each spelling mode, and keeps the top 10 terms from the combined list, based on the lowest scores.As a result, some suggestions found by Espell (that could have been relevant) do not pass the scoring criteria in the combined list, and are thus not considered by DYM.
The following statements discuss how scores are calculated for each of the spelling engines (Aspell and Espell):
For information about the GNU Aspell scoring algorithm, see the documentation for this open source product.
The Espell scoring algorithm uses the following formula:
(85 - num_matching_characters_in_prefix)* edit_distance
The parameter
edit_distance
specifies a regular Levenshtein distance (see the Internet for more information). Inedit_distance
, character swaps, insertions and deletions count as an edit distance of 1.The
num_matching_characters_in_prefix
is a number of all matching characters before a mismatch occurs. For example, for the term "java", this number is 2 (matching "j" and "a"); for the term "jsva", this number is 1 (matching only "j").