fixed the bug in the last commit

This commit is contained in:
yanyiwu 2015-09-13 16:18:48 +08:00
parent 28bcb3bf57
commit e9241d9025
2 changed files with 1 additions and 3 deletions

View File

@ -17,6 +17,7 @@ using namespace limonp;
class SegmentBase: public ISegment {
public:
SegmentBase() {
LoadSpecialSymbols();
}
virtual ~SegmentBase() {
}
@ -65,8 +66,6 @@ class SegmentBase: public ISegment {
res.resize(res.size() + uRes.size());
for(size_t i = 0; i < uRes.size(); i ++, offset++) {
TransCode::encode(uRes[i], res[offset]);
cout << __FILE__ << __LINE__ << endl;
cout << res[offset] << endl;
}
}
private:

View File

@ -18,7 +18,6 @@ TEST(MixSegmentTest, Test1) {
const char* res2[] = {"B超"," ", "T恤"};
vector<string> words;
ASSERT_TRUE(segment.cut(str, words));
cout << words << endl;
ASSERT_EQ(words, vector<string>(res, res + sizeof(res)/sizeof(res[0])));
ASSERT_TRUE(segment.cut(str2, words));
ASSERT_EQ(words, vector<string>(res2, res2 + sizeof(res2)/sizeof(res2[0])));