LEADTOOLS OCR Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.22
Working With OCR User Dictionaries

Important Note: User dictionaries are only supported in the Advantage OCR engine in this version of LEADTOOLS. Using the functionality of the Leadtools.Forms.Ocr.IOcrUserDictionary interface in any other engine will have no effect on the recognition results.

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.

You can access the checking subsystem of the OCR engine with the IOcrEngine.SpellCheckManager property.

To use a user dictionary during recognition, one must be created/set using the IOcrUserDictionary interface before calling IOcrPage.Recognize. To get the instance of the user dictionary currently used by the spell check manager, use IOcrSpellCheckManager.UserDictionary. To get the name of the current user dictionary, call the IOcrUserDictionary.FileName property.

A new user dictionary can be created or an existing dictionary loaded from a file by calling IOcrUserDictionary.Use. To create a new user dictionary, call IOcrUserDictionary.Create and to open (for editing) an existing dictionary, call IOcrUserDictionary.Open. Both of these methods will open the newly created or existing dictionary and prepare them for editing.

While the user dictionary is opened, it may have material added or removed. The IOcrUserDictionary.IsModified property 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 IOcrUserDictionary.DefaultSectionName property.

Individual items within a section can be obtained using IOcrUserDictionary.GetFirstItem and IOcrUserDictionary.GetNextItem. Items can be added to or removed from a section using IOcrUserDictionary.AddItem and IOcrUserDictionary.RemoveItem.

You can also set a global user defined spell checking callback. This callback should be used for zones where the accuracy of the recognition should be improved by providing the recognition module involved with additional checking information derived from the application. You can set this callback the IOcrSpellCheckManager.SetSpellCheckCallback method.