Tesseract  3.02
tesseract::ViterbiStateEntry Struct Reference

#include <language_model.h>

Inheritance diagram for tesseract::ViterbiStateEntry:
ELIST_LINK

List of all members.

Public Member Functions

 ViterbiStateEntry (BLOB_CHOICE *pb, ViterbiStateEntry *pe, BLOB_CHOICE *b, float c, float ol, const LanguageModelConsistencyInfo &ci, const AssociateStats &as, LanguageModelFlagsType tcf, LanguageModelDawgInfo *d, LanguageModelNgramInfo *n)
 ~ViterbiStateEntry ()
bool Consistent () const

Static Public Member Functions

static int Compare (const void *e1, const void *e2)

Public Attributes

float cost
BLOB_CHOICEparent_b
ViterbiStateEntryparent_vse
float ratings_sum
float min_certainty
int adapted
int length
float outline_length
LanguageModelConsistencyInfo consistency_info
AssociateStats associate_stats
LanguageModelFlagsType top_choice_flags
LanguageModelDawgInfodawg_info
LanguageModelNgramInfongram_info
bool updated

Detailed Description

Definition at line 138 of file language_model.h.


Constructor & Destructor Documentation

tesseract::ViterbiStateEntry::ViterbiStateEntry ( BLOB_CHOICE pb,
ViterbiStateEntry pe,
BLOB_CHOICE b,
float  c,
float  ol,
const LanguageModelConsistencyInfo ci,
const AssociateStats as,
LanguageModelFlagsType  tcf,
LanguageModelDawgInfo d,
LanguageModelNgramInfo n 
) [inline]

Definition at line 139 of file language_model.h.

    : cost(c), parent_b(pb), parent_vse(pe), ratings_sum(b->rating()),
      min_certainty(b->certainty()), adapted(b->adapted()), length(1),
      outline_length(ol), consistency_info(ci), associate_stats(as),
      top_choice_flags(tcf), dawg_info(d), ngram_info(n), updated(true) {
    if (pe != NULL) {
      ratings_sum += pe->ratings_sum;
      if (pe->min_certainty < min_certainty) {
        min_certainty = pe->min_certainty;
      }
      adapted += pe->adapted;
      length += pe->length;
      outline_length += pe->outline_length;
    }
  }
tesseract::ViterbiStateEntry::~ViterbiStateEntry ( ) [inline]

Definition at line 159 of file language_model.h.

                       {
    delete dawg_info;
    delete ngram_info;
  }

Member Function Documentation

static int tesseract::ViterbiStateEntry::Compare ( const void *  e1,
const void *  e2 
) [inline, static]

Definition at line 165 of file language_model.h.

                                                     {
    const ViterbiStateEntry *ve1 =
      *reinterpret_cast<const ViterbiStateEntry * const *>(e1);
    const ViterbiStateEntry *ve2 =
      *reinterpret_cast<const ViterbiStateEntry * const *>(e2);
    return (ve1->cost < ve2->cost) ? -1 : 1;
  }
bool tesseract::ViterbiStateEntry::Consistent ( ) const [inline]

Definition at line 172 of file language_model.h.

                                 {
    if (dawg_info != NULL && consistency_info.NumInconsistentCase() == 0) {
      return true;
    }
    return consistency_info.Consistent();
  }

Member Data Documentation

Definition at line 181 of file language_model.h.


The documentation for this struct was generated from the following file: