#include <interplm.h>


Public Member Functions | |
| interplm (char *ngtfile, int depth=0, TABLETYPE tt=FULL) | |
| int | prunesingletons (int flag=-1) |
| int | prunetopsingletons (int flag=-1) |
| void | gencorrcounts () |
| void | gensuccstat () |
| virtual int | dub () |
| virtual int | dub (int value) |
| int | setusmooth (int v=0) |
| double | setepsilon (double v=1.0) |
| void | trainunigr () |
| double | unigr (ngram ng) |
| double | zerofreq (int lev) |
| int | lmsize () |
| int | obswrd () |
| virtual int | train () |
| virtual void | adapt (char *ngtfile, double w) |
| virtual double | prob (ngram ng, int size) |
| virtual double | boprob (ngram ng, int size) |
| void | test_ngt (ngramtable &ngt, int sz=0, int backoff=0, int checkpr=0) |
| void | test_txt (char *filename, int sz=0, int backoff=0, int checkpr=0, char *outpr=NULL) |
| void | test (char *filename, int sz, int backoff=0, int checkpr=0, char *outpr=NULL) |
| virtual int | discount (ngram ng, int size, double &fstar, double &lambda, int cv=0) |
| virtual int | savebin (char *filename, int lmsize=2) |
| virtual int | netsize () |
| void | lmstat (int level) |
| virtual | ~interplm () |
Public Attributes | |
| int | backoff |
| ngramtable * | unitbl |
Definition at line 33 of file interplm.h.
| interplm::interplm | ( | char * | ngtfile, | |
| int | depth = 0, |
|||
| TABLETYPE | tt = FULL | |||
| ) |
Definition at line 79 of file interplm.cpp.
References dictionary::BoS(), dictionary::decode(), ngramtable::dict, dictionary::encode(), dictionary::freq(), ngramtable::maxlevel(), NULL, dictionary::oovcode(), and unitbl.

| virtual interplm::~interplm | ( | ) | [inline, virtual] |
Definition at line 105 of file interplm.h.
| virtual void interplm::adapt | ( | char * | ngtfile, | |
| double | w | |||
| ) | [inline, virtual] |
Definition at line 85 of file interplm.h.
| virtual double interplm::boprob | ( | ngram | ng, | |
| int | size | |||
| ) | [inline, virtual] |
Definition at line 89 of file interplm.h.
| virtual int interplm::discount | ( | ngram | ng, | |
| int | size, | |||
| double & | fstar, | |||
| double & | lambda, | |||
| int | cv = 0 | |||
| ) | [inline, virtual] |
Reimplemented in linearwb, mdiadaptlm, mixture, shiftone, shiftbeta, symshiftbeta, and mshiftbeta.
Definition at line 97 of file interplm.h.
Referenced by mixture::discount(), mdiadaptlm::foreunig(), and mixture::train().

| virtual int interplm::dub | ( | int | value | ) | [inline, virtual] |
Reimplemented in mixture.
Definition at line 65 of file interplm.h.
References ngramtable::dict, and dictionary::dub().

| virtual int interplm::dub | ( | ) | [inline, virtual] |
Reimplemented in mixture.
Definition at line 63 of file interplm.h.
References ngramtable::dict, and dictionary::dub().
Referenced by mixture::dub(), main(), and mixture::train().


| void interplm::gencorrcounts | ( | ) |
Definition at line 146 of file interplm.cpp.
References dictionary::BoS(), ngramtable::btotfreq(), CONT, ngram::containsWord(), ngramtable::corrcounts, ngramtable::dict, dictionary::encode(), ngramtable::freq(), ngram::freq, ngramtable::getfreq(), INIT, ngram::link, ngramtable::maxlevel(), dictionary::oovcode(), ngram::pinfo, ngram::pushw(), ngramtable::put(), ngramtable::scan(), ngramtable::setfreq(), dictionary::size(), ngram::size, and ngram::wordp().
Referenced by mshiftbeta::train().


| void interplm::gensuccstat | ( | ) |
Definition at line 108 of file interplm.cpp.
References CONT, ngramtable::corrcounts, ngramtable::dict, ngram::freq, ngramtable::getfreq(), INIT, ngram::link, ngram::pinfo, ngram::pushc(), ngramtable::scan(), ngramtable::succ1(), ngramtable::succ2(), and ngramtable::succscan().
Referenced by mshiftbeta::train(), and linearwb::train().


| int interplm::lmsize | ( | ) | [inline] |
Definition at line 79 of file interplm.h.
Referenced by mdiadaptlm::adapt(), mdiadaptlm::compute_backoff(), mshiftbeta::discount(), mixture::loadpar(), mshiftbeta::mfreq(), mdiadaptlm::saveARPA(), mdiadaptlm::saveASR(), mdiadaptlm::saveMT(), mixture::savepar(), shiftbeta::shiftbeta(), test(), mshiftbeta::train(), shiftbeta::train(), and mixture::train().

