LEADTOOLS OCR C DLL Help > Function References > OCR Plus > L_DocAddItemToUserDictionary |
#include "ltdoc.h"
L_LTDOC_API L_INT L_DocAddItemToUserDictionary(hDoc, pSection, pUDitem, uMask)
L_HDOC hDoc; |
/* handle to the OCR document */ |
L_CHAR * pSection; |
/* section name */ |
L_WCHAR * pUDitem; |
/* UNICODE string, containing the section item to be added */ |
L_UINT32 uMask; |
/* mask */ |
Adds a new section item to the specified section in the user dictionary.
Parameter |
Description |
|
hDoc |
Handle to the OCR document. |
|
pSection |
Name of the section where the word should be added. If the specified section does not exist, a new section will be created automatically. |
|
pUDitem |
Pointer to a UNICODE string containing the item to be added. |
|
uMask |
Value that indicates the type of expression to be added. Possible values are: |
|
|
Value |
Meaning |
|
USER_DICT_LITERAL |
[0x0000] Use the literal expression. |
|
USER_DICT_REGULAR_EXPRESSION |
[0x0001] Use the regular expression. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
L_DocAddItemToUserDictionary can be used to add a new User dictionary item, that is a literal or a regular expression, to the User dictionary currently opened.
The item will be added to the section of the User dictionary specified by pSection.
User dictionary items are UNICODE strings and they must be no longer than MAX_UD_ITEM_LENGTH characters (including the terminating zero). They may contain spaces and punctuation characters.
When adding a new user dictionary item its uMask also has to be specified. An item can be added either as a literal or as a regular expression. When uMask is USER_DICT_REGULAR_EXPRESSION, the User dictionary item will be evaluated for conformance during the checking of the recognized result.
Required DLLs and Libraries
LTDOC For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
Functions: |
L_DocSetUserDictionary, L_DocGetUserDictionary, L_DocGetUserDictionaryState, L_DocGetUserDictionarySection, L_DocGetUserDictionarySectionItem, L_DocRemoveItemFromUserDictionary |
Topics: |
|
|
Example
For an example, refer to L_DocSetUserDictionary.