diff options
author | Eric Albright <eric_albright@sil.org> | 2007-12-07 10:03:51 +0000 |
---|---|---|
committer | Eric Albright <eric_albright@sil.org> | 2007-12-07 10:03:51 +0000 |
commit | 0d20be5a760553647dbd970a46307877a36055f7 (patch) | |
tree | 0f1dd396a1101e240a94e8ddf2fc21e038c15408 /src/pwl.c | |
parent | ecd6723df72585fba3d269aebc2e28fd057dd74a (diff) | |
download | enchant-0d20be5a760553647dbd970a46307877a36055f7.tar.gz |
Fix pwl suggest. When a word is a prefix of another word and the edits the word being searched is shorter, the prefixed word was not found.
git-svn-id: svn+ssh://svn.abisource.com/svnroot/enchant/trunk@22362 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
Diffstat (limited to 'src/pwl.c')
-rw-r--r-- | src/pwl.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -889,7 +889,7 @@ static void enchant_trie_find_matches(EnchantTrie* trie,EnchantTrieMatcher *matc g_return_if_fail(matcher); - /* Cant match in the empty trie */ + /* Can't match in the empty trie */ if(trie == NULL) { return; } @@ -960,19 +960,19 @@ static void enchant_trie_find_matches(EnchantTrie* trie,EnchantTrieMatcher *matc g_free(nxtChS); + matcher->num_errors++; if (matcher->word[matcher->word_pos] != '\0') { - matcher->num_errors++; /* Match on inserting word[0] */ oldPos = matcher->word_pos; matcher->word_pos = nxtChI; enchant_trie_find_matches(trie,matcher); matcher->word_pos = oldPos; - /* for each subtrie, match on delete or swap word[0] */ - g_hash_table_foreach(trie->subtries, - enchant_trie_find_matches_cb, - matcher); - matcher->num_errors--; - } + } + /* for each subtrie, match on delete or substitute word[0] */ + g_hash_table_foreach(trie->subtries, + enchant_trie_find_matches_cb, + matcher); + matcher->num_errors--; } static void enchant_trie_find_matches_cb(void* keyV,void* subtrieV,void* matcherV) |