Change the naming conventions for the guard macros; Rename TER directory.

This change might be useful to avoid duplicating the names.
The reason is that although MERT programs are standalone
applications, some header files such as data.h and
point.h have common guard macro names like "DATA_H" and
"POINT_H", and this is not good naming conventions
when you want to include external headers.
Some files actually include headers in Moses and KenLM's util.
This commit is contained in:
Tetsuo Kiso 2012-02-20 09:46:08 +09:00
parent 82da44b030
commit 47ac8a474d
50 changed files with 123 additions and 125 deletions

View File

@ -1,5 +1,5 @@
#ifndef __BLEUSCORER_H__
#define __BLEUSCORER_H__
#ifndef MERT_BLEU_SCORER_H_
#define MERT_BLEU_SCORER_H_
#include <iostream>
#include <string>
@ -80,4 +80,4 @@ private:
BleuScorer& operator=(const BleuScorer&);
};
#endif // __BLEUSCORER_H__
#endif // MERT_BLEU_SCORER_H_

View File

@ -1,5 +1,5 @@
#ifndef __CDERSCORER_H__
#define __CDERSCORER_H__
#ifndef MERT_CDER_SCORER_H_
#define MERT_CDER_SCORER_H_
#include <algorithm>
#include <iostream>
@ -39,4 +39,4 @@ private:
CderScorer& operator=(const CderScorer&);
};
#endif // __CDERSCORER_H__
#endif // MERT_CDER_SCORER_H_

View File

@ -6,8 +6,8 @@
*
*/
#ifndef DATA_H
#define DATA_H
#ifndef MERT_DATA_H_
#define MERT_DATA_H_
using namespace std;
@ -122,4 +122,4 @@ public:
std::vector<Data>& shards);
};
#endif // DATA_H
#endif // MERT_DATA_H_

View File

@ -6,8 +6,8 @@
*
*/
#ifndef FEATURE_ARRAY_H
#define FEATURE_ARRAY_H
#ifndef MERT_FEATURE_ARRAY_H_
#define MERT_FEATURE_ARRAY_H_
#include <vector>
#include <iostream>
@ -107,4 +107,4 @@ public:
bool check_consistency() const;
};
#endif // FEATURE_ARRAY_H
#endif // MERT_FEATURE_ARRAY_H_

View File

@ -6,8 +6,8 @@
*
*/
#ifndef FEATURE_DATA_H
#define FEATURE_DATA_H
#ifndef MERT_FEATURE_DATA_H_
#define MERT_FEATURE_DATA_H_
using namespace std;
@ -141,4 +141,4 @@ public:
std::string ToString() const;
};
#endif // FEATURE_DATA_H
#endif // MERT_FEATURE_DATA_H_

View File

@ -17,8 +17,8 @@ License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
***********************************************************************/
#ifndef _FEATURE_DATA_ITERATOR_
#define _FEATURE_DATA_ITERATOR_
#ifndef MERT_FEATURE_DATA_ITERATOR_H_
#define MERT_FEATURE_DATA_ITERATOR_H_
/**
* For loading from the feature data file.
@ -88,4 +88,4 @@ class FeatureDataIterator :
std::vector<FeatureDataItem> m_next;
};
#endif
#endif // MERT_FEATURE_DATA_ITERATOR_H_

View File

@ -6,8 +6,8 @@
*
*/
#ifndef FEATURE_STATS_H
#define FEATURE_STATS_H
#ifndef MERT_FEATURE_STATS_H_
#define MERT_FEATURE_STATS_H_
#include <cstring>
#include <fstream>
@ -138,4 +138,4 @@ public:
bool operator==(const FeatureStats& f1, const FeatureStats& f2);
//END_ADDED
#endif // FEATURE_STATS_H
#endif // MERT_FEATURE_STATS_H_

View File

@ -1,5 +1,5 @@
#ifndef FILESTREAM_H_
#define FILESTREAM_H_
#ifndef MERT_FILE_STREAM_H_
#define MERT_FILE_STREAM_H_
#include <fstream>
#include <streambuf>
@ -31,4 +31,4 @@ public:
void close();
};
#endif // FILESTREAM_H_
#endif // MERT_FILE_STREAM_H_

View File

@ -17,17 +17,17 @@ PerScorer.cpp
Scorer.cpp
ScorerFactory.cpp
Optimizer.cpp
TERsrc/alignmentStruct.cpp
TERsrc/hashMap.cpp
TERsrc/hashMapStringInfos.cpp
TERsrc/stringHasher.cpp
TERsrc/terAlignment.cpp
TERsrc/terShift.cpp
TERsrc/hashMapInfos.cpp
TERsrc/infosHasher.cpp
TERsrc/stringInfosHasher.cpp
TERsrc/tercalc.cpp
TERsrc/tools.cpp
TER/alignmentStruct.cpp
TER/hashMap.cpp
TER/hashMapStringInfos.cpp
TER/stringHasher.cpp
TER/terAlignment.cpp
TER/terShift.cpp
TER/hashMapInfos.cpp
TER/infosHasher.cpp
TER/stringInfosHasher.cpp
TER/tercalc.cpp
TER/tools.cpp
TerScorer.cpp
CderScorer.cpp
MergeScorer.cpp

