This structure contains information about a spelling session. An application uses this structure to specify the text for the spelling checker to process, and the spelling checker uses this structure to return misspelled words and suggested corrections.
At a Glance
Header file: | Splapi.h |
Windows CE versions: | 2.10 and later |
Syntax
typedef struct tagSPLBUFFER{
const WCHAR * pwszIn;
WCHAR * pwszOut;
SPLSUGGEST aspl[8];
DWORD iwcIn;
DWORD cwcIn;
DWORD dwMode;
DWORD cwcOut;
DWORD cwcUsed;
DWORD dwErr;
DWORD iwcErr;
DWORD cwcErr;
DWORD cspl;
} SPLBUFFER, *PSPLBUFFER;
Members
pwszIn
Pointer to the beginning of the input buffer, which contains the text to be processed.
pwszOut
Pointer to the output buffer, which the spelling checker fills with suggestions. Each suggested word is a null-terminated string. A second NULL character indicates the end of the suggestion list. When the application calls the SplEnumUserDict function, the output buffer contains up to eight words from the specified user dictionary.
aspl
Array of eight SPLSUGGEST structures that specify pointers to spelling checker suggestions and the score for each suggestion. The pwsz member of SPLSUGGEST points to a single suggestion, which is a null-terminated string in pwszOut. The nScore member of SPLSUGGEST specifies the suggestion’s score. The spelling checker can provide up to eight suggestions and scores for each misspelled word.
iwcIn
Index that specifies a number of characters offset from pwzIn. Use iwcIn for context checking. The iwcIn member specifies to the spelling checker a number of characters preceding the first word to be checked. For example, the spelling of the first word to be processed can depend on the word that precedes it.
cwcIn
Size, in characters, of the input buffer relative to pwszIn.
dwMode
Specifies the processing mode. It is one of the following flags:
Value | Description |
SPL_NO_STATE_INFO | The input buffer has an arbitrary starting point. This mode occurs when the user selects a portion of a document to check instead of an entire document. |
SPL_IS_CONTINUED | After the user requests that the spelling checker ignore an error, the spelling checker continues to process the text in the input buffer. |
SPL_IS_EDITED_CHANGE | The input buffer has changed because a mistake was corrected. The result is a signal to an application to carefully resume processing because of the potential of entering a loop where the spelling checker becomes stuck on a word that it determines to be incorrect. |
SPL_STARTS_SENTENCE | The input buffer starts at the beginning of a sentence. This mode typically occurs when processing starts at the beginning of the input buffer. |
cwcOut
Size, in characters, of the output buffer.
cwcUsed
Portion of the output buffer, in characters, that the suggestions utilize. This value includes the NULL character that terminates each suggestion.
dwErr
Specifies the error or result of the spell checking. It is one of the following flags:
Value | Description |
SPL_OK | The spelling checker reached the end of the input buffer and found no more errors. |
SPL_ERROR_CAPITALIZATION | The word should be capitalized. |
SPL_INITIAL_NUMERAL | The word begins with a numeral. |
SPL_MORE_INFO_THAN_BUFFER_CAN_HOLD | The output buffer is not large enough to hold all the suggestions. |
SPL_NO_MORE_SUGGESTIONS | There are no more suggestions for the misspelled word. |
SPL_REPEAT_WORD | The word occurs consecutively in the buffer. |
SPL_RETURNING_AUTO_REPLACE | The spelling checker returned a word that automatically replaces the misspelled word. |
SPL_RETURNING_CHANGE_ALWAYS | The spelling checker returned a word that is in the change always internal user dictionary. |
SPL_RETURNING_CHANGE_ONCE | The spelling checker returned a word that is in the change once internal user dictionary. |
SPL_UNKNOWN_INPUT_WORD | The word is not in any of the dictionaries. |
SPL_WORD_CONSIDERED_ABBREVIATION | The word is probably an abbreviation, but the spelling checker indicates the word is an error nevertheless. |
SPL_UNKNOWN_ERROR | The error is not known. |
iwcErr
Index of the location of the error relative to the beginning of the input buffer, which pwszIn points to. The iwcErr member specifies the number of characters in the input buffer that precede the error.
cwcErr
Length of the word containing the error. A possible use of this value is to specify a single word to check with an inline spelling checker with an automatic replacement feature.
cspl
Number of suggestions that the spelling checker provides in the output buffer.
Remarks
The SplCheck, SplSuggest, and SplReplace functions use this structure to track a spelling session. A spelling session is created by the SplInit function and ended by the SplQuit function. SplCheck causes the spelling checker to process the input buffer. SplSuggest causes the spelling checker to provide suggestions in the output buffer. SplReplace offers a suggestion that an application can use to automatically replace a misspelled word. An application can use this function to implement an inline spelling checker with an automatic replacement feature.
The SplEnumUserDict function uses the output buffer to enumerate user dictionaries so that an application can display dictionary contents to a user.
See Also
SplCheck, SplEnumUserDict, SplInit, SplQuit, SplReplace, SplSuggest, SPLSUGGEST