36 #ifndef RERANKER_STRING_CANONICALIZER_H_
37 #define RERANKER_STRING_CANONICALIZER_H_
41 #include <unordered_set>
43 #define STR_CANON_DEBUG 1
50 using std::unordered_set;
59 static const string &
Get(
const string &s) {
60 unordered_set<string>::const_iterator it = canonical_.find(s);
61 if (it == canonical_.end()) {
72 cerr <<
"StringCanonicalizer: clearing out canonical map of size "
73 << canonical_.size() << endl;
79 static unordered_set<string> canonical_;
static const string & Get(const string &s)
Returns the canonical string for the specified string.
A class that stores a canonical version of string objects in a static data structure.
static void Clear()
Clears the strings from the internal data structure.