Working with Dictionaries

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.

For more information, refer to:

Languages and Dictionaries

Working with Languages

LANGIDS

Punctuation and Miscellaneous Characters

OCR Plus

To use a user dictionary during recognition, one must be created/set using L_DocSetUserDictionary before calling L_DocRecognize. To get the name of the current user dictionary, call L_DocGetUserDictionary.

A new user dictionary can be created or an existing dictionary loaded from a file by calling L_DocSetUserDictionary. To create a new user dictionary, call L_DocSetUserDictionary 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_DocGetUserDictionaryState 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_DocSetUserDictionary function. To get the name of that section, use L_DocGetUserDictionarySection.

Individual items within a section can be obtained using L_DocGetUserDictionarySectionItem. Items can be added to or removed from a section using L_DocAddItemToUserDictionary and L_DocRemoveItemFromUserDictionary.

OCR Professional

The language dictionary to use for spell-checking should be specified in the SpellLangId member of the pRecogOpts parameter passed to the L_Doc2Recognize 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, then recognize the page(s) by calling L_Doc2Recognize.

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.