Skip to content

Commit 2924d3a

Browse files
committed
Changes missed from diacritic fix edit
1 parent 84920b9 commit 2924d3a

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

ccstruct/pageres.cpp

+16-9
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ void WERD_RES::SetupFake(const UNICHARSET& unicharset_in) {
364364
LogNewCookedChoice(1, false, word);
365365
}
366366
tess_failed = true;
367+
done = true;
367368
}
368369

369370
void WERD_RES::SetupWordScript(const UNICHARSET& uch) {
@@ -1314,6 +1315,10 @@ static void ComputeBlobEnds(const WERD_RES& word, C_BLOB_LIST* next_word_blobs,
13141315
// replaced with real blobs from the current word as much as possible.
13151316
void PAGE_RES_IT::ReplaceCurrentWord(
13161317
tesseract::PointerVector<WERD_RES>* words) {
1318+
if (words->empty()) {
1319+
DeleteCurrentWord();
1320+
return;
1321+
}
13171322
WERD_RES* input_word = word();
13181323
// Set the BOL/EOL flags on the words from the input word.
13191324
if (input_word->word->flag(W_BOL)) {
@@ -1528,22 +1533,24 @@ void PAGE_RES_IT::ResetWordIterator() {
15281533
// Reset the member iterator so it can move forward and detect the
15291534
// cycled_list state correctly.
15301535
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+
}
15371543
}
15381544
ASSERT_HOST(!word_res_it.cycled_list());
15391545
word_res_it.forward();
15401546
} else {
15411547
// word_res_it is OK, but reset word_res and prev_word_res if needed.
15421548
WERD_RES_IT wr_it(&row_res->word_res_list);
15431549
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+
}
15471554
}
15481555
}
15491556
}

0 commit comments

Comments
 (0)