diff options
author | Peng Wu <alexepico@gmail.com> | 2010-08-18 14:05:21 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2010-08-18 14:05:21 +0800 |
commit | ac7b8fa13887e0e663b515f40e4cbc7b2c2b9661 (patch) | |
tree | 9c1a73a1baee17f787f46b4af11a5874cfa32be3 /src | |
parent | a0412414b3b5f8647ff41405254dbcb4e334e3ae (diff) | |
download | libpinyin-ac7b8fa13887e0e663b515f40e4cbc7b2c2b9661.tar.gz libpinyin-ac7b8fa13887e0e663b515f40e4cbc7b2c2b9661.tar.xz libpinyin-ac7b8fa13887e0e663b515f40e4cbc7b2c2b9661.zip |
add retrieve_all defination.
Diffstat (limited to 'src')
-rwxr-xr-x | src/include/novel_types.h | 9 | ||||
-rw-r--r-- | src/storage/ngram.h | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/include/novel_types.h b/src/include/novel_types.h index 9265cfe..2d31039 100755 --- a/src/include/novel_types.h +++ b/src/include/novel_types.h @@ -103,7 +103,14 @@ struct BigramPhraseItem{ gfloat m_freq; /* P(W2|W1) */ }; -typedef GArray * BigramPhraseArray; /* Array of HighLevelPhraseItem */ +struct BigramPhraseItemWithCount{ + phrase_token_t m_token; + guint32 m_cout; + gfloat m_freq; /* P(W2|W1) */ +}; + +typedef GArray * BigramPhraseArray; /* Array of BigramPhraseItem */ +typedef GArray * BigramPhraseWithCountArray; /* Array of BigramPhraseItemWithCount */ /* * n-gram Definition diff --git a/src/storage/ngram.h b/src/storage/ngram.h index 7a723cd..42f7aaf 100644 --- a/src/storage/ngram.h +++ b/src/storage/ngram.h @@ -47,6 +47,9 @@ private: public: /* Null Constructor */ SingleGram(); + /* retrieve all items */ + bool retrieve_all(/* out */ BigramPhraseWithCountArray array); + /* search method */ /* the array result contains many items */ bool search(/* in */ PhraseIndexRange * range, |