mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
add TrieNodeInfo's toString()
This commit is contained in:
parent
dc41068d58
commit
8e3c4eccbb
@ -26,6 +26,12 @@ namespace CppJieba
|
|||||||
TrieNodeInfo(const Unicode& _word):word(_word),freq(0),logFreq(MIN_DOUBLE)
|
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<uint, const TrieNodeInfo*> DagType;
|
typedef unordered_map<uint, const TrieNodeInfo*> DagType;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user