#include <tercalc.h>
Public Member Functions | |
terCalc () | |
~terCalc () | |
void | setDebugMode (bool b) |
terAlignment | WERCalculation (vector< string > &hyp, vector< string > &ref) |
hashMapInfos | createConcordMots (vector< string > &hyp, vector< string > &ref) |
terAlignment | minimizeDistanceEdition (vector< string > &hyp, vector< string > &ref, vector< vecInt > &curHypSpans) |
void | minimizeDistanceEdition (vector< string > &hyp, vector< string > &ref, vector< vecInt > &curHypSpans, terAlignment *l_terAlign) |
bool | trouverIntersection (vecInt &refSpan, vecInt &hypSpan) |
terAlignment | TER (vector< string > &hyp, vector< string > &ref, float avRefLength) |
terAlignment | TER (vector< string > &hyp, vector< string > &ref) |
terAlignment | TER (vector< int > &hyp, vector< int > &ref) |
bestShiftStruct * | findBestShift (vector< string > &cur, vector< string > &hyp, vector< string > &ref, hashMapInfos &rloc, TERCPPNS_TERCpp::terAlignment &med_align) |
void | calculateTerAlignment (terAlignment &align, vector< bool > *herr, vector< bool > *rerr, vector< int > *ralign) |
vector< vecTerShift > * | calculerPermutations (vector< string > &hyp, vector< string > &ref, hashMapInfos &rloc, TERCPPNS_TERCpp::terAlignment &align, vector< bool > *herr, vector< bool > *rerr, vector< int > *ralign) |
alignmentStruct | permuter (vector< string > &words, terShift &s) |
alignmentStruct | permuter (vector< string > &words, terShift *s) |
alignmentStruct | permuter (vector< string > &words, int start, int end, int newloc) |
Public Attributes | |
int | shift_cost |
int | insert_cost |
int | delete_cost |
int | substitute_cost |
int | match_cost |
double | infinite |
Definition at line 48 of file tercalc.h.
TERCPPNS_TERCpp::terCalc::terCalc | ( | ) |
Definition at line 38 of file tercalc.cpp.
References delete_cost, infinite, insert_cost, match_cost, shift_cost, and substitute_cost.
TERCPPNS_TERCpp::terCalc::~terCalc | ( | ) |
Definition at line 64 of file tercalc.cpp.
void TERCPPNS_TERCpp::terCalc::calculateTerAlignment | ( | terAlignment & | align, | |
vector< bool > * | herr, | |||
vector< bool > * | rerr, | |||
vector< int > * | ralign | |||
) |
Definition at line 688 of file tercalc.cpp.
References TERCPPNS_TERCpp::terAlignment::alignment, and TERCPPNS_TERCpp::terAlignment::toString().
Referenced by findBestShift().
vector< vecTerShift > * TERCPPNS_TERCpp::terCalc::calculerPermutations | ( | vector< string > & | hyp, | |
vector< string > & | ref, | |||
hashMapInfos & | rloc, | |||
TERCPPNS_TERCpp::terAlignment & | align, | |||
vector< bool > * | herr, | |||
vector< bool > * | rerr, | |||
vector< int > * | ralign | |||
) |
Definition at line 736 of file tercalc.cpp.
References TERCPPNS_TERCpp::terShift::cost, TERCPPNS_TERCpp::terShift::end, end, TERCPPNS_HashMapSpace::hashMapInfos::getValue(), TERCPPNS_TERCpp::terShift::moveto, TERCPPNS_TERCpp::terShift::newloc, shift_cost, TERCPPNS_TERCpp::terShift::shifted, TERCPPNS_TERCpp::terShift::start, TERCPPNS_Tools::subVector(), TERCPPNS_HashMapSpace::hashMapInfos::trouve(), and TERCPPNS_Tools::vectorToString().
Referenced by findBestShift().
hashMapInfos TERCPPNS_TERCpp::terCalc::createConcordMots | ( | vector< string > & | hyp, | |
vector< string > & | ref | |||
) |
Definition at line 108 of file tercalc.cpp.
References TERCPPNS_HashMapSpace::hashMap::addHasher(), TERCPPNS_HashMapSpace::hashMapInfos::addValue(), end, TERCPPNS_HashMapSpace::hashMapInfos::getValue(), TERCPPNS_HashMapSpace::hashMapInfos::setValue(), TERCPPNS_Tools::subVector(), TERCPPNS_HashMapSpace::hashMap::trouve(), and TERCPPNS_Tools::vectorToString().
Referenced by TER().
bestShiftStruct * TERCPPNS_TERCpp::terCalc::findBestShift | ( | vector< string > & | cur, | |
vector< string > & | hyp, | |||
vector< string > & | ref, | |||
hashMapInfos & | rloc, | |||
TERCPPNS_TERCpp::terAlignment & | med_align | |||
) |
Definition at line 522 of file tercalc.cpp.
References TERCPPNS_TERCpp::terAlignment::aftershift, TERCPPNS_TERCpp::alignmentStruct::aftershift, calculateTerAlignment(), calculerPermutations(), TERCPPNS_TERCpp::terShift::cost, TERCPPNS_TERCpp::terAlignment::hyp, TERCPPNS_TERCpp::terAlignment::join(), TERCPPNS_Tools::join(), TERCPPNS_TERCpp::bestShiftStruct::m_best_align, TERCPPNS_TERCpp::bestShiftStruct::m_best_shift, minimizeDistanceEdition(), TERCPPNS_TERCpp::terAlignment::numEdits, TERCPPNS_TERCpp::alignmentStruct::nwords, permuter(), TERCPPNS_TERCpp::terAlignment::ref, TERCPPNS_TERCpp::terAlignment::set(), TERCPPNS_TERCpp::alignmentStruct::set(), TERCPPNS_TERCpp::terShift::set(), TERCPPNS_TERCpp::bestShiftStruct::setEmpty(), TERCPPNS_TERCpp::terAlignment::toString(), TERCPPNS_TERCpp::terShift::toString(), sapt::toString(), and TERCPPNS_Tools::vectorToString().
Referenced by TER().
void TERCPPNS_TERCpp::terCalc::minimizeDistanceEdition | ( | vector< string > & | hyp, | |
vector< string > & | ref, | |||
vector< vecInt > & | curHypSpans, | |||
terAlignment * | l_terAlign | |||
) |
Definition at line 314 of file tercalc.cpp.
References TERCPPNS_TERCpp::terAlignment::alignment, TERCPPNS_TERCpp::terAlignment::averageWords, delete_cost, TERCPPNS_TERCpp::terAlignment::hyp, infinite, insert_cost, match_cost, TERCPPNS_TERCpp::terAlignment::numEdits, TERCPPNS_TERCpp::terAlignment::numWords, TERCPPNS_TERCpp::terAlignment::ref, substitute_cost, TERCPPNS_TERCpp::terAlignment::toString(), and trouverIntersection().
terAlignment TERCPPNS_TERCpp::terCalc::minimizeDistanceEdition | ( | vector< string > & | hyp, | |
vector< string > & | ref, | |||
vector< vecInt > & | curHypSpans | |||
) |
Definition at line 150 of file tercalc.cpp.
References TERCPPNS_TERCpp::terAlignment::alignment, TERCPPNS_TERCpp::terAlignment::averageWords, delete_cost, TERCPPNS_TERCpp::terAlignment::hyp, infinite, insert_cost, match_cost, TERCPPNS_TERCpp::terAlignment::numEdits, TERCPPNS_TERCpp::terAlignment::numWords, TERCPPNS_TERCpp::terAlignment::ref, substitute_cost, TERCPPNS_TERCpp::terAlignment::toString(), and trouverIntersection().
Referenced by findBestShift(), TER(), and WERCalculation().
alignmentStruct TERCPPNS_TERCpp::terCalc::permuter | ( | vector< string > & | words, | |
int | start, | |||
int | end, | |||
int | newloc | |||
) |
Definition at line 900 of file tercalc.cpp.
References TERCPPNS_Tools::join().
alignmentStruct TERCPPNS_TERCpp::terCalc::permuter | ( | vector< string > & | words, | |
TERCPPNS_TERCpp::terShift * | s | |||
) |
Definition at line 894 of file tercalc.cpp.
References TERCPPNS_TERCpp::terShift::end, TERCPPNS_TERCpp::terShift::newloc, permuter(), and TERCPPNS_TERCpp::terShift::start.
alignmentStruct TERCPPNS_TERCpp::terCalc::permuter | ( | vector< string > & | words, | |
TERCPPNS_TERCpp::terShift & | s | |||
) |
Definition at line 890 of file tercalc.cpp.
References TERCPPNS_TERCpp::terShift::end, TERCPPNS_TERCpp::terShift::newloc, and TERCPPNS_TERCpp::terShift::start.
Referenced by findBestShift(), and permuter().
void TERCPPNS_TERCpp::terCalc::setDebugMode | ( | bool | b | ) |
Definition at line 1036 of file tercalc.cpp.
terAlignment TERCPPNS_TERCpp::terCalc::TER | ( | vector< int > & | hyp, | |
vector< int > & | ref | |||
) |
Definition at line 78 of file tercalc.cpp.
References TERCPPNS_Tools::stringToVector(), and TER().
terAlignment TERCPPNS_TERCpp::terCalc::TER | ( | vector< string > & | hyp, | |
vector< string > & | ref | |||
) |
Definition at line 478 of file tercalc.cpp.
References TERCPPNS_TERCpp::terShift::aftershift, TERCPPNS_TERCpp::terAlignment::aftershift, TERCPPNS_TERCpp::terAlignment::alignment, TERCPPNS_TERCpp::terShift::alignment, TERCPPNS_TERCpp::terAlignment::allshifts, TERCPPNS_TERCpp::terShift::cost, createConcordMots(), findBestShift(), TERCPPNS_TERCpp::terAlignment::hyp, minimizeDistanceEdition(), TERCPPNS_TERCpp::terAlignment::numEdits, TERCPPNS_TERCpp::terAlignment::ref, and TERCPPNS_TERCpp::terAlignment::toString().
terAlignment TERCPPNS_TERCpp::terCalc::TER | ( | vector< string > & | hyp, | |
vector< string > & | ref, | |||
float | avRefLength | |||
) |
Definition at line 141 of file tercalc.cpp.
Referenced by minimizeDistanceEdition().
terAlignment TERCPPNS_TERCpp::terCalc::WERCalculation | ( | vector< string > & | hyp, | |
vector< string > & | ref | |||
) |
Definition at line 71 of file tercalc.cpp.
References minimizeDistanceEdition().