From f89cf005525434f8a2010b82e9fad8a811024ae8 Mon Sep 17 00:00:00 2001 From: wyy Date: Fri, 20 Dec 2013 08:57:10 -0800 Subject: [PATCH] init TfIdfKeyWord.hpp --- src/TfIdfKeyWord.hpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/TfIdfKeyWord.hpp diff --git a/src/TfIdfKeyWord.hpp b/src/TfIdfKeyWord.hpp new file mode 100644 index 0000000..c155af6 --- /dev/null +++ b/src/TfIdfKeyWord.hpp @@ -0,0 +1,32 @@ +#ifndef CPPJIEBA_TFIDF_H +#define CPPJIEBA_TFIDF_H + +#include "MPSegment.hpp" + +namespace CppJieba +{ + using namespace Limonp; + + class TfIdfKeyWord + { + private: + MPSegment _segment; + public: + TfIdfKeyWord(const char* dictFile): _segment(dictFile){}; + ~TfIdfKeyWord(){}; + public: + bool init(){return _segment.init();}; + bool dispose(){return _segment.dispose();}; + public: + bool extract(const string& str, vector& words, uint topN) + { + return _segment.cut(words); + return true; + } + + }; +} + +#endif + +