modify segment.cpp

This commit is contained in:
wyy 2013-12-04 08:39:47 -08:00
parent fd7ff031d0
commit 2641b1d0a3
2 changed files with 9 additions and 3 deletions

View File

@ -1,7 +1,7 @@
PROJECT(CPPJIEBA)
SET(CMAKE_INSTALL_PREFIX /usr)
ADD_DEFINITIONS(-std=c++0x -O3)
ADD_DEFINITIONS(-DCPPJIEBA_GBK)
#ADD_DEFINITIONS(-DCPPJIEBA_GBK)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(dicts)
ADD_SUBDIRECTORY(scripts)

View File

@ -17,8 +17,14 @@ void cut(const ISegment * seg, const char * const filePath)
if(!line.empty())
{
res.clear();
seg->cut(line, res);
cout<<join(res.begin(), res.end(),"/")<<endl;
if(!seg->cut(line, res))
{
LogError("seg cut failed.");
}
else
{
print(join(res.begin(), res.end(), "/"));
}
}
}
}