#include "ltocr.h"

L_LTOCR_API L_INT EXT_FUNCTION L_OcrSpellCheckManager_AddUserWords(spellCheckManager, language, words)

L_OcrSpellCheckManager spellCheckManager; handle to the OCR engine spell check manager
L_OcrLanguage language; language the user wish to add words to its dictionary
const L_WCHAR* words; one string that contains all words separated by null termination

Adds user words to a language dictionary.

Parameter Description
spellCheckManager OCR engine spell check manager handle.
language Language the user wish to add words to its dictionary.
words 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.


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.

Required DLLs and Libraries

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.


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; 

Help Version 20.0.2019.3.12
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.