00001 /********************************* 00002 tercpp: an open-source Translation Edit Rate (TER) scorer tool for Machine Translation. 00003 00004 Copyright 2010-2013, Christophe Servan, LIUM, University of Le Mans, France 00005 Contact: christophe.servan@lium.univ-lemans.fr 00006 00007 The tercpp tool and library are free software: you can redistribute it and/or modify it 00008 under the terms of the GNU Lesser General Public License as published by 00009 the Free Software Foundation, either version 2.1 of the licence, or 00010 (at your option) any later version. 00011 00012 This program and library are distributed in the hope that it will be useful, but WITHOUT 00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00014 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00015 for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public License 00018 along with this library; if not, write to the Free Software Foundation, 00019 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 **********************************/ 00021 #include "bestShiftStruct.h" 00022 00023 using namespace std; 00024 00025 namespace TERCPPNS_TERCpp 00026 { 00027 bestShiftStruct::bestShiftStruct() 00028 { 00029 m_best_shift=new terShift(); 00030 m_best_align=new terAlignment(); 00031 m_empty=new bool(false); 00032 } 00033 bestShiftStruct::~bestShiftStruct() 00034 { 00035 delete(m_best_align); 00036 delete(m_best_shift); 00037 } 00038 void bestShiftStruct::setEmpty(bool b) 00039 { 00040 m_empty=new bool(b); 00041 } 00042 void bestShiftStruct::setBestShift(terShift * l_terShift) 00043 { 00044 m_best_shift->set(l_terShift); 00045 } 00046 void bestShiftStruct::setBestAlign(terAlignment * l_terAlignment) 00047 { 00048 m_best_align->set(l_terAlignment); 00049 } 00050 string bestShiftStruct::toString() 00051 { 00052 stringstream s; 00053 s << m_best_shift->toString() << endl; 00054 s << m_best_align->toString() << endl; 00055 // s << (*m_empty) << endl; 00056 return s.str(); 00057 } 00058 bool bestShiftStruct::getEmpty() 00059 { 00060 return (*(m_empty)); 00061 } 00062 00063 00064 00065 00066 00067 }