Пример #1
0
void call_train_tester(                     //call a tester
                       TBLOB *tessblob,     //blob to test
                       BOOL8 correct_blob,  //true if good
                       char *text,          //source text
                       inT32 count,         //chars in text
                       LIST result          //output of matcher
                      ) {
  PBLOB *blob;                   //converted blob
  BLOB_CHOICE_LIST ratings;      //matcher result

  blob = make_ed_blob (tessblob);//convert blob
  if (blob == NULL)
    return;
                                 //make it right type
  convert_choice_list(result, ratings);
  if (tess_trainer != NULL)
    (*tess_trainer) (blob, tess_denorm, correct_blob, text, count, &ratings);
  delete blob;                   //don't need that now
}
Пример #2
0
void tess_default_matcher(                           //call tess
                          PBLOB *pblob,              //previous blob
                          PBLOB *blob,               //blob to match
                          PBLOB *nblob,              //next blob
                          WERD *word,                //word it came from
                          DENORM *denorm,            //de-normaliser
                          BLOB_CHOICE_LIST &ratings  //list of results
                         ) {
  LIST result;                   //tess output
  TBLOB *tessblob;               //converted blob
  TEXTROW tessrow;               //dummy row

  tess_bn_matching = FALSE;      //turn it off
  tess_cn_matching = FALSE;
                                 //convert blob
  tessblob = make_tess_blob (blob, TRUE);
                                 //make dummy row
  make_tess_row(denorm, &tessrow);
                                 //classify
  result = AdaptiveClassifier (tessblob, NULL, &tessrow);
  free_blob(tessblob);
                                 //make our format
  convert_choice_list(result, ratings);
}