✎ NOTE
User words and dictionaries are no longer supported in the LEADTOOLS OCR Module - OmniPage Engine.
#include "ltdoc2.h"
L_LTDOC2_API L_INT EXT_FUNCTION L_Doc2AddItemToUserDictionary(hDoc, pSection, pUDitem, uMask)
Adds a new section item to the specified section in the User dictionary.
Handle to the OCR document.
Name of the section where the word should be added. If the specified section does not exist, a new section will be created automatically.
Pointer to a UNICODE string containing the item to be added.
Value that indicates the type of expression to be added. Possible values are:
Value | Meaning |
---|---|
DOC2_USER_DICT_LITERAL | [0x0000] Use the literal expression. This is the default value. |
DOC2_USER_DICT_REGULAR_EXPRESSION | [0x0001] Use the regular expression. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function can be used to add a new User dictionary item (a literal or a regular expression), to the User dictionary that is currently open.
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 DOC2_MAX_UD_ITEM_LENGTH characters, the function will ignore the extra 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 DOC2_USER_DICT_REGULAR_EXPRESSION, the User dictionary item will be evaluated for conformance during the checking of the recognized result.
Required DLLs and Libraries
For an example, refer to L_Doc2SetUserDictionary.