Adds user words to a language dictionary.
#include "ltocr.h"
L_LTOCR_API L_INT EXT_FUNCTION L_OcrSpellCheckManager_AddUserWords(spellCheckManager, language, words)
OCR engine spell check manager handle.
Language the user wish to add words to its dictionary.
One string that contains all words separated by null termination. Each word in this string should not exceed 80 characters long, otherwise it will be ignored and will not be added to the dictionary.
Value | Meaning |
---|---|
SUCCESS | Language is supported. |
< 1 | Language is not supported. Refer to Return Codes. |
Use this method to add user words to the current loaded dictionary. Note that the OCR engine does not automatically correct the misspelling of words unless the confidence of the characters are low.
L_INT OcrSpellCheckManager_AddUserWordsExample(L_OcrSpellCheckManager spellCheckManager)
{
L_INT nRet;
L_WCHAR userWords[MAX_PATH]; /* Holds the list of user words */
/* Set the userWords data to contain: [ "LEADTOOLS", "ePrint" ] */
memset(userWords, 0, MAX_PATH * sizeof(L_WCHAR));
wcscpy_s(userWords, MAX_PATH, L"LEADTOOLS\0ePrint");
/* Check if the spell check manager supports english */
nRet = L_OcrSpellCheckManager_IsLanguageSupported(spellCheckManager, L_OcrLanguage_EN);
if(nRet != SUCCESS)
return nRet;
/* Add the words to the spell check manager */
nRet = L_OcrSpellCheckManager_AddUserWords(spellCheckManager, L_OcrLanguage_EN, userWords);
if(nRet != SUCCESS)
return nRet;
return SUCCESS;
}