/********************************* tercpp: an open-source Translation Edit Rate (TER) scorer tool for Machine Translation. Copyright 2010-2013, Christophe Servan, LIUM, University of Le Mans, France Contact: christophe.servan@lium.univ-lemans.fr The tercpp tool and library are free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the licence, or (at your option) any later version. This program and library are 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 Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA **********************************/ #ifndef __TERCPPTOOLS_H__ #define __TERCPPTOOLS_H__ #include #include #include #include #include #include #include using namespace std; namespace TERCPPNS_Tools { typedef vector vecDouble; typedef vector vecChar; typedef vector vecInt; typedef vector vecFloat; typedef vector vecSize_t; typedef vector vecString; typedef vector alignmentElement; typedef vector WERalignment; struct param { bool debugMode; string referenceFile; // path to the resources string hypothesisFile; // path to the configuration files string outputFileExtension; string outputFileName; bool noPunct; bool caseOn; bool normalize; bool tercomLike; bool sgmlInputs; bool verbose; bool count_verbose; bool noTxtIds; bool printAlignments; bool WER; int debugLevel; }; // param = { false, "","","","" }; // class tools{ // private: // public: string vectorToString ( vector vec ); string vectorToString ( vector vec ); string vectorToString ( vector vec ); string vectorToString ( vector vec, string s ); string vectorToString ( vector vec, string s ); string vectorToString ( vector vec, string s ); string vectorToString ( vector vec, string s ); string vectorToString ( char* vec, string s, int taille ); string vectorToString ( int* vec, string s , int taille ); string vectorToString ( bool* vec, string s , int taille ); string vectorToString ( vector* vec, string s, int taille ); string vectorToString ( vector* vec, string s , int taille ); string vectorToString ( vector* vec, string s , int taille ); vector subVector ( vector vec, int start, int end ); vector subVector ( vector vec, int start, int end ); vector subVector ( vector vec, int start, int end ); vector copyVector ( vector vec ); vector copyVector ( vector vec ); vector copyVector ( vector vec ); vector stringToVector ( string s, string tok ); vector stringToVector ( char s, string tok ); vector stringToVector ( int s, string tok ); vector stringToVectorInt ( string s, string tok ); vector stringToVectorFloat ( string s, string tok ); string lowerCase(string str); string removePunct(string str); string tokenizePunct(string str); string removePunctTercom(string str); string normalizeStd(string str); string printParams(param p); string join ( string delim, vector arr ); // }; param copyParam(param p); } #endif