LEADTOOLS OCR (Leadtools.Forms.Ocr assembly)

IOcrSpellCheckManager Interface

Show in webframe
Example 







Members 
Manages the spell checking sub system of the OCR engine.
Object Model
Syntax
public interface IOcrSpellCheckManager 
'Declaration
 
Public Interface IOcrSpellCheckManager 
'Usage
 
Dim instance As IOcrSpellCheckManager
public interface IOcrSpellCheckManager 
@interface LTOcrSpellCheckManager : NSObject

            
function Leadtools.Forms.Ocr.IOcrSpellCheckManager() 
public interface class IOcrSpellCheckManager 
Remarks

You can access the instance of the IOcrSpellCheckManager used by an IOcrEngine through the IOcrEngine.SpellCheckManager property.

LEADTOOLS OCR supports spell checking and correction through the use of external dictionaries. The value of IOcrSpellCheckManager.SpellCheckEngine acts as a global switch to use a particular spell checker or turn spell checking off.

If the value of this property is OcrSpellCheckEngine.None, then no spell checking is performed during the recognition process. When you set the value of this property to one of the supported engines, then the spell checking system is enabled and correction will be performed during the recognition process.

When you set the IOcrSpellCheckManager.SpellCheckEngine property to a value other than None, the OCR engine will automatically try to load the spell checker requested and queries the language dictionaries found on your machine. You can change SpellCheckEngine at any time during the life of the IOcrEngine depending on your application needs. For example, to disable spell checking while recognition certain types of documents only and then re-enable it for other types.

All the OCR engines allow you to turn spell checking off (set SpellCheckEngine to OcrSpellCheckEngine.None). The additional spell checker support is as follows:

Use IOcrSpellCheckManager.GetSupportedSpellCheckEngines to query at runtime the spell check engines supported by the current OCR engine.

The default LEADTOOLS installation will only ship with dictionaries for the following languages: English, German, French, Spanish and Italian. Additional language dictionaries are included in the LEADTOOLS Additional OCR Features setup available at http://www.leadtools.com.

Use IOcrSpellCheckManager.GetSupportedSpellLanguages to query at runtime the spell check languages (dictionaries) installed on the current machine and IOcrSpellCheckManager.GetAdditionalSpellLanguages to query at runtime the extra spell check languages (dictionaries) available to the engine but not installed (included in the Additional OCR Features Setup described above).

Example
Copy Code  
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.Forms.Ocr
Imports Leadtools.Forms
Imports Leadtools.WinForms
Imports Leadtools.ImageProcessing.Core
Imports Leadtools.Drawing

Public Sub OcrSpellCheckManagerExample()
   ' Create an instance of the engine
   Using ocrEngine As IOcrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, False)
      ' Start the engine using default parameters
      ocrEngine.Startup(Nothing, Nothing, Nothing, LEAD_VARS.OcrAdvantageRuntimeDir)
      Dim spellCheckManager As IOcrSpellCheckManager = ocrEngine.SpellCheckManager

      ' Get the spell language supported (languages with a dictionary)
      Dim spellLanguages() As String = spellCheckManager.GetSupportedSpellLanguages()
      For Each spellLanguage As String In spellLanguages
         Console.WriteLine(spellLanguage)
      Next

      ' Check if English is supported
      Dim language As String = "en"
      If (spellCheckManager.IsSpellLanguageSupported(language)) Then
         ' Yes, set it
         spellCheckManager.SpellLanguage = language
         Console.WriteLine("Current spell language: {0}", spellCheckManager.SpellLanguage)
      End If

      ' Enable the spell checking system
      spellCheckManager.SpellCheckEngine = OcrSpellCheckEngine.Native

      ' Now perform other OCR functions here

      ' Shutdown the engine
      ' Note: calling Dispose will also automatically shutdown the engine if it has been started
      ocrEngine.Shutdown()
   End Using
End Sub
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Forms;
using Leadtools.Forms.Ocr;
using Leadtools.Drawing;

public void OcrSpellCheckManagerExample()
{
   // Create an instance of the engine
   using(IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false))
   {
      // Start the engine using default parameters
      ocrEngine.Startup(null, null, null, LEAD_VARS.OcrAdvantageRuntimeDir);
      IOcrSpellCheckManager spellCheckManager = ocrEngine.SpellCheckManager;

      // Get the spell language supported (languages with a dictionary)
      string[] spellLanguages = spellCheckManager.GetSupportedSpellLanguages();
      foreach(string spellLanguage in spellLanguages)
         Console.WriteLine(spellLanguage);

      // Check if English is supported
      string language = "en";
      if(spellCheckManager.IsSpellLanguageSupported(language))
      {
         // Yes, set it
         spellCheckManager.SpellLanguage = language;
         Console.WriteLine("Current spell language: {0}", spellCheckManager.SpellLanguage);
      }

      // Enable the spell checking system
      spellCheckManager.SpellCheckEngine = OcrSpellCheckEngine.Native;

      // Now perform other OCR functions here

      // Shutdown the engine
      // Note: calling Dispose will also automatically shutdown the engine if it has been started
      ocrEngine.Shutdown();
   }
}
Requirements

Target Platforms

See Also

Reference

IOcrSpellCheckManager Members
Leadtools.Forms.Ocr Namespace
IOcrEngine Interface
IOcrEngine.Startup
IOcrEngine.IsStarted
IOcrEngine.Shutdown
OcrEngineManager Class
OcrEngineType Enumeration
OcrSpellCheckEngine Enumeration
Programming with the LEADTOOLS .NET OCR
Files to be Included with Your Application
OCR Spell Language Dictionaries
OCR Languages and Spell Checking

 

 


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

IOcrSpellCheckManager requires an OCR module license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features