Leadtools.Document Deprecated as of v16. Refer to: Leadtools.Forms.Ocr | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
DefaultSpellLanguages Method
See Also  Example
Leadtools.Document Namespace > RasterDocumentEngine Class : DefaultSpellLanguages Method



Gets a list of default Spelling languages.

Syntax

Visual Basic (Declaration) 
Public Function DefaultSpellLanguages() As RasterDocumentLanguage()
Visual Basic (Usage)Copy Code
Dim instance As RasterDocumentEngine
Dim value() As RasterDocumentLanguage
 
value = instance.DefaultSpellLanguages()
C# 
public RasterDocumentLanguage[] DefaultSpellLanguages()
C++/CLI 
public:
array<RasterDocumentLanguage>^ DefaultSpellLanguages(); 

Example

Visual BasicCopy Code
Public Sub DefaultSpellLanguagesExample()
   ' Note that this is a sample key, which will not work in your toolkit
   RasterSupport.Unlock(Leadtools.RasterSupportType.Ocr, "TestKey")

   Dim rasterDocument As RasterDocumentEngine
   rasterDocument = RasterDocumentEngine.Instance
   rasterDocument.Startup()

   Dim langs As RasterDocumentLanguage() = rasterDocument.DefaultSpellLanguages()
   MessageBox.Show("Totat Default Spell Languages = " & langs.Length)

   If langs.Length > 0 Then
      If rasterDocument.RecognizeModuleTradeoff <> RasterDocumentTradeoff.Accurate Then
         rasterDocument.RecognizeModuleTradeoff = RasterDocumentTradeoff.Accurate
      End If

      rasterDocument.EnableSubsystem = True
      rasterDocument.EnableCorrection = True
      rasterDocument.SpellLanguageId = langs(0)
      rasterDocument.RecognitionDataFileName = LeadtoolsExamples.Common.ImagesPath.Path + "test.rdf"

      rasterDocument.Recognize(0, 1, Nothing)
   End If

   rasterDocument.Shutdown()
End Sub
C#Copy Code
public void DefaultSpellLanguagesExample() 

   /// Note that this is a sample key, which will not work in your toolkit 
   RasterSupport.Unlock(RasterSupportType.Ocr, "TestKey"); 
   RasterDocumentEngine rasterDocument; 
   rasterDocument = RasterDocumentEngine.Instance; 
   rasterDocument.Startup(); 
 
   RasterDocumentLanguage[] langs = rasterDocument.DefaultSpellLanguages(); 
   MessageBox.Show("Totat Default Spell Languages = " + langs.Length); 
 
   if (langs.Length > 0) 
   { 
      if (rasterDocument.RecognizeModuleTradeoff != RasterDocumentTradeoff.Accurate) 
          rasterDocument.RecognizeModuleTradeoff = RasterDocumentTradeoff.Accurate; 
 
      rasterDocument.EnableSubsystem = true; 
      rasterDocument.EnableCorrection = true; 
      rasterDocument.SpellLanguageId = langs[0]; 
      rasterDocument.RecognitionDataFileName = LeadtoolsExamples.Common.ImagesPath.Path + "test.rdf"; 
 
      rasterDocument.Recognize(0, 1, null); 
   } 
 
   rasterDocument.Shutdown(); 
}

Remarks

The content of the resulting array depends on the configuration of the OCR document engine, i.e. the presence of the Language dictionary files in the engine Binary directory.
For more information, refer to Working with Languages.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also

The Leadtools.Document namespace is deprecated and no longer supported as of LEADTOOLS v16. For v16 and later, please refer to: Leadtools.Forms.Ocr. This documentation is retained for v15 and earlier informational use only.