src/ccstruct/pageres.cpp
WERD_RES *PAGE_RES_IT::InsertSimpleCloneWord(const WERD_RES &clone_res,
                                             WERD *new_word) {
  // Make a WERD_RES for the new_word.
  auto *new_res = new WERD_RES(new_word);
  new_res->CopySimpleFields(clone_res);
  new_res->combination = true;
  // Insert into the appropriate place in the ROW_RES.
  WERD_RES_IT wr_it(&row()->word_res_list);
  for (wr_it.mark_cycle_pt(); !wr_it.cycled_list(); wr_it.forward()) {
    WERD_RES *word = wr_it.data();
    if (word == word_res) {
      break;
    }
  }
  ASSERT_HOST(!wr_it.cycled_list());
  wr_it.add_before_then_move(new_res);
  if (wr_it.at_first()) {
    // This is the new first word, so reset the member iterator so it
    // detects the cycled_list state correctly.
    ResetWordIterator();
  }
  return new_res;
}
// Inserts the new_word as a combination owned by a corresponding WERD_RES
// before the current position. The simple fields of the WERD_RES are copied
// from clone_res and the resulting WERD_RES is returned for further setup
// with best_choice etc.
Inserts the new_word as a combination owned by a corresponding WERD_RES
before the current position. The simple fields of the WERD_RES are copied
from clone_res and the resulting WERD_RES is returned for further setup
with best_choice etc.
Inserts the new_word as a combination owned by a corresponding WERD_RES before the current position . The simple fields of the WERD_RES are copied from clone_res and the resulting WERD_RES is returned for further setup with best_choice etc .
WERD_RES *PAGE_RES_IT::InsertSimpleCloneWord(const WERD_RES &clone_res,
                                             WERD *new_word) {
  auto *new_res = new WERD_RES(new_word);
  new_res->CopySimpleFields(clone_res);
  new_res->combination = true;
  WERD_RES_IT wr_it(&row()->word_res_list);
  for (wr_it.mark_cycle_pt(); !wr_it.cycled_list(); wr_it.forward()) {
    WERD_RES *word = wr_it.data();
    if (word == word_res) {
      break;
    }
  }
  ASSERT_HOST(!wr_it.cycled_list());
  wr_it.add_before_then_move(new_res);
  if (wr_it.at_first()) {
    ResetWordIterator();
  }
  return new_res;
}
WERD_RES * PAGE_RES_IT :: InsertSimpleCloneWord ( const WERD_RES & clone_res , WERD * new_word ) { auto * new_res = new WERD_RES ( new_word ) ; new_res -> CopySimpleFields ( clone_res ) ; new_res -> combination = true ; WERD_RES_IT wr_it ( & row ( ) -> word_res_list ) ; for ( wr_it . mark_cycle_pt ( ) ; ! wr_it . cycled_list ( ) ; wr_it . forward ( ) ) { WERD_RES * word = wr_it . data ( ) ; if ( word == word_res ) { break ; } } ASSERT_HOST ( ! wr_it . cycled_list ( ) ) ; wr_it . add_before_then_move ( new_res ) ; if ( wr_it . at_first ( ) ) { ResetWordIterator ( ) ; } return new_res ; }
Inserts the new_word as a combination owned by a corresponding WERD_RES
before the current position.
Inserts the new_word as a combination owned by a corresponding WERD_RES before the current position .
// Make a WERD_RES for the new_word. // Insert into the appropriate place in the ROW_RES. // This is the new first word, so reset the member iterator so it // detects the cycled_list state correctly.