diff --git a/src/Trie.hpp b/src/Trie.hpp index 55e118d..c88a4ef 100644 --- a/src/Trie.hpp +++ b/src/Trie.hpp @@ -62,7 +62,7 @@ namespace CppJieba return os << nodeInfo.word << ":" << nodeInfo.freq << ":" << nodeInfo.tag << ":" << nodeInfo.logFreq ; } - typedef unordered_map DagType; + typedef map DagType; class Trie { @@ -227,7 +227,7 @@ namespace CppJieba return !res.empty(); } - bool find(Unicode::const_iterator begin, Unicode::const_iterator end, uint offset, unordered_map & res) const + bool find(Unicode::const_iterator begin, Unicode::const_iterator end, uint offset, DagType & res) const { if(!_getInitFlag()) { diff --git a/test/unittest/TTrie.cpp b/test/unittest/TTrie.cpp index a8cbf8c..4645d91 100644 --- a/test/unittest/TTrie.cpp +++ b/test/unittest/TTrie.cpp @@ -22,8 +22,8 @@ TEST(TrieTest, Test1) EXPECT_EQ(nodeInfo, *trie.find(uni.begin(), uni.end())); word = "清华大学"; vector > res; - unordered_map resMap; - unordered_map map; + map resMap; + map map; const char * words[] = {"清", "清华", "清华大学"}; for(uint i = 0; i < sizeof(words)/sizeof(words[0]); i++) {