diff --git a/src/structs.h b/src/structs.h index e977021..2c01cef 100644 --- a/src/structs.h +++ b/src/structs.h @@ -26,6 +26,12 @@ namespace CppJieba TrieNodeInfo(const Unicode& _word):word(_word),freq(0),logFreq(MIN_DOUBLE) { } + string toString()const + { + string tmp; + TransCode::encode(word, tmp); + return string_format("{word:%s,freq:%d, logFreq:%lf}", tmp.c_str(), freq, logFreq); + } }; typedef unordered_map DagType;