View File

@ -8,8 +8,8 @@
#include "PerScorer.h"
#include "CderScorer.h"
#include "TERsrc/tercalc.h"
#include "TERsrc/terAlignment.h"
#include "TER/tercalc.h"
#include "TER/terAlignment.h"
using namespace TERCpp;

View File

@ -1,5 +1,5 @@
#ifndef __MERGESCORER_H__
#define __MERGESCORER_H__
#ifndef MERT_MERGE_SCORER_H_
#define MERT_MERGE_SCORER_H_
#include <iostream>
#include <set>
@ -40,4 +40,4 @@ protected:
MergeScorer& operator=(const MergeScorer&);
};
#endif //__TERSCORER_H
#endif // MERT_MERGE_SCORER_H_

View File

@ -1,5 +1,5 @@
#ifndef OPTIMIZER_H
#define OPTIMIZER_H
#ifndef MERT_OPTIMIZER_H_
#define MERT_OPTIMIZER_H_
#include <vector>
#include <string>

View File

@ -1,5 +1,5 @@
#ifndef __PERSCORER_H__
#define __PERSCORER_H__
#ifndef MERT_PER_SCORER_H_
#define MERT_PER_SCORER_H_
#include <iostream>
#include <set>
@ -49,4 +49,4 @@ private:
vector<multiset<int> > m_ref_tokens;
};
#endif // __PERSCORER_H__
#endif // MERT_PER_SCORER_H_

View File

@ -1,5 +1,5 @@
#ifndef POINT_H
#define POINT_H
#ifndef MERT_POINT_H_
#define MERT_POINT_H_
#include <fstream>
#include <map>
@ -100,4 +100,4 @@ public:
void SetScore(statscore_t score) { score_ = score; }
};
#endif // POINT_H
#endif // MERT_POINT_H

View File

@ -1,5 +1,5 @@
#ifndef SCOPEDVECTOR_H_
#define SCOPEDVECTOR_H_
#ifndef MERT_SCOPED_VECTOR_H_
#define MERT_SCOPED_VECTOR_H_
#include <vector>
@ -51,4 +51,4 @@ class ScopedVector {
void operator=(const ScopedVector<T>&);
};
#endif // SCOPEDVECTOR_H_
#endif // MERT_SCOPED_VECTOR_H_

View File

@ -6,8 +6,8 @@
*
*/
#ifndef SCORE_ARRAY_H
#define SCORE_ARRAY_H
#ifndef MERT_SCORE_ARRAY_H_
#define MERT_SCORE_ARRAY_H_
using namespace std;
@ -108,4 +108,4 @@ public:
bool check_consistency() const;
};
#endif // SCORE_ARRAY_H
#endif // MERT_SCORE_ARRAY_H_

View File

@ -6,8 +6,8 @@
*
*/
#ifndef SCORE_DATA_H
#define SCORE_DATA_H
#ifndef MERT_SCORE_DATA_H_
#define MERT_SCORE_DATA_H_
#include <fstream>
#include <vector>
@ -114,4 +114,4 @@ public:
}
};
#endif // SCORE_DATA_H
#endif // MERT_SCORE_DATA_H_

View File

@ -17,8 +17,8 @@ License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
***********************************************************************/
#ifndef _SCORE_DATA_ITERATOR_
#define _SCORE_DATA_ITERATOR_
#ifndef MERT_SCORE_DATA_ITERATOR_H_
#define MERT_SCORE_DATA_ITERATOR_H_
/*
* For loading from the score data file.
@ -62,4 +62,4 @@ class ScoreDataIterator :
std::vector<ScoreDataItem> m_next;
};
#endif
#endif // MERT_SCORE_DATA_ITERATOR_H_

View File

@ -6,8 +6,8 @@
*
*/
#ifndef SCORE_STATS_H
#define SCORE_STATS_H
#ifndef MERT_SCORE_STATS_H_
#define MERT_SCORE_STATS_H_
#include <vector>
#include <iostream>
@ -101,7 +101,7 @@ public:
};
//ADDED_BY_TS
bool operator==(const ScoreStats& s1, const ScoreStats& s2);
bool operator==(const ScoreStats& s1, const ScoreStats& s2);
//END_ADDED
#endif // SCORE_STATS_H
#endif // MERT_SCORE_STATS_H_

