Nicomsoft OCR: Developer's Guide


Blk_GetWordCnt


Syntax

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


Description

Retrieves the total number of words in the specified 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.


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; 0 – the first line.


Return value

If success, the total number of words in the specified text line; otherwise, an error code.


Remarks

The OCRSTEP_OCR step must be executed before calling this function.


Example

See the sample code for the Blk_GetCharCnt or Img_GetBlockCnt functions.