Windows 8 Spell checking provider

假装没事ソ 提交于 2019-12-08 00:44:23

问题


I'm trying to implement my own Spell Check provider for Windows 8. I have a class which receives a word and returns the correct word, however, I cannot find the class or function in the Spell Checking Provider Sample by Microsoft where I receive the user input string and return for it the correction.


回答1:


Since you are implementing a spell checking provider, you will be implementing the ISpellCheckProvider interface. (In the sample you refer to, this is implemented by the SampleSpellCheckProvider class)

There are actually two phases for spell checking. The first is checking to see whether some text contains any errors and the second is providing suggestions.

The first phase happens in the call to Check. In this you are provided the text to check and you return a class which implements IEnumSpellingError that class should cache the text and return any errors that it finds in calls to Next. (You can find an implementation of IEnumSpellingError in the EnumSpellingError class in the sample. In the sample, it ends up calling EngineCheck on the provider (an internal method) which calls FindFirstError on SampleEngine -- the actual checking and suggesting being isolated into the SampleEngine.h file while the others focus on the infrastructure)

The second phase happens in the call to Suggest. In this you are given a word and return the set of suggestions as a class which implements IEnumString.



来源:https://stackoverflow.com/questions/11986936/windows-8-spell-checking-provider

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!