There may be times when you need to check the spelling of words that are not in the main dictionary or in the external user-defined dictionary. For example, a user may want to enter his or her name, or may want to use a variety of technical language in a specific document. You can modify both the internal and external dictionary lists to suit the needs of your users.
The internal and external user dictionaries are lists of null-terminated words. Two null characters in a row indicate the end of a dictionary. The following code example shows a series of possible listings from a user dictionary:
…thier\0their\0wierd\0weird\0\0
Words are listed with the incorrect word first and the correct word second. This is the format that the SPL_CHANGE_ALWAYS and SPL_CHANGE_ONCE internal dictionaries use.
The following table describes the functions that you can use during a spelling session to modify internal and external user dictionaries.
Function |
Description |
SplAddUserDict | Adds a single word or word pair to the specified dictionary |
SplRemUserDict | Removes a single word or word pair from the specified dictionary |
SplClrUserDict | Clears all entries from the specified dictionary |
SplAddUserDict, SplRemUseDict, and SplClrUserDict all use the spelling dictionary identifiers specified in the ppwz parameter of SplInit.
The SplEnumUserDict function enumerates the contents of a specified internal or external user dictionary. The function writes the dictionary contents to the output buffer specified by the pwszOut parameter in the SPLBUFFER structure. One use of enumeration is to present a dictionary's contents to a user, who can then select words to be added and removed with SplAddUserDict and SplRemUserDict.