Windows 8 Spell checking provider

荒凉一梦 提交于 2019-12-06 06:17:02

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.

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