开发者

hunspell spell check

开发者 https://www.devze.com 2022-12-15 08:47 出处:网络
I had a specific question reg开发者_如何学编程rading ordering the suggested words returned by hunspell on a typo. The words seems to be returned in an alpha order. I want to order the suggestions by r

I had a specific question reg开发者_如何学编程rading ordering the suggested words returned by hunspell on a typo. The words seems to be returned in an alpha order. I want to order the suggestions by relevance, that is the closest match should show up first. I couldn't find any way to do that via hunspell apis. How can this be achieved?


You're not putting the results into a sorted list or anything like that, are you?

When I call int iCount = pHunspell->suggest(aSuggestions, "Testig") I get "Testing, Testis, Testes". If it was in alphabetical order, "Testes" would have been first, which is certainly not what I had intended.

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


I agree with above. Hunspell makes use of certain probability models like keyboard character proximities and phonetic similarities to suggest best matches. You must be storing it in a list which gets sorted.

0

精彩评论

暂无评论...
验证码 换一张
取 消