Next: Delimiting characters
Up: charFinder
Previous: charFinder
  Contents
  Index
Getting block information
The charFinder module functions are specialized in certain block types,
and thus get extra information from the blockFinder module. They must
be so, otherwise they won't be able to read properly the block structure,
which must be cast to the appropriate type. Your module function is
likely to be something like this:
-
- gocrBlockType your_block_type;
int charFinderFunction ( gocrBlock *b, void *v ) {
-
- switch ( b->type ) {
-
- case TEXT:
-
- gocrTextBlock *tb = (gocrTextBlock *)b;
/* your code */
return 0;
case YOUR_BLOCK_TYPE:
-
- your_block_struct *mb = (your_block_struct *)b;
/* your code */
return 0;
case PICTURE:
default:
-
- return -1;
}
}
This hypothetical function can deal with text blocks and a special
block type that was previously registered, but not pictures or anything
else; if you can't process a block, return -1; if you could, return
0. Currently, once a function process a block, GOCR supposes that
it could do all the job there was to be done, and no other function
is called (this is to avoid processing the same block twice and ending
with duplicated information). Future versions may allow partial processing.
Next: Delimiting characters
Up: charFinder
Previous: charFinder
  Contents
  Index
root
2002-02-17