|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __TERCPPTOOLS_H__ |
|
#define __TERCPPTOOLS_H__ |
|
|
|
|
|
#include <vector> |
|
#include <iostream> |
|
#include <cstdio> |
|
#include <cstdlib> |
|
#include <string> |
|
#include <sstream> |
|
#include <boost/xpressive/xpressive.hpp> |
|
|
|
|
|
using namespace std; |
|
|
|
namespace TERCPPNS_Tools |
|
{ |
|
typedef vector<double> vecDouble; |
|
typedef vector<char> vecChar; |
|
typedef vector<int> vecInt; |
|
typedef vector<float> vecFloat; |
|
typedef vector<size_t> vecSize_t; |
|
typedef vector<string> vecString; |
|
typedef vector<string> alignmentElement; |
|
typedef vector<alignmentElement> WERalignment; |
|
|
|
|
|
struct param { |
|
bool debugMode; |
|
string referenceFile; |
|
string hypothesisFile; |
|
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; |
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
string vectorToString ( vector<string> vec ); |
|
string vectorToString ( vector<char> vec ); |
|
string vectorToString ( vector<int> vec ); |
|
string vectorToString ( vector<string> vec, string s ); |
|
string vectorToString ( vector<char> vec, string s ); |
|
string vectorToString ( vector<int> vec, string s ); |
|
string vectorToString ( vector<bool> 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<char>* vec, string s, int taille ); |
|
string vectorToString ( vector<int>* vec, string s , int taille ); |
|
string vectorToString ( vector<bool>* vec, string s , int taille ); |
|
vector<string> subVector ( vector<string> vec, int start, int end ); |
|
vector<int> subVector ( vector<int> vec, int start, int end ); |
|
vector<float> subVector ( vector<float> vec, int start, int end ); |
|
vector<string> copyVector ( vector<string> vec ); |
|
vector<int> copyVector ( vector<int> vec ); |
|
vector<float> copyVector ( vector<float> vec ); |
|
vector<string> stringToVector ( string s, string tok ); |
|
vector<string> stringToVector ( char s, string tok ); |
|
vector<string> stringToVector ( int s, string tok ); |
|
vector<int> stringToVectorInt ( string s, string tok ); |
|
vector<float> 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<string> arr ); |
|
|
|
param copyParam(param p); |
|
} |
|
#endif |
|
|