| void interplm::lmstat | ( | int | level | ) | [inline] |
Definition at line 103 of file interplm.h.
References ngramtable::stat().
Referenced by main().


| virtual int interplm::netsize | ( | ) | [inline, virtual] |
| int interplm::obswrd | ( | ) | [inline] |
Definition at line 81 of file interplm.h.
References ngramtable::dict, and dictionary::size().
Referenced by test_ngt(), and test_txt().


| virtual double interplm::prob | ( | ngram | ng, | |
| int | size | |||
| ) | [inline, virtual] |
Reimplemented in mdiadaptlm.
Definition at line 87 of file interplm.h.
Referenced by test_ngt(), and test_txt().

| int interplm::prunesingletons | ( | int | flag = -1 |
) | [inline] |
Definition at line 51 of file interplm.h.
Referenced by mshiftbeta::discount(), shiftbeta::discount(), linearwb::discount(), and main().

| int interplm::prunetopsingletons | ( | int | flag = -1 |
) | [inline] |
Definition at line 55 of file interplm.h.
Referenced by mshiftbeta::discount(), and main().

| virtual int interplm::savebin | ( | char * | filename, | |
| int | lmsize = 2 | |||
| ) | [inline, virtual] |
| double interplm::setepsilon | ( | double | v = 1.0 |
) | [inline] |
Definition at line 69 of file interplm.h.
| int interplm::setusmooth | ( | int | v = 0 |
) | [inline] |
Definition at line 67 of file interplm.h.
| void interplm::test | ( | char * | filename, | |
| int | sz, | |||
| int | backoff = 0, |
|||
| int | checkpr = 0, |
|||
| char * | outpr = NULL | |||
| ) |
Definition at line 336 of file interplm.cpp.
References mfstream::close(), COUNT, lmsize(), NULL, test_ngt(), and test_txt().
Referenced by main().


| void interplm::test_ngt | ( | ngramtable & | ngt, | |
| int | sz = 0, |
|||
| int | backoff = 0, |
|||
| int | checkpr = 0 | |||
| ) |
Definition at line 434 of file interplm.cpp.
References dictionary::BoS(), CONT, ngramtable::dict, dictionary::dub(), dictionary::encode(), ngram::freq, INIT, ngramtable::maxlevel(), obswrd(), dictionary::oovcode(), prob(), ngramtable::scan(), dictionary::size(), ngram::size, ngram::trans(), and ngram::wordp().
Referenced by test().


| void interplm::test_txt | ( | char * | filename, | |
| int | sz = 0, |
|||
| int | backoff = 0, |
|||
| int | checkpr = 0, |
|||
| char * | outpr = NULL | |||
| ) |
Definition at line 361 of file interplm.cpp.
References dictionary::BoS(), mfstream::close(), ngramtable::dict, dictionary::dub(), dictionary::encode(), obswrd(), dictionary::oovcode(), prob(), dictionary::size(), ngram::size, and ngram::wordp().
Referenced by test().


| virtual int interplm::train | ( | ) | [inline, virtual] |
Reimplemented in linearwb, mixture, shiftone, shiftbeta, and mshiftbeta.
Definition at line 83 of file interplm.h.
Referenced by main(), mdiadaptlm::scalefact(), and mixture::train().

| void interplm::trainunigr | ( | ) |
Definition at line 35 of file interplm.cpp.
References ngramtable::dict, dictionary::dub(), dictionary::encode(), dictionary::freq(), dictionary::getcode(), dictionary::incfreq(), dictionary::OOV(), dictionary::oovcode(), dictionary::size(), and dictionary::totfreq().
Referenced by mshiftbeta::train(), shiftbeta::train(), shiftone::train(), and linearwb::train().


| double interplm::unigr | ( | ngram | ng | ) |
Definition at line 70 of file interplm.cpp.
References ngramtable::dict, dictionary::freq(), dictionary::size(), dictionary::totfreq(), and ngram::wordp().
Referenced by symshiftbeta::discount(), shiftbeta::discount(), shiftone::discount(), and linearwb::discount().


| double interplm::zerofreq | ( | int | lev | ) |
Definition at line 320 of file interplm.cpp.
References CONT, ngramtable::dict, ngram::freq, INIT, dictionary::oovcode(), ngramtable::scan(), and ngram::wordp().
Referenced by mixture::train().


Definition at line 47 of file interplm.h.
Referenced by mdiadaptlm::bodiscount(), mdiadaptlm::compute_backoff(), mdiadaptlm::prob(), and mixture::train().
1.5.9