diff --git a/Segment.cpp b/Segment.cpp new file mode 100644 index 0000000..18647c6 --- /dev/null +++ b/Segment.cpp @@ -0,0 +1,41 @@ +#include "Segment.h" + +namespace CppJieba +{ + Segment::Segment():_trie() + { + } + + Segment::~Segment() + { + } + + bool Segment::init(const char* const dictFilePath) + { + _trie.init(dictFilePath); + } + + bool Segment::destroy() + { + return _trie.destroy(); + } + + bool Segment::cutRMM(const string& chStr, vector& res) + { + return false; + } +} + + +#ifdef SEGMENT_UT +using namespace CppJieba; + +int main() +{ + Segment segment; + segment.init("dict.utf8"); + segment.destroy(); + return 0; +} + +#endif diff --git a/Segment.h b/Segment.h new file mode 100644 index 0000000..286c91e --- /dev/null +++ b/Segment.h @@ -0,0 +1,23 @@ +#ifndef SEGMENT_H +#define SEGMENT_H + +#include "Trie.h" + +namespace CppJieba +{ + class Segment + { + private: + Trie _trie; + public: + Segment(); + ~Segment(); + public: + bool init(const char* const dictFilePath); + bool destroy(); + public: + bool cutRMM(const string& chStr, vector& res); + }; +} + +#endif