ngram Class Reference

#include <n_gram.h>

Collaboration diagram for ngram:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ngram (dictionary *d, int sz=0)
 ngram (ngram &ng)
int * wordp ()
int * wordp (int k)
const int * wordp () const
const int * wordp (int k) const
int containsWord (const char *s, int lev)
void trans (const ngram &ng)
void invert (const ngram &ng)
void shift ()
void shift (int sz)
bool operator== (const ngram &compare) const
bool operator!= (const ngram &compare) const
int ckhisto (int sz)
int pushc (int c)
int pushc (int *codes, int sz)
int pushw (const char *w)

Public Attributes

dictionarydict
char * link
char * succlink
int midx [MAX_NGRAM]
char * path [MAX_NGRAM]
float bowv [MAX_NGRAM]
int lev
int size
long long freq
int succ
float bow
float prob
unsigned char info
unsigned char pinfo
int isym

Friends

std::ifstream & operator>> (std::ifstream &fi, ngram &ng)
std::ofstream & operator<< (std::ofstream &fi, ngram &ng)
std::istream & operator>> (std::istream &fi, ngram &ng)
std::ostream & operator<< (std::ostream &fi, ngram &ng)


Detailed Description

Definition at line 44 of file n_gram.h.


Constructor & Destructor Documentation

ngram::ngram ( dictionary d,
int  sz = 0 
)

Definition at line 36 of file n_gram.cpp.

References dict, freq, info, isym, link, MAX_NGRAM, midx, NULL, path, pinfo, size, and succ.

ngram::ngram ( ngram ng  ) 

Definition at line 51 of file n_gram.cpp.

References dict, freq, info, isym, link, MAX_NGRAM, midx, NULL, pinfo, size, and succ.


Member Function Documentation

int ngram::ckhisto ( int  sz  )  [inline]

Definition at line 128 of file n_gram.h.

References dict, dictionary::oovcode(), and wordp().

Referenced by mshiftbeta::discount(), shiftbeta::discount(), shiftone::discount(), and linearwb::discount().

Here is the call graph for this function:

Here is the caller graph for this function:

int ngram::containsWord ( const char *  s,
int  lev 
) [inline]

Definition at line 83 of file n_gram.h.

References dict, dictionary::encode(), size, and wordp().

Referenced by interplm::gencorrcounts(), main(), mdiadaptlm::saveARPA_per_level(), mdiadaptlm::saveARPA_per_word(), mdiadaptlm::saveASR(), mdiadaptlm::saveBIN_per_level(), mdiadaptlm::saveBIN_per_word(), mshiftbeta::train(), and shiftbeta::train().

Here is the call graph for this function:

Here is the caller graph for this function:

void ngram::invert ( const ngram ng  ) 

Definition at line 85 of file n_gram.cpp.

References size, and wordp().

Referenced by lmtable::lprob(), and lmtable::maxsuffptr().

Here is the call graph for this function:

Here is the caller graph for this function:

bool ngram::operator!= ( const ngram compare  )  const [inline]

Definition at line 116 of file n_gram.h.

References dict, MAX_NGRAM, and size.

bool ngram::operator== ( const ngram compare  )  const [inline]

Definition at line 106 of file n_gram.h.

References dict, MAX_NGRAM, and size.

int ngram::pushc ( int *  codes,
int  sz 
)

Definition at line 178 of file n_gram.cpp.

References MAX_NGRAM, size, and src.

int ngram::pushc ( int  c  ) 

int ngram::pushw ( const char *  w  ) 

Definition at line 139 of file n_gram.cpp.

References dict, dictionary::encode(), NULL, and pushc().

Referenced by interplm::gencorrcounts(), ngramtable::generate(), init(), lmmacro::map(), lmmacro::Micro2MacroMapping(), lmmacro::One2OneMapping(), operator>>(), and parseline().

Here is the call graph for this function:

Here is the caller graph for this function:

void ngram::shift ( int  sz  ) 

Definition at line 99 of file n_gram.cpp.

References MAX_NGRAM, and size.

void ngram::shift (  ) 

Definition at line 93 of file n_gram.cpp.

References MAX_NGRAM, and size.

Referenced by mdiadaptlm::discount(), lmtable::lprobx(), mdiadaptlm::saveARPA_per_word(), and mdiadaptlm::saveBIN_per_word().

Here is the caller graph for this function:

void ngram::trans ( const ngram ng  ) 

const int* ngram::wordp ( int  k  )  const [inline]

Definition at line 78 of file n_gram.h.

References MAX_NGRAM, and size.

const int* ngram::wordp (  )  const [inline]

Definition at line 75 of file n_gram.h.

References size, and wordp().

Here is the call graph for this function:

int* ngram::wordp ( int  k  )  [inline]

Definition at line 72 of file n_gram.h.

References MAX_NGRAM, and size.

int* ngram::wordp (  )  [inline]


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  fi,
ngram ng 
) [friend]

std::ofstream& operator<< ( std::ofstream &  fi,
ngram ng 
) [friend]

std::istream& operator>> ( std::istream &  fi,
ngram ng 
) [friend]

std::ifstream& operator>> ( std::ifstream &  fi,
ngram ng 
) [friend]


Member Data Documentation

float ngram::bow

Definition at line 59 of file n_gram.h.

Referenced by lmtable::get(), lmtable::lprob(), and lmtable::lprobx().

float ngram::bowv[MAX_NGRAM]

Definition at line 53 of file n_gram.h.

long long ngram::freq

unsigned char ngram::info

Definition at line 64 of file n_gram.h.

Referenced by main(), ngram(), and trans().

char* ngram::link

int ngram::midx[MAX_NGRAM]

Definition at line 51 of file n_gram.h.

Referenced by ngram(), ngramtable::scan(), lmtable::succscan(), and trans().

char* ngram::path[MAX_NGRAM]

Definition at line 52 of file n_gram.h.

Referenced by lmtable::get(), lmtable::lprob(), lmtable::maxsuffptr(), and ngram().

unsigned char ngram::pinfo

float ngram::prob

Definition at line 60 of file n_gram.h.

Referenced by lmtable::get(), lmtable::lprob(), and lmtable::lprobx().

Definition at line 50 of file n_gram.h.

Referenced by lmtable::succscan().


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

Generated on Thu Jul 6 00:31:54 2017 for Moses by  doxygen 1.5.9