Working with Dictionaries

✎ NOTE

User words and dictionaries are no longer supported in the LEADTOOLS OCR Module - OmniPage Engine.

The checking subsystem is responsible for checking spelling, checking the user dictionary for acceptable words during recognition, provided a user dictionary has been set, and using a user-written callback function.

LEADTOOLS OCR Module - OmniPage Engine

The language dictionary to use for spell-checking should be specified in the SpellLangId member of the pRecogOpts parameter passed to the L_Doc2Recognize / L_Doc2RecognizeExt function.

To specify a custom dictionary file not listed in Languages and Dictionaries, use  L_Doc2SetUserDictionary. After creating the dictionary, pass the dictionary name to the szSection member in the ZONEDATA2 structure, set the CharFilter member to DOC2_ZONE_CHAR_FILTER_USER_DICTIONARY, update zone data by calling L_Doc2UpdateZone / L_Doc2UpdateZoneExt, then recognize the page(s) by calling L_Doc2Recognize / L_Doc2RecognizeExt.

To get the name of the current user dictionary, call L_Doc2GetUserDictionary.

A new user dictionary can be created or an existing dictionary loaded from a file by calling L_Doc2SetUserDictionary. To create a new user dictionary, call L_Doc2SetUserDictionary with the bCreateUD parameter set to TRUE. This will save the current user dictionary to a file and disable that user dictionary.

While the user dictionary is being used, it may have material added or removed. The L_Doc2GetUserDictionaryState indicates whether the user dictionary has been changed while it has been open.

A user dictionary consists of one or more sections (folders or categories) and each section can have one or more items (folder contents). When the user dictionary is opened or created, the user dictionary is opened to a specific default section, specified in the pszDefSection member of the pUDOpts parameter of the L_Doc2SetUserDictionary function. To get the name of that section, use L_Doc2GetUserDictionarySection.

Individual items within a section can be obtained using L_Doc2GetUserDictionarySectionItem. Items can be added to or removed from a section using L_Doc2AddItemToUserDictionary and L_Doc2RemoveItemFromUserDictionary.

For more information, refer to:

Languages and Dictionaries

Working with Languages

DOC2_LANGIDS

Punctuation and Miscellaneous Characters

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

LEADTOOLS OCR Module - OmniPage Engine C API Help