From 1169521c428053b5520cf1b66f8f5344c3baf1f8 Mon Sep 17 00:00:00 2001 From: wyy Date: Sat, 7 Dec 2013 08:05:05 -0800 Subject: [PATCH] modify calcDAG to speed up --- src/MPSegment.hpp | 15 --------------- test/test_performance.cpp | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/MPSegment.hpp b/src/MPSegment.hpp index e195b9a..288353f 100644 --- a/src/MPSegment.hpp +++ b/src/MPSegment.hpp @@ -157,25 +157,10 @@ namespace CppJieba LogError("begin >= end."); return false; } - for(Unicode::const_iterator it = begin; it != end; it++) - { - segContext.push_back(SegmentChar(*it)); - } vector > vp; - //for(Unicode::const_iterator it = begin; it != end; it++) - //{ - // segContext.push_back(SegmentChar(*it)); - //} for(Unicode::const_iterator it = begin; it != end; it++) - //for(uint i = 0; i < segContext.size(); i++) { - //unicode.clear(); - //for(uint j = i; j < segContext.size(); j++) - //{ - // unicode.push_back(segContext[j].uniCh); - //} - segContext.push_back(SegmentChar(*it)); SegmentChar& back = segContext.back(); int i = it - begin; diff --git a/test/test_performance.cpp b/test/test_performance.cpp index a9a5fb5..2cefdea 100644 --- a/test/test_performance.cpp +++ b/test/test_performance.cpp @@ -47,7 +47,7 @@ int main(int argc, char ** argv) // seg.dispose(); //} { - MPSegment seg("../dicts/jieba.dict.utf8"); + MixSegment seg("../dicts/jieba.dict.utf8", "../dicts/hmm_model.utf8"); if(!seg.init()) { cout<<"seg init failed."<