mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-27 22:14:57 +03:00
8c3b82e596
This change might be useful to avoid duplicating the names. The reason is that although MERT programs are standalone applications, some header files such as data.h and point.h have common guard macro names like "DATA_H" and "POINT_H", and this is not good naming conventions when you want to include external headers. Some files actually include headers in Moses and KenLM's util.
115 lines
2.3 KiB
C++
115 lines
2.3 KiB
C++
#include "alignmentStruct.h"
|
|
|
|
using namespace std;
|
|
namespace TERCpp
|
|
{
|
|
string alignmentStruct::toString()
|
|
{
|
|
stringstream s;
|
|
// s << "nword : " << vectorToString(nwords)<<endl;
|
|
// s << "alignment" << vectorToString(alignment)<<endl;
|
|
// s << "afterShift" << vectorToString(alignment)<<endl;
|
|
s << "Nothing to be printed" <<endl;
|
|
return s.str();
|
|
}
|
|
|
|
// alignmentStruct::alignmentStruct()
|
|
// {
|
|
// // vector<string> ref;
|
|
// // vector<string> hyp;
|
|
// // vector<string> aftershift;
|
|
//
|
|
// // alignmentStruct[] allshifts = null;
|
|
//
|
|
// numEdits=0;
|
|
// numWords=0;
|
|
// bestRef="";
|
|
//
|
|
// numIns=0;
|
|
// numDel=0;
|
|
// numSub=0;
|
|
// numSft=0;
|
|
// numWsf=0;
|
|
// }
|
|
// alignmentStruct::alignmentStruct ()
|
|
// {
|
|
// start = 0;
|
|
// end = 0;
|
|
// moveto = 0;
|
|
// newloc = 0;
|
|
// cost=1.0;
|
|
// }
|
|
// alignmentStruct::alignmentStruct (int _start, int _end, int _moveto, int _newloc)
|
|
// {
|
|
// start = _start;
|
|
// end = _end;
|
|
// moveto = _moveto;
|
|
// newloc = _newloc;
|
|
// cost=1.0;
|
|
// }
|
|
|
|
// alignmentStruct::alignmentStruct (int _start, int _end, int _moveto, int _newloc, vector<string> _shifted)
|
|
// {
|
|
// start = _start;
|
|
// end = _end;
|
|
// moveto = _moveto;
|
|
// newloc = _newloc;
|
|
// shifted = _shifted;
|
|
// cost=1.0;
|
|
// }
|
|
// string alignmentStruct::vectorToString(vector<string> vec)
|
|
// {
|
|
// string retour("");
|
|
// for (vector<string>::iterator vecIter=vec.begin();vecIter!=vec.end(); vecIter++)
|
|
// {
|
|
// retour+=(*vecIter)+"\t";
|
|
// }
|
|
// return retour;
|
|
// }
|
|
|
|
// string alignmentStruct::toString()
|
|
// {
|
|
// stringstream s;
|
|
// s.str("");
|
|
// s << "[" << start << ", " << end << ", " << moveto << "/" << newloc << "]";
|
|
// if ((int)shifted.size() > 0)
|
|
// {
|
|
// s << " (" << vectorToString(shifted) << ")";
|
|
// }
|
|
// return s.str();
|
|
// }
|
|
|
|
/* The distance of the shift. */
|
|
// int alignmentStruct::distance()
|
|
// {
|
|
// if (moveto < start)
|
|
// {
|
|
// return start - moveto;
|
|
// }
|
|
// else if (moveto > end)
|
|
// {
|
|
// return moveto - end;
|
|
// }
|
|
// else
|
|
// {
|
|
// return moveto - start;
|
|
// }
|
|
// }
|
|
//
|
|
// bool alignmentStruct::leftShift()
|
|
// {
|
|
// return (moveto < start);
|
|
// }
|
|
//
|
|
// int alignmentStruct::size()
|
|
// {
|
|
// return (end - start) + 1;
|
|
// }
|
|
// alignmentStruct alignmentStruct::operator=(alignmentStruct t)
|
|
// {
|
|
//
|
|
// return t;
|
|
// }
|
|
|
|
|
|
} |