FreeLing  4.0
Classes | Public Member Functions | Static Public Attributes | Private Types | Private Attributes
freeling::trellis Class Reference

#include <hmm_tagger.h>

Collaboration diagram for freeling::trellis:
Collaboration graph
[legend]

List of all members.

Classes

class  element
 Each trellis node contains an ordered set of paths. More...

Public Member Functions

 trellis (int, unsigned int kb=1)
 Constructor.
 ~trellis ()
 Destructor.
void insert (int, const bigram &, const bigram &, int kb, double)
 add new element to the trellis
double delta (int, const bigram &, unsigned int k=0) const
 retieve delta component for kth best path (count starts at 0) for given T and state.
std::pair< bigram, intphi (int, const bigram &, unsigned int k=0) const
 retieve phi component for kth best path (count starts at 0) for given T and state
int nbest (int, const bigram &) const
 Get number of elements in kbest set for given time&state (at most kbest, maybe less)

Static Public Attributes

static const float ZERO_logprob = -numeric_limits<float>::infinity()
 log prob for zero
static const bigram initState = bigram(L"0",L"0")
static const bigram endState = bigram(L"ENDSTATE",L"ENDSTATE")

Private Types

typedef std::multiset< element,
std::greater< element > > 
path_elements
 Trellis: array of columns.

Private Attributes

std::vector< std::map< bigram,
path_elements > > 
trl
unsigned int kbest
 Number of kbest paths to store.

Member Typedef Documentation

typedef std::multiset<element,std::greater<element> > freeling::trellis::path_elements [private]

Trellis: array of columns.

Each column associates each state with a set of path elements sorted by descending probability


Constructor & Destructor Documentation

freeling::trellis::trellis ( int  T,
unsigned int  kb = 1 
)

Constructor.

Constructor: Create dynammic storage for delta and phi tables in the trellis.

Destructor.

Destructor: Free dynammic storage for delta and phi tables stored in the trellis.


Member Function Documentation

double freeling::trellis::delta ( int  t,
const bigram s,
unsigned int  k = 0 
) const

retieve delta component for kth best path (count starts at 0) for given T and state.

Get delta component for kth best path (count from 0)

References ERROR_CRASH.

void freeling::trellis::insert ( int  t,
const bigram s,
const bigram sa,
int  kb,
double  p 
)

add new element to the trellis

insert a new arc in the trellis.

Time t, state s, prev state sa, prob p

References int2wstring, and TRACE.

int freeling::trellis::nbest ( int  t,
const bigram s 
) const

Get number of elements in kbest set for given time&state (at most kbest, maybe less)

Get number of elements in kbest set for time t, state s.

pair< bigram, int > freeling::trellis::phi ( int  t,
const bigram s,
unsigned int  k = 0 
) const

retieve phi component for kth best path (count starts at 0) for given T and state

Get phi component for kth best path (count from 0)

References ERROR_CRASH.


Member Data Documentation

const bigram freeling::trellis::endState = bigram(L"ENDSTATE",L"ENDSTATE") [static]
const bigram freeling::trellis::initState = bigram(L"0",L"0") [static]
unsigned int freeling::trellis::kbest [private]

Number of kbest paths to store.

std::vector<std::map <bigram, path_elements > > freeling::trellis::trl [private]
const float freeling::trellis::ZERO_logprob = -numeric_limits<float>::infinity() [static]

The documentation for this class was generated from the following files: