From a6faf599aeda7ce8ee3975c382b293faafd7d627 Mon Sep 17 00:00:00 2001 From: gwdwyy Date: Thu, 11 Jul 2013 16:02:25 +0800 Subject: [PATCH] remove Segment.init bug --- src/Segment.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Segment.cpp b/src/Segment.cpp index ade1058..5a38017 100644 --- a/src/Segment.cpp +++ b/src/Segment.cpp @@ -12,9 +12,11 @@ namespace CppJieba bool Segment::init(const char* const dictFilePath) { + bool retFlag; LogInfo(string_format("_trie.init(%s) start...", dictFilePath)); - _trie.init(dictFilePath); + retFlag = _trie.init(dictFilePath); LogInfo("_trie.init end."); + return retFlag; } bool Segment::destroy() @@ -327,7 +329,11 @@ using namespace CppJieba; int main() { Segment segment; - segment.init("dicts/segdict.utf8.v2.1"); + if(!segment.init("../dicts/segdict.utf8.v2.1")) + { + cerr<<"1"< res;