L_OcrSpellCheckManager_AddUserWords

Summary

Adds user words to a language dictionary.

Syntax

#include "ltocr.h"

L_LTOCR_API L_INT EXT_FUNCTION L_OcrSpellCheckManager_AddUserWords(spellCheckManager, language, words)

Parameters

L_OcrSpellCheckManager spellCheckManager

OCR engine spell check manager handle.

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. Each word in this string should not exceed 80 characters long, otherwise it will be ignored and will not be added to the dictionary.

Returns

Value Meaning
SUCCESS Language is supported.
< 1 Language is not supported. Refer to Return Codes.

Comments

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

Example

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; 
} 

See Also

Functions

Topics

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

LEADTOOLS OCR Module - LEAD Engine C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.