Click or drag to resize

DocumentOnCheck Event

This event is used to allow user-written checking of recognition results.

Namespace:  Kofax.OmniPageCSDK.IproPlus
Assembly:  Kofax.OmniPageCSDK.IproPlus (in Kofax.OmniPageCSDK.IproPlus.dll) Version: 1.0.0.0
Syntax
public event DocumentCheckHandler OnCheck

Value

Type: Kofax.OmniPageCSDK.IproPlusDocumentCheckHandler
Remarks

It gives the application power to influence recognition results at zone level.

The Check event can be fired by some recognition modules (MOR, HNR, MAT) through the checking subsystem during the recognition of a particular zone from the Recognize method of Document or Page object. This event is fired if Check property of the Document object is True and the DisableUserCheck property of the particular UserZone object is False.

The Page parameter indicates which page is being processed. The Zone parameter is a zone index into the OCRZones collection. The Word parameter contains a word to check in the given OCR zone. If the CheckFullLines property of the related user zone is True, the Word parameter contains a full line of text. The checking subsystem can be influenced by the return value of the Opinion parameter. It is the function's task to check the Word recognized string and to decide whether it is acceptable for the zone specified by the Page and Zone parameters. The returned Opinion value should express an opinion about the recognized string's acceptability with one of the CHECKWORDRETURNCODE values - listed under the CHECKWORDRETURNCODE Enumeration topic.

The Check event is fired only if one of the following conditions are true:

  • The SpellLanguage property of the Document object is LANG_NO or LANG_UD. In this case the Check event, the set user dictionary plus vertical dictionary, are invoked one after the other. The first one to return a positive guess will interrupt further processing.
  • The SpellLanguage property of the Document object is LANG_AUTO. This case is very similar to the one above with the exception that here - according to the recognition language settings - language dictionaries may also be involved at the end of processing.

Some examples are given below to illustrate which CHECKWORDRETURNCODE value ought to be returned by the integrating application:

  • If the zone being recognized and checked is allowed to contain digits and only certain values are allowed by some strict application specific pattern, and the application can confirm that the recognized text matches the pattern, the function should return with CW_SURE.
  • If the text from the same zone fails to match the pattern, the function should return with CW_IMPOSSIBLE.
  • If the zone has the requirement "digits only" but no further strict requirements (e.g. some pattern), then if the application determines that the recognized text contains digits only, it should return CW_POSSIBLE.
  • If the zone has the requirement "digits only" and no further strict requirements, then if the application determines that the recognized text contains digits plus some punctuation (e.g. a comma or period), it should return CW_UNLIKELY.

The Document parameter is an object reference to the Document object, which fired this event. EventID is an auto incremented id of an instance of the event. This is useful, if events are trapped in different locations and it has to be determined whether they are the same events.

Note that the Engine might fire this event passing the *RegistrationCheck* in the Word parameter for internal purposes. You can return any valid opinion values in the Opinion parameter when handling this case.

See Also