/* * Copyright (C) 2009 Felipe Sánchez-Martínez * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ #include #include #include "TypeDef.h" #include "PhraseDictionaryTreeAdaptor.h" #include "Phrase.h" #include "TargetPhraseCollection.h" #include "LMList.h" #include "ScoreComponentCollection.h" using namespace std; using namespace Moses; //Delete white spaces from the end and the begining of the string string trim(string str) { string::iterator it; while ((str.length()>0)&&((*(it=str.begin()))==' ')) { str.erase(it); } while ((str.length()>0)&&((*(it=(str.end()-1)))==' ')) { str.erase(it); } for(unsigned i=0; i input, output; vector weight; int numScoreComponent=5; int numInputScores=0; int tableLimit=0; int weightWP=0; LMList lmList; input.push_back(0); output.push_back(0); weight.push_back(0); weight.push_back(0); weight.push_back(0); weight.push_back(0); weight.push_back(0); if (argc<3) { cerr<<"Error: Wrong number of parameters."<0) source_str+=" "; source_str+=argv[i]; } cerr<<"numScoreComponent: "<Load(input, output, filePath, weight, tableLimit, lmList, weightWP)) { delete pd; return false; } cerr<<"-------------------------------------------------"<GetTargetPhraseCollection(phrase); if (tpc == NULL) cerr<<"Not found."<begin(); iterTargetPhrase != tpc->end(); ++iterTargetPhrase) { //cerr<<(*(*iterTargetPhrase))<(*(*iterTargetPhrase)); cerr< ___"<GetScoreBreakdown(); cerr<<"Scores: "; for(unsigned i=0; i