LEADTOOLS OCR (Leadtools.Forms.Ocr assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
OcrSpellCheckCallback Delegate
See Also 
Leadtools.Forms.Ocr Namespace : OcrSpellCheckCallback Delegate



engine
The OCR engine instance.
page
The page currently being recognized. To get the index of this page, use OcrDocument.Pages.IndexOf.
zoneIndex
The zero-based index of the zone in page currently being recognized. To get the zone info, use IOcrPage.Zones passing zoneIndex as the index value.
value
Word or line to be checked by the method.
Provides a callback for the global user-defined spell checking.

Syntax

Visual Basic (Declaration) 
Public Delegate Function OcrSpellCheckCallback( _
   ByVal engine As IOcrEngine, _
   ByVal page As IOcrPage, _
   ByVal zoneIndex As Integer, _
   ByVal value As String _
) As OcrSpellCheckOpinion
Visual Basic (Usage)Copy Code
Dim instance As New OcrSpellCheckCallback(AddressOf HandlerMethod)
C# 
public delegate OcrSpellCheckOpinion OcrSpellCheckCallback( 
   IOcrEngine engine,
   IOcrPage page,
   int zoneIndex,
   string value
)
C++/CLI 
public delegate OcrSpellCheckOpinion OcrSpellCheckCallback( 
   IOcrEngine^ engine,
   IOcrPage^ page,
   int zoneIndex,
   String^ value
)

Parameters

engine
The OCR engine instance.
page
The page currently being recognized. To get the index of this page, use OcrDocument.Pages.IndexOf.
zoneIndex
The zero-based index of the zone in page currently being recognized. To get the zone info, use IOcrPage.Zones passing zoneIndex as the index value.
value
Word or line to be checked by the method.

Return Value

One of the OcrSpellCheckOpinion members that expresses the opinion of the application about the recognized string's acceptability.

Example

This example attempts to recognize an image having a misspelled word and then uses the user-defined spell checking callback to give an opinion about the engine suggestions.

Remarks

You can set the OcrSpellCheckCallback to be used globally in the engine through the IOcrSpellCheckManager.SetSpellCheckCallback method.

The callback will only work with zones added manually by the user. The zones automatically found by the engine through IOcrPage.AutoZone will not cause the callback to be called.

This callback allows the user to intervene during the spell checking process. The callback is called by the checking subsystem of the engine during the recognition operation. The user can then influence the decision about the recognized result through the returned OcrSpellCheckOpinion value.

For an example, if the particular zone in the page to be recognized is allowed to contain digits and only certain values are allowed. The user can return the following values:

If the particular zone in the page to be recognized is allowed to have digits only by no further restrictions, the user can return the following values:

Note: User-defined checking through the OcrSpellCheckCallback callback is not supported when using the LEADTOOLS OCR Advantage Engine.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also

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