Presentation is loading. Please wait.

Presentation is loading. Please wait.

Globalization Services: Spell Checking API

Similar presentations


Presentation on theme: "Globalization Services: Spell Checking API"— Presentation transcript:

1 Globalization Services: Spell Checking API

2 Spell Checking API The Spell Checking API permits developers to consume spell checker capability to check text, get suggestions, and maintain settings and user dictionaries. Developers can also create spell checkers that are integrated into the spell checking framework as providers.

3 Versioning The Spell Checking API is available beginning with the Windows 8 or Windows Server 2012. Future additions to the API will be handled by creating new interfaces that can be determined using Queryinterface on the existing ones.

4 Interfaces The Spell Checking API contains the following interfaces:
IComprehensiveSpellCheckProvider IEnumSpellingError IOptionDescription ISpellChecker ISpellChecker2 ISpellCheckerChangedEventHandler ISpellCheckerFactory ISpellCheckProvider ISpellCheckProviderFactory ISpellingError IUserDictionariesRegistrar

5 ISpellingError Interface
This inferface provides information about a spelling error. ISpellingError Interface has these methods. Method Description ISpellingError::get_CorrectiveAction Indicates which corrective action should be taken for the spelling error. ISpellingError::get_Length Gets the length of the erroneous text. ISpellingError::get_Replacement Gets the text to use as replacement text when the corrective action is replace. ISpellingError::get_StartIndex Gets the position in the checked text where the error begins.

6 Error handling Errors are returned as HRESULTs. Standard RPC error codes may be returned by any of the API calls because they are out-of-proc. Standard RPC timeouts apply.

7 ISpellCheckerFactory interface
ISpellCheckerFactory is the starting point for clients of the Spell Checking API, which should be created as an in-proc COM Server as shown in the example below. SpellCheckerFactory interface has these methods. Method Description ISpellCheckerFactory::CreateSpellChecker Creates a spell checker that supports the specified language. ISpellCheckerFactory::get_SupportedLanguages Gets the set of languages/dialects supported by any of the registered spell checkers. ISpellCheckerFactory::IsSupported Determines if the specified language is supported by a registered spell checker.

8 Dictionary files The plaintext that must start with the appropriate Byte Order Mark (BOM). Each line contains a word (in the Added and Exuser-specific dictionaries for a language, which hold the content for the Added, Excluded, and AutoCorrect word lists, are located under %AppData%\Microsoft\Spelling\. The filenames are default.dic (Added), default.exc (Excluded) and default.acl (AutoCorrect). Other .dic, .exc, and .acl files present in the directory will be detected by the spell checking service and added to the user word lists. These files are considered to be read-only and are not modified by the spell checking API.

9 Installing a spell checking provider
The installation of a spell checking provider must place all the files it uses in a location that allows read access from the SID (security identifier) "ALL APPLICATION PACKAGES". Installing it in a folder under "Program Files" works well. Also, the provider must set some keys in the registry for it to appear to the spell checking API. It can be in either the HKEY_CURRENT_USER hive or the HKEY_LOCAL_MACHINE hive depending on whether it should install only for the current user or all users.

10 These are few provider keys:
Key: <Registry hive>\SOFTWARE\Classes\CLSID\<Server CLSID> Default (REG_SZ) = <Name of the provider> Key: <Registry hive>\SOFTWARE\Classes\CLSID\<Server CLSID>\InprocServer32 ThreadingModel (REG_SZ) = "Both" Key: <Registry hive>\SOFTWARE\Classes\CLSID\<Server CLSID>\Version Version (REG_SZ) = <Version> Key: <Registry hive>\SOFTWARE\Microsoft\Spelling\Spellers\<Provider id string> CLSID (REG_SZ) = <CLSID of the COM Server that implements the provider> The spell checking provider sample provides an example of the registration needed to install a provider. If you are creating new spell checking options for a spell checking provider, see IOptionDescription::Id for guidance on naming.

11 Sources

12 Thank you for your attention


Download ppt "Globalization Services: Spell Checking API"

Similar presentations


Ads by Google