#include <mdiadapt.h>


Public Member Functions | |
| mdiadaptlm (char *ngtfile, int depth=0, TABLETYPE tt=FULL) | |
| double | zeta (ngram ng, int size) |
| int | discount (ngram ng, int size, double &fstar, double &lambda, int cv=0) |
| int | bodiscount (ngram ng, int size, double &fstar, double &lambda, double &bo) |
| int | compute_backoff () |
| double | backunig (ngram ng) |
| double | foreunig (ngram ng) |
| int | adapt (char *ngtfile, int alev=1, double gis_step=0.4) |
| int | scalefact (char *ngtfile) |
| double | scalefact (ngram ng) |
| double | prob (ngram ng, int size) |
| double | prob (ngram ng, int size, double &fstar, double &lambda, double &bo) |
| double | prob2 (ngram ng, int size, double &fstar) |
| double | txclprob (ngram ng, int size) |
| int | saveASR (char *filename, int backoff, char *subdictfile=NULL) |
| int | saveMT (char *filename, int backoff, char *subdictfile=NULL, int resolution=10000000, double decay=0.999900) |
| int | saveARPA (char *filename, int backoff=0, char *subdictfile=NULL) |
| int | netsize () |
| ~mdiadaptlm () | |
| double | myround (double x) |
Public Attributes | |
| normcache * | cache |
| double | gis_step |
| mdiadaptlm::mdiadaptlm | ( | char * | ngtfile, | |
| int | depth = 0, |
|||
| TABLETYPE | tt = FULL | |||
| ) |
| mdiadaptlm::~mdiadaptlm | ( | ) | [inline] |
References cache.
| int mdiadaptlm::adapt | ( | char * | ngtfile, | |
| int | alev = 1, |
|||
| double | gis_step = 0.4 | |||
| ) |
References backunig(), ngramtable::dict, gis_step, interplm::lmsize(), NULL, scalefact(), dictionary::size(), ngram::wordp(), and zeta().
Referenced by main().


| double mdiadaptlm::backunig | ( | ngram | ng | ) |
References discount().
Referenced by adapt(), and scalefact().


| int mdiadaptlm::bodiscount | ( | ngram | ng, | |
| int | size, | |||
| double & | fstar, | |||
| double & | lambda, | |||
| double & | bo | |||
| ) |
References interplm::backoff, ngramtable::boff(), ngramtable::dict, discount(), ngram::link, and ngram::trans().
Referenced by prob(), saveARPA(), saveASR(), and saveMT().


| int mdiadaptlm::compute_backoff | ( | ) |
References interplm::backoff, ngramtable::boff(), CONT, ngramtable::dict, discount(), INIT, ngram::link, interplm::lmsize(), prob(), ngram::pushc(), ngramtable::scan(), and ngramtable::succscan().
Referenced by main().


| int mdiadaptlm::discount | ( | ngram | ng, | |
| int | size, | |||
| double & | fstar, | |||
| double & | lambda, | |||
| int | cv = 0 | |||
| ) | [virtual] |
Reimplemented from interplm.
Reimplemented in linearwb, mixture, shiftone, shiftbeta, symshiftbeta, and mshiftbeta.
References ngramtable::dict, scalefact(), ngram::trans(), and zeta().
Referenced by backunig(), bodiscount(), compute_backoff(), netsize(), prob2(), saveASR(), saveMT(), txclprob(), and zeta().


| double mdiadaptlm::foreunig | ( | ngram | ng | ) |
References interplm::discount().
Referenced by scalefact().


| double mdiadaptlm::myround | ( | double | x | ) | [inline] |
Reimplemented from ngramtable.
| int mdiadaptlm::netsize | ( | ) | [virtual] |
Reimplemented from interplm.
References CONT, ngramtable::dict, discount(), INIT, ngramtable::maxlevel(), ngramtable::scan(), and dictionary::size().
Referenced by main().


