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 "infosHasher.h" 00022 // The following class defines a hash function for strings 00023 00024 00025 using namespace std; 00026 using namespace TERCPPNS_Tools; 00027 00028 namespace TERCPPNS_HashMapSpace 00029 { 00030 infosHasher::infosHasher (long cle,string cleTxt, vector<int> valueVecInt ) 00031 { 00032 m_hashKey=cle; 00033 m_key=cleTxt; 00034 m_value=valueVecInt; 00035 } 00036 // infosHasher::~infosHasher(){};*/ 00037 long infosHasher::getHashKey() 00038 { 00039 return m_hashKey; 00040 } 00041 string infosHasher::getKey() 00042 { 00043 return m_key; 00044 } 00045 vector<int> infosHasher::getValue() 00046 { 00047 return m_value; 00048 } 00049 void infosHasher::setValue ( vector<int> value ) 00050 { 00051 m_value=value; 00052 } 00053 string infosHasher::toString() 00054 { 00055 stringstream to_return; 00056 to_return << m_hashKey << "\t" << m_key << "\t" << vectorToString(m_value,"\t") << endl; 00057 return to_return.str(); 00058 } 00059 00060 00061 // typedef stdext::hash_map<std::string,string, stringhasher> HASH_S_S; 00062 }