mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
use InitOnOff
This commit is contained in:
parent
d5bb4e48ec
commit
41a33747f4
@ -20,18 +20,12 @@ namespace CppJieba
|
|||||||
// return os << keyword.word << "," << keyword.idf;
|
// return os << keyword.word << "," << keyword.idf;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
class KeywordExtractor
|
class KeywordExtractor: public InitOnOff
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
MPSegment _segment;
|
MPSegment _segment;
|
||||||
private:
|
private:
|
||||||
unordered_map<string, double> _idfMap;
|
unordered_map<string, double> _idfMap;
|
||||||
protected:
|
|
||||||
bool _isInited;
|
|
||||||
bool _getInitFlag()const{return _isInited;};
|
|
||||||
bool _setInitFlag(bool flag){return _isInited = flag;};
|
|
||||||
public:
|
|
||||||
operator bool(){return _getInitFlag();};
|
|
||||||
public:
|
public:
|
||||||
KeywordExtractor(){_setInitFlag(false);};
|
KeywordExtractor(){_setInitFlag(false);};
|
||||||
explicit KeywordExtractor(const string& dictPath, const string& idfPath){_setInitFlag(init(dictPath, idfPath));};
|
explicit KeywordExtractor(const string& dictPath, const string& idfPath){_setInitFlag(init(dictPath, idfPath));};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user