Merge branch 'dev' of github.com:aszxqw/cppjieba into dev

This commit is contained in:
wyy 2014-04-10 02:59:40 -07:00
commit e6fde86be5

View File

@ -30,9 +30,8 @@ namespace CppJieba
struct TrieNode
{
TrieNodeMap hmap;
bool isLeaf;
const TrieNodeInfo * ptTrieNodeInfo;
TrieNode(): isLeaf(false), ptTrieNodeInfo(NULL)
TrieNode(): ptTrieNodeInfo(NULL)
{}
};
@ -107,11 +106,7 @@ namespace CppJieba
}
p = citer->second;
}
if(p->isLeaf)
{
return p->ptTrieNodeInfo;
}
return NULL;
return p->ptTrieNodeInfo;
}
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;
}