~vcs-imports/tesseract-ocr/trunk

« back to all changes in this revision

Viewing changes to dict/stopper.cpp

  • Committer: theraysmith at gmail
  • Date: 2013-10-10 02:07:26 UTC
  • Revision ID: svn-v4:d0cd1f9f-072b-0410-8dd7-cf729c803f20:trunk:890
Fixed fmemopen portability problem

Show diffs side-by-side

added added

removed removed

Lines of Context:
421
421
      choice->set_rating(new_rating);
422
422
    if (new_certainty < choice->certainty())
423
423
      choice->set_certainty(new_certainty);
424
 
    new_choices->sort(&BLOB_CHOICE::SortByRating);
 
424
    // DO NOT SORT!! It will mess up the iterator in LanguageModel::UpdateState.
425
425
  } else {
426
426
    // Need a new choice with the correct_ngram_id.
427
427
    choice = new BLOB_CHOICE(*old_choice);
430
430
    choice->set_certainty(new_certainty);
431
431
    choice->set_classifier(BCC_AMBIG);
432
432
    choice->set_matrix_cell(coord.col, coord.row);
433
 
    new_choices->add_sorted(&BLOB_CHOICE::SortByRating, false, choice);
 
433
    BLOB_CHOICE_IT it (new_choices);
 
434
    it.add_to_end(choice);
434
435
  }
435
436
  // Remove current unichar from werd_choice. On the last iteration
436
437
  // set the correct replacement unichar instead of removing a unichar.
502
503
    (word_length * (word_length - 1)));
503
504
  if (Variance < 0.0)
504
505
    Variance = 0.0;
505
 
  StdDev = sqrt (Variance);
 
506
  StdDev = sqrt(Variance);
506
507
 
507
508
  CertaintyThreshold = Mean - stopper_allowable_character_badness * StdDev;
508
509
  if (CertaintyThreshold > stopper_nondict_certainty_base)