@@ -364,6 +364,7 @@ void WERD_RES::SetupFake(const UNICHARSET& unicharset_in) {
364
364
LogNewCookedChoice (1 , false , word);
365
365
}
366
366
tess_failed = true ;
367
+ done = true ;
367
368
}
368
369
369
370
void WERD_RES::SetupWordScript (const UNICHARSET& uch) {
@@ -1314,6 +1315,10 @@ static void ComputeBlobEnds(const WERD_RES& word, C_BLOB_LIST* next_word_blobs,
1314
1315
// replaced with real blobs from the current word as much as possible.
1315
1316
void PAGE_RES_IT::ReplaceCurrentWord (
1316
1317
tesseract::PointerVector<WERD_RES>* words) {
1318
+ if (words->empty ()) {
1319
+ DeleteCurrentWord ();
1320
+ return ;
1321
+ }
1317
1322
WERD_RES* input_word = word ();
1318
1323
// Set the BOL/EOL flags on the words from the input word.
1319
1324
if (input_word->word ->flag (W_BOL)) {
@@ -1528,22 +1533,24 @@ void PAGE_RES_IT::ResetWordIterator() {
1528
1533
// Reset the member iterator so it can move forward and detect the
1529
1534
// cycled_list state correctly.
1530
1535
word_res_it.move_to_first ();
1531
- word_res_it.mark_cycle_pt ();
1532
- while (!word_res_it.cycled_list () && word_res_it.data () != next_word_res) {
1533
- if (prev_row_res == row_res)
1534
- prev_word_res = word_res;
1535
- word_res = word_res_it.data ();
1536
- word_res_it.forward ();
1536
+ for (word_res_it.mark_cycle_pt ();
1537
+ !word_res_it.cycled_list () && word_res_it.data () != next_word_res;
1538
+ word_res_it.forward ()) {
1539
+ if (!word_res_it.data ()->part_of_combo ) {
1540
+ if (prev_row_res == row_res) prev_word_res = word_res;
1541
+ word_res = word_res_it.data ();
1542
+ }
1537
1543
}
1538
1544
ASSERT_HOST (!word_res_it.cycled_list ());
1539
1545
word_res_it.forward ();
1540
1546
} else {
1541
1547
// word_res_it is OK, but reset word_res and prev_word_res if needed.
1542
1548
WERD_RES_IT wr_it (&row_res->word_res_list );
1543
1549
for (wr_it.mark_cycle_pt (); !wr_it.cycled_list (); wr_it.forward ()) {
1544
- if (prev_row_res == row_res)
1545
- prev_word_res = word_res;
1546
- word_res = wr_it.data ();
1550
+ if (!wr_it.data ()->part_of_combo ) {
1551
+ if (prev_row_res == row_res) prev_word_res = word_res;
1552
+ word_res = wr_it.data ();
1553
+ }
1547
1554
}
1548
1555
}
1549
1556
}
0 commit comments