mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
add logerror
This commit is contained in:
parent
80f9d2ea4c
commit
bca6e7717f
@ -336,17 +336,20 @@ namespace CppJieba
|
||||
vector<string> vecBuf;
|
||||
|
||||
TrieNodeInfo nodeInfo;
|
||||
size_t lineno = 0;
|
||||
while(getline(ifs, line))
|
||||
{
|
||||
vecBuf.clear();
|
||||
lineno ++;
|
||||
split(line, vecBuf, " ");
|
||||
if(3 < vecBuf.size())
|
||||
{
|
||||
LogError("line[%s] illegal.", line.c_str());
|
||||
LogError("line[%u:%s] illegal.", lineno, line.c_str());
|
||||
return false;
|
||||
}
|
||||
if(!TransCode::decode(vecBuf[0], nodeInfo.word))
|
||||
{
|
||||
LogError("line[%u:%s] illegal.", lineno, line.c_str());
|
||||
return false;
|
||||
}
|
||||
nodeInfo.freq = atoi(vecBuf[1].c_str());
|
||||
|
Loading…
x
Reference in New Issue
Block a user