mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
Merge branch 'dev' of github.com:aszxqw/cppjieba into dev
This commit is contained in:
commit
e6fde86be5
10
src/Trie.hpp
10
src/Trie.hpp
@ -30,9 +30,8 @@ namespace CppJieba
|
||||
struct TrieNode
|
||||
{
|
||||
TrieNodeMap hmap;
|
||||
bool isLeaf;
|
||||
const TrieNodeInfo * ptTrieNodeInfo;
|
||||
TrieNode(): isLeaf(false), ptTrieNodeInfo(NULL)
|
||||
TrieNode(): ptTrieNodeInfo(NULL)
|
||||
{}
|
||||
};
|
||||
|
||||
@ -107,12 +106,8 @@ namespace CppJieba
|
||||
}
|
||||
p = citer->second;
|
||||
}
|
||||
if(p->isLeaf)
|
||||
{
|
||||
return p->ptTrieNodeInfo;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool find(Unicode::const_iterator begin, Unicode::const_iterator end, DagType & res, size_t offset = 0) const
|
||||
{
|
||||
@ -126,7 +121,7 @@ namespace CppJieba
|
||||
break;
|
||||
}
|
||||
p = citer->second;
|
||||
if(p->isLeaf)
|
||||
if(p->ptTrieNodeInfo)
|
||||
{
|
||||
res[itr - begin + offset] = p->ptTrieNodeInfo;
|
||||
}
|
||||
@ -160,7 +155,6 @@ namespace CppJieba
|
||||
|
||||
}
|
||||
|
||||
ptNode->isLeaf = true;
|
||||
ptNode->ptTrieNodeInfo = &nodeInfo;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user