Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Thursday, April 2, 2020 11:48:41 AM(UTC)

Nick  
Nick

Groups: Registered, Tech Support, Administrators
Posts: 163

Was thanked: 9 time(s) in 9 post(s)

The LEADTOOLS LEAD OCR engine comes with a default spellcheck dictionary consisting of words, phrases, and letter combinations. This dictionary can be extended by using the IOcrSpellCheckManager.AddUserWords() method.

https://www.leadtools.com/help/sdk/v22/dh/fo/iocrspellcheckmanager-adduserwords.html

This method accepts parameters specifying what language the words are in and an array containing the words to be added. Note only languages currently installed can have words added. The IOcrSpellCheckManager.GetSupportedSpellLanguages() method enumerates these and IOcrSpellCheckManager.IsSpellLanguageSupported() returns a value based on the specified one.

https://www.leadtools.com/help/sdk/v22/dh/fo/iocrspellcheckmanager-getsupportedspelllanguages.html
https://www.leadtools.com/help/sdk/v22/dh/fo/iocrspellcheckmanager-isspelllanguagesupported.html

Here's a code snippet which shows determining a language is present and updating its dictionary accordingly:

Code:

         using (IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD, false))
         {
            ocrEngine.Startup(null, null, null, null);
            IOcrSpellCheckManager spellCheckManager = ocrEngine.SpellCheckManager;
            string en = "en";

            if (spellCheckManager.IsSpellLanguageSupported(en))
            {
               string[] wordsToAdd = { "LEADTOOLS", "OCR" };
               spellCheckManager.AddUserWords(en, wordsToAdd);
            }

            ocrEngine.Shutdown();
         } 


Note that the appropriate dictionary must be deployed for the language. We have these listed in our documentation on "OCR Files to be Included with your Application".
https://www.leadtools.com/help/sdk/v22/dh/to/leadtools-ocr-module-lead-engine-runtime-files.html

Edited by user Tuesday, March 22, 2022 7:51:01 AM(UTC)  | Reason: Updated links to v22

Nick Crook
Developer Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.045 seconds.