View File

@ -1,5 +1,5 @@
#ifndef __SCORER_H__
#define __SCORER_H__
#ifndef MERT_SCORER_H_
#define MERT_SCORER_H_
#include <iostream>
#include <sstream>
@ -171,4 +171,4 @@ class StatisticsBasedScorer : public Scorer
size_t m_regularization_window;
};
#endif // __SCORER_H__
#endif // MERT_SCORER_H_

View File

@ -1,5 +1,5 @@
#ifndef __SCORER_FACTORY_H
#define __SCORER_FACTORY_H
#ifndef MERT_SCORER_FACTORY_H_
#define MERT_SCORER_FACTORY_H_
#include <vector>
#include <string>
@ -18,4 +18,4 @@ private:
~ScorerFactory() {}
};
#endif // __SCORER_FACTORY_H
#endif // MERT_SCORER_FACTORY_H_

View File

@ -1,6 +1,5 @@
#ifndef __TERCPPALIGNMENTSTRUCT_H__
#define __TERCPPALIGNMENTSTRUCT_H__
#ifndef MERT_TER_ALIGNMENT_STRUCT_H_
#define MERT_TER_ALIGNMENT_STRUCT_H_
#include <vector>
#include <stdio.h>
@ -8,7 +7,6 @@
#include <sstream>
#include "tools.h"
using namespace std;
using namespace Tools;
@ -44,4 +42,4 @@ public:
}
#endif // __TERCPPALIGNMENTSTRUCT_H__
#endif // MERT_TER_ALIGNMENT_STRUCT_H_

View File

@ -1,5 +1,5 @@
#ifndef __BESTSHIFTSTRUCT_H__
#define __BESTSHIFTSTRUCT_H__
#ifndef MERT_TER_BEST_SHIFT_STRUCT_H_
#define MERT_TER_BEST_SHIFT_STRUCT_H_
#include <vector>
#include <stdio.h>
@ -47,4 +47,4 @@ public:
}
#endif // __BESTSHIFTSTRUCT_H__
#endif // MERT_TER_BEST_SHIFT_STRUCT_H_

View File

@ -2,8 +2,8 @@
* Generic hashmap manipulation functions
*/
#ifndef __HASHMAP_H__
#define __HASHMAP_H__
#ifndef MERT_TER_HASHMAP_H_
#define MERT_TER_HASHMAP_H_
#include "stringHasher.h"
#include <vector>
@ -40,4 +40,4 @@ public:
}
#endif // __HASHMAP_H__
#endif // MERT_TER_HASHMAP_H_

View File

@ -1,8 +1,8 @@
/*
* Generic hashmap manipulation functions
*/
#ifndef __HASHMAPINFOS_H__
#define __HASHMAPINFOS_H__
#ifndef MERT_TER_HASHMAP_INFOS_H_
#define MERT_TER_HASHMAP_INFOS_H_
#include "infosHasher.h"
#include <vector>
@ -39,4 +39,4 @@ public:
}
#endif // __HASHMAPINFOS_H__
#endif // MERT_TER_HASHMAP_INFOS_H_

View File

@ -1,8 +1,8 @@
/*
* Generic hashmap manipulation functions
*/
#ifndef __HASHMAPSTRINGINFOS_H__
#define __HASHMAPSTRINGINFOS_H__
#ifndef MERT_TER_HASHMAP_STRING_INFOS_H_
#define MERT_TER_HASHMAP_STRING_INFOS_H_
#include "stringInfosHasher.h"
#include <vector>
@ -39,4 +39,4 @@ public:
}
#endif // __HASHMAPSTRINGINFOS_H__
#endif // MERT_TER_HASHMAP_STRING_INFOS_H_

View File

@ -1,5 +1,5 @@
#ifndef __INFOSHASHER_H__
#define __INFOSHASHER_H__
#ifndef MERT_TER_INFO_SHASHER_H_
#define MERT_TER_INFO_SHASHER_H_
#include <string>
#include <stdio.h>
@ -28,4 +28,4 @@ public:
}
#endif // __INFOSHASHER_H__
#endif // MERT_TER_INFO_SHASHER_H_

View File

@ -1,5 +1,5 @@
#ifndef __STRINGHASHER_H__
#define __STRINGHASHER_H__
#ifndef MERT_TER_STRING_HASHER_H_
#define MERT_TER_STRING_HASHER_H_
#include <string>
#include <iostream>
@ -25,4 +25,4 @@ public:
}
#endif // __STRINGHASHER_H__
#endif // MERT_TER_STRING_HASHER_H_

View File

