src/wordrec/segsearch.cpp
void Wordrec::ResetNGramSearch(WERD_RES *word_res, BestChoiceBundle *best_choice_bundle,
                               std::vector<SegSearchPending> &pending) {
  // TODO(rays) More refactoring required here.
  // Delete existing viterbi states.
  for (auto &col : best_choice_bundle->beam) {
    col->Clear();
  }
  // Reset best_choice_bundle.
  word_res->ClearWordChoices();
  best_choice_bundle->best_vse = nullptr;
  // Clear out all existing pendings and add a new one for the first column.
  pending[0].SetColumnClassified();
  for (auto &data : pending) {
    data.Clear();
  }
}
// Resets enough of the results so that the Viterbi search is re-run.
// Needed when the n-gram model is enabled, as the multi-length comparison
// implementation will re-value existing paths to worse values.
Resets enough of the results so that the Viterbi search is re-run.
Needed when the n-gram model is enabled, as the multi-length comparison
implementation will re-value existing paths to worse values.
Resets enough of the results so that the Viterbi search is re - run . Needed when the n - gram model is enabled as the multi - length comparison implementation will re - value existing paths to worse values .
void Wordrec::ResetNGramSearch(WERD_RES *word_res, BestChoiceBundle *best_choice_bundle,
                               std::vector<SegSearchPending> &pending) {
  for (auto &col : best_choice_bundle->beam) {
    col->Clear();
  }
  word_res->ClearWordChoices();
  best_choice_bundle->best_vse = nullptr;
  pending[0].SetColumnClassified();
  for (auto &data : pending) {
    data.Clear();
  }
}
void Wordrec :: ResetNGramSearch ( WERD_RES * word_res , BestChoiceBundle * best_choice_bundle , std :: vector < SegSearchPending > & pending ) { for ( auto & col : best_choice_bundle -> beam ) { col -> Clear ( ) ; } word_res -> ClearWordChoices ( ) ; best_choice_bundle -> best_vse = nullptr ; pending [ 0 ] . SetColumnClassified ( ) ; for ( auto & data : pending ) { data . Clear ( ) ; } }
Resets enough of the results so that the Viterbi search is re-run.
Resets enough of the results so that the Viterbi search is re - run .
// TODO(rays) More refactoring required here. // Delete existing viterbi states. // Reset best_choice_bundle. // Clear out all existing pendings and add a new one for the first column.