| double mdiadaptlm::prob | ( | ngram | ng, | |
| int | size, | |||
| double & | fstar, | |||
| double & | lambda, | |||
| double & | bo | |||
| ) |
| double mdiadaptlm::prob | ( | ngram | ng, | |
| int | size | |||
| ) | [virtual] |
Reimplemented from interplm.
Referenced by compute_backoff(), main(), prob(), prob2(), saveARPA(), saveASR(), saveMT(), and mixture::train().

| double mdiadaptlm::prob2 | ( | ngram | ng, | |
| int | size, | |||
| double & | fstar | |||
| ) |
| int mdiadaptlm::saveARPA | ( | char * | filename, | |
| int | backoff = 0, |
|||
| char * | subdictfile = NULL | |||
| ) |
References bodiscount(), CONT, ngram::containsWord(), dictionary::decode(), ngramtable::dict, dictionary::EoS(), INIT, interplm::lmsize(), dictionary::OOV(), dictionary::oovcode(), prob(), ngram::pushc(), ngramtable::scan(), dictionary::size(), ngram::trans(), and ngram::wordp().
Referenced by main().


| int mdiadaptlm::saveASR | ( | char * | filename, | |
| int | backoff, | |||
| char * | subdictfile = NULL | |||
| ) |
References bodiscount(), ngramtable::boff(), CONT, ngram::containsWord(), dictionary::decode(), ngramtable::dict, discount(), fseek(), ftell(), fwritex(), ifwrite(), INIT, interplm::lmsize(), dictionary::OOV(), dictionary::oovcode(), prob(), ngramtable::scan(), ngram::size, dictionary::size(), ngramtable::succ1(), ngramtable::succ2(), ngramtable::succscan(), ngram::trans(), ngram::wordp(), and writeNull().
Referenced by main().


| int mdiadaptlm::saveMT | ( | char * | filename, | |
| int | backoff, | |||
| char * | subdictfile = NULL, |
|||
| int | resolution = 10000000, |
|||
| double | decay = 0.999900 | |||
| ) |
write backoff of higher order!!
References BACKOFF_, bodiscount(), CONT, ngramtable::dict, discount(), DUMMY_, dictionary::encode(), dictionary::freq(), ngram::freq, dictionary::incflag(), INIT, interplm::lmsize(), ngramtable::maxlevel(), dictionary::OOV(), OOV_, dictionary::oovcode(), prob(), ngram::pushc(), ngramtable::put(), dictionary::save(), ngramtable::scan(), ngram::size, ngram::trans(), and ngram::wordp().

| double mdiadaptlm::scalefact | ( | ngram | ng | ) |
References backunig(), ngramtable::dict, foreunig(), gis_step, dictionary::oovcode(), ngram::trans(), and ngram::wordp().

| int mdiadaptlm::scalefact | ( | char * | ngtfile | ) |
References backunig(), cache, ngramtable::dict, foreunig(), NULL, dictionary::oovcode(), dictionary::size(), interplm::train(), ngram::trans(), and ngram::wordp().
Referenced by adapt(), discount(), and zeta().


| double mdiadaptlm::txclprob | ( | ngram | ng, | |
| int | size | |||
| ) |
References ngramtable::dict, discount(), dictionary::dub(), ngram::freq, ngramtable::freq(), dictionary::oovcode(), dictionary::size(), ngramtable::totfreq(), and ngram::wordp().

| double mdiadaptlm::zeta | ( | ngram | ng, | |
| int | size | |||
| ) |
References cache, CONT, discount(), normcache::get(), INIT, normcache::put(), scalefact(), ngram::size, and ngramtable::succscan().
Referenced by adapt(), and discount().


Referenced by mdiadaptlm(), scalefact(), zeta(), and ~mdiadaptlm().
| double mdiadaptlm::gis_step |
Referenced by adapt(), and scalefact().
1.5.9