L_Doc2AddItemToUserDictionary

✎ 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.

Parameters

L_HDOC2 hDoc

Handle to the OCR document.

L_CHAR * 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.

L_WCHAR * pUDitem

Pointer to a UNICODE string containing the item to be added.

L_UINT32 uMask

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.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

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

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

LEADTOOLS OCR Module - OmniPage Engine C API Help