summaryrefslogtreecommitdiffstats
path: root/src/storage/ngram.h
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2015-04-09 16:13:33 +0800
committerPeng Wu <alexepico@gmail.com>2015-04-09 16:13:33 +0800
commitb77d7fb0df28c02389f873717a7557bb7fba62a1 (patch)
tree451cae296ca9d900f7c5c70130708ad98646e4a4 /src/storage/ngram.h
parent941d6c364906a932b4f2874177962e50188e38de (diff)
downloadlibpinyin-b77d7fb0df28c02389f873717a7557bb7fba62a1.tar.gz
libpinyin-b77d7fb0df28c02389f873717a7557bb7fba62a1.tar.xz
libpinyin-b77d7fb0df28c02389f873717a7557bb7fba62a1.zip
continue to re-factor Bigram
Diffstat (limited to 'src/storage/ngram.h')
-rw-r--r--src/storage/ngram.h20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/storage/ngram.h b/src/storage/ngram.h
index e4045a9..e0aee0b 100644
--- a/src/storage/ngram.h
+++ b/src/storage/ngram.h
@@ -117,7 +117,7 @@ public:
*
*/
bool get_freq(/* in */ phrase_token_t token,
- /* out */ guint32 & freq) const;
+ /* out */ guint32 & freq) const;
/**
* SingleGram::set_freq:
@@ -129,7 +129,7 @@ public:
*
*/
bool set_freq(/* in */ phrase_token_t token,
- /* in */ guint32 freq);
+ /* in */ guint32 freq);
/**
* SingleGram::get_total_freq:
@@ -192,13 +192,7 @@ class Bigram{
private:
DB * m_db;
- void reset(){
- if ( m_db ){
- m_db->sync(m_db, 0);
- m_db->close(m_db, 0);
- m_db = NULL;
- }
- }
+ void reset();
public:
/**
@@ -207,9 +201,7 @@ public:
* The constructor of the Bigram.
*
*/
- Bigram(){
- m_db = NULL;
- }
+ Bigram();
/**
* Bigram::~Bigram:
@@ -217,9 +209,7 @@ public:
* The destructor of the Bigram.
*
*/
- ~Bigram(){
- reset();
- }
+ ~Bigram();
/**
* Bigram::load_db: