Hunspell Spell Checker

I had a specific question regulating the order of the suggested words returned by hunspell in a typo. Words seem to be returning in alpha order. I want to order proposals for relevance, that is, the next match should appear first. I could not find a way to do this using the hunspell apis. How can this be achieved?

+3
source share
2 answers

You do not put the results in a sorted list or something like that, do you?

When I call int iCount = pHunspell->suggest(aSuggestions, "Testig"), I get "Testing, Tests, Tests". If it were in alphabetical order, “Tests” would be the first, which, of course, was not what I intended.

Tested in unmanaged C ++ with versions 1.2.2 and 1.3.2.

+3
source

I agree with the above. Hunspell uses certain probabilistic models, such as proximity to the keyboard and phonetic similarities, to offer better matches. You must store it in a list that is sorted.

0
source

Source: https://habr.com/ru/post/1727444/


All Articles