Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.23
LEADTOOLS OCR C DLL Help

L_Doc2AddItemToUserDictionary

Show in webframe

#include "ltdoc2.h"

L_LTDOC2_API L_INT EXT_FUNCTION L_Doc2AddItemToUserDictionary(hDoc, pSection, pUDitem, uMask)

L_HDOC2 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

 

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

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

LTDOC2

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_Doc2SetUserDictionary, L_Doc2GetUserDictionary, L_Doc2GetUserDictionaryState, L_Doc2GetUserDictionarySection, L_Doc2GetUserDictionarySectionItem, L_Doc2RemoveItemFromUserDictionary

Topics:

OCR Functions: User Dictionary

 

Working with a Dictionary

Example

For an example, refer to L_Doc2SetUserDictionary.

Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.