@ -1,5 +1,5 @@
#ifndef __STRINGINFOSHASHER_H__
#define __STRINGINFOSHASHER_H__
#ifndef MERT_TER_STRING_INFOS_HASHER_H_
#define MERT_TER_STRING_INFOS_HASHER_H_
#include <string>
#include <iostream>
@ -25,4 +25,4 @@ public:
}
#endif // __STRINGINFOSHASHER_H__
#endif // MERT_TER_STRING_INFOS_HASHER_H_

View File

@ -1,5 +1,5 @@
#ifndef __TERCPPTERALIGNMENT_H__
#define __TERCPPTERALIGNMENT_H__
#ifndef MERT_TER_TER_ALIGNMENT_H_
#define MERT_TER_TER_ALIGNMENT_H_
#include <vector>
#include <stdio.h>
@ -48,4 +48,4 @@ public:
}
#endif // __TERCPPTERALIGNMENT_H__
#endif // MERT_TER_TER_ALIGNMENT_H__

View File

@ -1,5 +1,5 @@
#ifndef __TERCPPTERSHIFT_H__
#define __TERCPPTERSHIFT_H__
#ifndef MERT_TER_TER_SHIFT_H_
#define MERT_TER_TER_SHIFT_H_
#include <vector>
#include <stdio.h>
@ -41,4 +41,4 @@ public:
}
#endif // __TERCPPTERSHIFT_H__
#endif // MERT_TER_TER_SHIFT_H_

View File

@ -1,5 +1,5 @@
#ifndef _TERCPPTERCALC_H___
#define _TERCPPTERCALC_H___
#ifndef MERT_TER_TER_CALC_H_
#define MERT_TER_TER_CALC_H_
#include <vector>
#include <stdio.h>
@ -79,4 +79,4 @@ public:
}
#endif // _TERCPPTERCALC_H___
#endif // MERT_TER_TER_CALC_H_

View File

@ -1,5 +1,5 @@
#ifndef __TERCPPTOOLS_H__
#define __TERCPPTOOLS_H__
#ifndef MERT_TER_TOOLS_H_
#define MERT_TER_TOOLS_H_
#include <vector>
#include <iostream>
@ -62,4 +62,4 @@ param copyParam(param p);
}
#endif // __TERCPPTOOLS_H__
#endif // MERT_TER_TOOLS_H_

View File

@ -5,8 +5,8 @@
#include <stdexcept>
#include "ScoreStats.h"
#include "TERsrc/tercalc.h"
#include "TERsrc/terAlignment.h"
#include "TER/tercalc.h"
#include "TER/terAlignment.h"
#include "Util.h"
using namespace TERCpp;

View File

@ -1,5 +1,5 @@
#ifndef __TERSCORER_H__
#define __TERSCORER_H__
#ifndef MERT_TER_SCORER_H_
#define MERT_TER_SCORER_H_
#include <iostream>
#include <set>
@ -54,4 +54,4 @@ private:
TerScorer& operator=(const TerScorer&);
};
#endif // __TERSCORER_H__
#endif // MERT_TER_SCORER_H_

View File

@ -1,5 +1,5 @@
#ifndef TIMER_H
#define TIMER_H
#ifndef MERT_TIMER_H_
#define MERT_TIMER_H_
#include <ctime>
#include <iostream>
@ -64,4 +64,4 @@ inline std::ostream& operator<<(std::ostream& os, Timer& t)
return os;
}
#endif // TIMER_H
#endif // MERT_TIMER_H_

View File

@ -1,5 +1,5 @@
#ifndef TYPE_H
#define TYPE_H
#ifndef MERT_TYPE_H_
#define MERT_TYPE_H_
#include <vector>
#include <map>
@ -40,4 +40,4 @@ typedef vector<ScoreArray> scoredata_t;
typedef map<size_t, std::string> idx2name;
typedef map<std::string, size_t> name2idx;
#endif // TYPE_H
#endif // MERT_TYPE_H_

View File

@ -6,8 +6,8 @@
*
*/
#ifndef UTIL_H
#define UTIL_H
#ifndef MERT_UTIL_H_
#define MERT_UTIL_H_
#include <cstdlib>
#include <stdexcept>
@ -100,4 +100,4 @@ void ResetUserTime();
void PrintUserTime(const std::string &message);
double GetUserTime();
#endif // UTIL_H
#endif // MERT_UTIL_H_

View File

@ -1,5 +1,5 @@
#ifndef _GZFILEBUF_H_
#define _GZFILEBUF_H_
#ifndef MERT_GZFILEBUF_H_
#define MERT_GZFILEBUF_H_
#include <streambuf>
#include <zlib.h>
@ -82,4 +82,4 @@ private:
char _buff[_buffsize];
};
#endif // _GZFILEBUF_H_
#endif // MERT_GZFILEBUF_H_