diff options
Diffstat (limited to 'src/storage')
-rw-r--r-- | src/storage/facade_phrase_table3.h | 66 |
1 files changed, 62 insertions, 4 deletions
diff --git a/src/storage/facade_phrase_table3.h b/src/storage/facade_phrase_table3.h index bebbc73..90e2b1f 100644 --- a/src/storage/facade_phrase_table3.h +++ b/src/storage/facade_phrase_table3.h @@ -26,6 +26,13 @@ namespace pinyin{ +/** + * FacadePhraseTable3: + * + * The facade class of phrase large table3. + * + */ + class FacadePhraseTable3{ private: PhraseLargeTable3 * m_system_phrase_table; @@ -44,11 +51,23 @@ private: } public: + /** + * FacadePhraseTable3::FacadePhraseTable3: + * + * The constructor of the FacadePhraseTable3. + * + */ FacadePhraseTable3() { m_system_phrase_table = NULL; m_user_phrase_table = NULL; } + /** + * FacadePhraseTable3::~FacadePhraseTable3: + * + * The destructor of the FacadePhraseTable3. + * + */ ~FacadePhraseTable3() { reset(); } @@ -77,7 +96,17 @@ public: return m_user_phrase_table->store(new_user_index, new_user_content); } - int search(int phrase_length, /* in */ const ucs4_t phrase[], + /** + * FacadePhraseTable3::search: + * @phrase_length: the length of the phrase to be searched. + * @phrase: the ucs4 characters of the phrase to be searched. + * @tokens: the GArray of tokens to store the matched phrases. + * @returns: the search result of enum SearchResult. + * + * Search the phrase tokens according to the ucs4 characters. + * + */ + int search(int phrase_length, /* in */ const ucs4_t phrase[], /* out */ PhraseTokens tokens) const { /* clear tokens. */ for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) { @@ -98,7 +127,17 @@ public: return result; } - int add_index(int phrase_length, /* in */ const ucs4_t phrase[], + /** + * FacadePhraseTable3::add_index: + * @phrase_length: the length of the phrase to be added. + * @phrase: the ucs4 characters of the phrase to be added. + * @token: the token of the phrase to be added. + * @returns: the add result of enum ErrorResult. + * + * Add the phrase token to the user phrase table. + * + */ + int add_index(int phrase_length, /* in */ const ucs4_t phrase[], /* in */ phrase_token_t token) { if (NULL == m_user_phrase_table) return ERROR_NO_USER_TABLE; @@ -107,7 +146,17 @@ public: (phrase_length, phrase, token); } - int remove_index(int phrase_length, /* in */ const ucs4_t phrase[], + /** + * FacadePhraseTable3::remove_index: + * @phrase_length: the length of the phrase to be removed. + * @phrase: the ucs4 characters of the phrase to be removed. + * @token: the token of the phrase to be removed. + * @returns: the remove result of enum ErrorResult. + * + * Remove the phrase token from the user phrase table. + * + */ + int remove_index(int phrase_length, /* in */ const ucs4_t phrase[], /* in */ phrase_token_t token) { if (NULL == m_user_phrase_table) return ERROR_NO_USER_TABLE; @@ -116,7 +165,16 @@ public: (phrase_length, phrase, token); } - bool mask_out(phrase_token_t mask, phrase_token_t value) { + /** + * FacadePhraseTable3::mask_out: + * @mask: the mask. + * @value: the value. + * @returns: whether the mask out operation is successful. + * + * Mask out the matched phrase index. + * + */ + bool mask_out(phrase_token_t mask, phrase_token_t value) { if (NULL == m_user_phrase_table) return false; |