Nicomsoft OCR: Developer's Guide


Blk_GetWordQual


Syntax

C++:int Blk_GetWordQual(HBLK BlkObj, int LineIndex, int WordIndex)
C#:int Blk_GetWordQual(int BlkObj, int LineIndex, int WordIndex)
Visual Basic:Function Blk_GetWordQual(ByVal BlkObj As Integer, ByVal LineIndex As Integer, ByVal WordIndex As Integer) As Integer
Java:int Blk_GetWordQual(HBLK BlkObj, int LineIndex, int WordIndex)
Delphi:function Blk_GetWordQual(BlkObj:HBLK; LineIndex:integer; WordIndex:integer):integer;


Description

Retrieves the recognition quality for the specified word in the block after performing OCR with the Img_OCR function. Use the Blk_GetLineCnt function to get the total number of text lines in the block. Use the Blk_GetWordCnt function to get the total number of words in the specified line.


Parameters

BlkObj [IN] – the Block object. You can also specify the Image object if you want to work with the global list of text lines for the entire image.
LineIndex [IN] – the index of the text line to retrieve; 0 – the first line.
WordIndex [IN] – the index of the word in the specified text line to retrieve; 0 – the first word.


Return value

If success, the word quality as a percentage (0 ... 100); otherwise, an error code.


Remarks

1. The OCRSTEP_OCR step must be executed before calling this function.
2. If the return value is 0, it means that the word quality is undefined, for example, if word contains dot(s) or comma(s) only.


Example

See the sample code for the Img_GetBlockCnt function.