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;
|
||||
//}
|
||||
|
||||
class KeywordExtractor
|
||||
class KeywordExtractor: public InitOnOff
|
||||
{
|
||||
private:
|
||||
MPSegment _segment;
|
||||
private:
|
||||
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:
|
||||
KeywordExtractor(){_setInitFlag(false);};
|
||||
explicit KeywordExtractor(const string& dictPath, const string& idfPath){_setInitFlag(init(dictPath, idfPath));};
|
||||
|
Loading…
x
Reference in New Issue
Block a user