#include <tercalc.h>
Public Member Functions | |
terCalc () | |
void | setDebugMode (bool b) |
int | WERCalculation (size_t *ref, size_t *hyp) |
int | WERCalculation (vector< string > ref, vector< string > hyp) |
int | WERCalculation (vector< int > ref, vector< int > hyp) |
hashMapInfos | BuildWordMatches (vector< string > hyp, vector< string > ref) |
terAlignment | MinEditDist (vector< string > hyp, vector< string > ref, vector< vecInt > curHypSpans) |
bool | spanIntersection (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 | CalcBestShift (vector< string > cur, vector< string > hyp, vector< string > ref, hashMapInfos rloc, terAlignment cur_align) |
void | FindAlignErr (terAlignment align, bool *herr, bool *rerr, int *ralign) |
vector< vecTerShift > | GatherAllPossShifts (vector< string > hyp, vector< string > ref, hashMapInfos rloc, terAlignment align, bool *herr, bool *rerr, int *ralign) |
alignmentStruct | PerformShift (vector< string > words, terShift s) |
alignmentStruct | PerformShift (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 | INF |
Definition at line 28 of file tercalc.h.
TERCpp::terCalc::terCalc | ( | ) |
Definition at line 18 of file tercalc.cpp.
References delete_cost, INF, insert_cost, match_cost, shift_cost, and substitute_cost.
hashMapInfos TERCpp::terCalc::BuildWordMatches | ( | vector< string > | hyp, | |
vector< string > | ref | |||
) |
Definition at line 401 of file tercalc.cpp.
References HashMapSpace::hashMap::addHasher(), HashMapSpace::hashMapInfos::addValue(), end, HashMapSpace::hashMapInfos::getValue(), HashMapSpace::hashMapInfos::setValue(), Tools::subVector(), HashMapSpace::hashMap::trouve(), and Tools::vectorToString().
Referenced by TER().
bestShiftStruct TERCpp::terCalc::CalcBestShift | ( | vector< string > | cur, | |
vector< string > | hyp, | |||
vector< string > | ref, | |||
hashMapInfos | rloc, | |||
terAlignment | cur_align | |||
) |
Definition at line 637 of file tercalc.cpp.
References TERCpp::terAlignment::aftershift, TERCpp::alignmentStruct::aftershift, TERCpp::terShift::cost, FindAlignErr(), GatherAllPossShifts(), TERCpp::terAlignment::hyp, TERCpp::terAlignment::join(), TERCpp::bestShiftStruct::m_best_align, TERCpp::bestShiftStruct::m_best_shift, TERCpp::bestShiftStruct::m_empty, MinEditDist(), TERCpp::terAlignment::numEdits, TERCpp::alignmentStruct::nwords, PerformShift(), TERCpp::terAlignment::ref, TERCpp::terAlignment::toString(), and TERCpp::terShift::toString().
Referenced by TER().
void TERCpp::terCalc::FindAlignErr | ( | terAlignment | align, | |
bool * | herr, | |||
bool * | rerr, | |||
int * | ralign | |||
) |
Definition at line 731 of file tercalc.cpp.
References TERCpp::terAlignment::alignment, and TERCpp::terAlignment::toString().
Referenced by CalcBestShift().
vector< vecTerShift > TERCpp::terCalc::GatherAllPossShifts | ( | vector< string > | hyp, | |
vector< string > | ref, | |||
hashMapInfos | rloc, | |||
terAlignment | align, | |||
bool * | herr, | |||
bool * | rerr, | |||
int * | ralign | |||
) |
Definition at line 768 of file tercalc.cpp.
References TERCpp::terShift::cost, end, HashMapSpace::hashMapInfos::getValue(), shift_cost, TERCpp::terShift::shifted, Tools::subVector(), HashMapSpace::hashMapInfos::trouve(), and Tools::vectorToString().
Referenced by CalcBestShift().
terAlignment TERCpp::terCalc::MinEditDist | ( | vector< string > | hyp, | |
vector< string > | ref, | |||
vector< vecInt > | curHypSpans | |||
) |
Definition at line 443 of file tercalc.cpp.
References TERCpp::terAlignment::alignment, delete_cost, INF, insert_cost, match_cost, TERCpp::terAlignment::numEdits, TERCpp::terAlignment::numWords, spanIntersection(), substitute_cost, and TERCpp::terAlignment::toString().
Referenced by CalcBestShift(), and TER().
alignmentStruct TERCpp::terCalc::PerformShift | ( | vector< string > | words, | |
int | start, | |||
int | end, | |||
int | newloc | |||
) |
Definition at line 905 of file tercalc.cpp.
alignmentStruct TERCpp::terCalc::PerformShift | ( | vector< string > | words, | |
terShift | s | |||
) |
Definition at line 899 of file tercalc.cpp.
References TERCpp::terShift::end, TERCpp::terShift::newloc, and TERCpp::terShift::start.
Referenced by CalcBestShift().
void TERCpp::terCalc::setDebugMode | ( | bool | b | ) |
Definition at line 1030 of file tercalc.cpp.
bool TERCpp::terCalc::spanIntersection | ( | vecInt | refSpan, | |
vecInt | hypSpan | |||
) |
Definition at line 434 of file tercalc.cpp.
Referenced by MinEditDist().
terAlignment TERCpp::terCalc::TER | ( | vector< int > | hyp, | |
vector< int > | ref | |||
) |
terAlignment TERCpp::terCalc::TER | ( | vector< string > | hyp, | |
vector< string > | ref | |||
) |
Definition at line 599 of file tercalc.cpp.
References TERCpp::terShift::aftershift, TERCpp::terAlignment::aftershift, TERCpp::terAlignment::alignment, TERCpp::terShift::alignment, TERCpp::terAlignment::allshifts, BuildWordMatches(), CalcBestShift(), TERCpp::terShift::cost, TERCpp::terAlignment::hyp, TERCpp::bestShiftStruct::m_best_align, TERCpp::bestShiftStruct::m_best_shift, TERCpp::bestShiftStruct::m_empty, MinEditDist(), TERCpp::terAlignment::numEdits, TERCpp::terAlignment::ref, and TERCpp::terAlignment::toString().
terAlignment TERCpp::terCalc::TER | ( | vector< string > | hyp, | |
vector< string > | ref, | |||
float | avRefLength | |||
) |
int TERCpp::terCalc::WERCalculation | ( | vector< int > | ref, | |
vector< int > | hyp | |||
) |
int TERCpp::terCalc::WERCalculation | ( | vector< string > | ref, | |
vector< string > | hyp | |||
) |
int TERCpp::terCalc::WERCalculation | ( | size_t * | ref, | |
size_t * | hyp | |||
) |
Definition at line 52 of file tercalc.cpp.
double TERCpp::terCalc::INF |