本文整理汇总了C++中WERD::blob_list方法的典型用法代码示例。如果您正苦于以下问题:C++ WERD::blob_list方法的具体用法?C++ WERD::blob_list怎么用?C++ WERD::blob_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WERD
的用法示例。
在下文中一共展示了WERD::blob_list方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply_box_testing
void apply_box_testing(BLOCK_LIST *block_list) {
BLOCK_IT block_it(block_list);
ROW_IT row_it;
ROW *row;
INT16 row_count = 0;
WERD_IT word_it;
WERD *word;
WERD *bln_word;
INT16 word_count = 0;
PBLOB_IT blob_it;
DENORM denorm;
INT16 count = 0;
char ch[2];
WERD *outword; //bln best choice
//segmentation
WERD_CHOICE *best_choice; //tess output
WERD_CHOICE *raw_choice; //top choice permuter
//detailed results
BLOB_CHOICE_LIST_CLIST blob_choices;
INT16 char_count = 0;
INT16 correct_count = 0;
INT16 err_count = 0;
INT16 rej_count = 0;
#ifndef SECURE_NAMES
WERDSTATS wordstats; //As from newdiff
#endif
char tess_rej_str[3];
char tess_long_str[3];
ch[1] = '\0';
strcpy (tess_rej_str, "|A");
strcpy (tess_long_str, "|B");
for (block_it.mark_cycle_pt ();
!block_it.cycled_list (); block_it.forward ()) {
row_it.set_to_list (block_it.data ()->row_list ());
for (row_it.mark_cycle_pt (); !row_it.cycled_list (); row_it.forward ()) {
row = row_it.data ();
row_count++;
word_count = 0;
word_it.set_to_list (row->word_list ());
for (word_it.mark_cycle_pt ();
!word_it.cycled_list (); word_it.forward ()) {
word = word_it.data ();
word_count++;
if ((strlen (word->text ()) == 1) &&
!STRING (applybox_test_exclusions).contains (*word->text ())
&& (word->gblob_list ()->length () == 1)) {
/* Here is a word with a single char label and a single blob so test it */
bln_word =
make_bln_copy (word, row, row->x_height (), &denorm);
blob_it.set_to_list (bln_word->blob_list ());
ch[0] = *word->text ();
char_count++;
best_choice = tess_segment_pass1 (bln_word,
&denorm,
tess_default_matcher,
raw_choice,
&blob_choices, outword);
/*
Test for TESS screw up on word. Recog_word has already ensured that the
choice list, outword blob lists and best_choice string are the same
length. A TESS screw up is indicated by a blank filled or 0 length string.
*/
if ((best_choice->string ().length () == 0) ||
(strspn (best_choice->string ().string (), " ") ==
best_choice->string ().length ())) {
rej_count++;
tprintf ("%d:%d: \"%s\" -> TESS FAILED\n",
row_count, word_count, ch);
#ifndef SECURE_NAMES
wordstats.word (tess_rej_str, 2, ch, 1);
#endif
}
else {
if ((best_choice->string ().length () !=
outword->blob_list ()->length ()) ||
(best_choice->string ().length () !=
blob_choices.length ())) {
tprintf
("ASSERT FAIL String:\"%s\"; Strlen=%d; #Blobs=%d; #Choices=%d\n",
best_choice->string ().string (),
best_choice->string ().length (),
outword->blob_list ()->length (),
blob_choices.length ());
}
ASSERT_HOST (best_choice->string ().length () ==
outword->blob_list ()->length ());
ASSERT_HOST (best_choice->string ().length () ==
blob_choices.length ());
fix_quotes ((char *) best_choice->string ().string (),
//turn to double
outword, &blob_choices);
if (strcmp (best_choice->string ().string (), ch) != 0) {
err_count++;
tprintf ("%d:%d: \"%s\" -> \"%s\"\n",
row_count, word_count, ch,
best_choice->string ().string ());
}
//.........这里部分代码省略.........