From 14a05845995550c15c8267a82750103c1149daac Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 20 Feb 2012 11:00:48 +0800 Subject: update phrase table headers --- src/storage/facade_phrase_table.h | 6 +++--- src/storage/phrase_large_table.h | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/storage/facade_phrase_table.h b/src/storage/facade_phrase_table.h index fadf03f..7ff3a70 100644 --- a/src/storage/facade_phrase_table.h +++ b/src/storage/facade_phrase_table.h @@ -58,7 +58,7 @@ public: } /* search method */ - int search(int phrase_length, /* in */ utf16_t phrase[], + int search(int phrase_length, /* in */ ucs4_t phrase[], /* out */ phrase_token_t & token){ int result = SEARCH_NONE; token = null_token; @@ -74,14 +74,14 @@ public: } /* add/remove index method */ - int add_index(int phrase_length, /* in */ utf16_t phrase[], + int add_index(int phrase_length, /* in */ ucs4_t phrase[], /* in */ phrase_token_t token) { assert(NULL != m_user_phrase_table); return m_user_phrase_table->add_index (phrase_length, phrase, token); } - int remove_index(int phrase_length, /* in */ utf16_t phrase[], + int remove_index(int phrase_length, /* in */ ucs4_t phrase[], /* out */ phrase_token_t & token){ assert(NULL != m_user_phrase_table); return m_user_phrase_table->remove_index diff --git a/src/storage/phrase_large_table.h b/src/storage/phrase_large_table.h index be8ed04..1b51c62 100644 --- a/src/storage/phrase_large_table.h +++ b/src/storage/phrase_large_table.h @@ -28,14 +28,14 @@ namespace pinyin{ -const size_t PHRASE_NUMBER_OF_BITMAP_INDEX = 1<<(sizeof(utf16_t) * 8); +const size_t PHRASE_NUMBER_OF_BITMAP_INDEX = 1<<(sizeof(ucs4_t) / 2 * 8); class PhraseLengthIndexLevel; class PhraseBitmapIndexLevel{ protected: PhraseLengthIndexLevel * m_phrase_length_indexes[PHRASE_NUMBER_OF_BITMAP_INDEX]; - //shift one utf16_t for class PhraseLengthIndexLevel, just like PinyinLengthIndexLevel. + /* shift a half ucs4_t for class PhraseLengthIndexLevel, just like PinyinLengthIndexLevel. */ void reset(); public: PhraseBitmapIndexLevel(); @@ -48,11 +48,11 @@ public: bool store(MemoryChunk * new_chunk, table_offset_t offset, table_offset_t & end); /* search/add_index/remove_index method */ - int search( int phrase_length, /* in */ utf16_t phrase[], + int search( int phrase_length, /* in */ ucs4_t phrase[], /* out */ phrase_token_t & token); - int add_index( int phrase_length, /* in */ utf16_t phrase[], /* in */ phrase_token_t token); - int remove_index( int phrase_length, /* in */ utf16_t phrase[], /* out */ phrase_token_t & token); + int add_index( int phrase_length, /* in */ usc4_t phrase[], /* in */ phrase_token_t token); + int remove_index( int phrase_length, /* in */ ucs4_t phrase[], /* out */ phrase_token_t & token); }; class PhraseLargeTable{ @@ -90,16 +90,16 @@ public: bool load_text(FILE * file); /* search/add_index/remove_index method */ - int search( int phrase_length, /* in */ utf16_t phrase[], + int search( int phrase_length, /* in */ usc4_t phrase[], /* out */ phrase_token_t & token){ return m_bitmap_table.search(phrase_length, phrase, token); } - int add_index( int phrase_length, /* in */ utf16_t phrase[], /* in */ phrase_token_t token){ + int add_index( int phrase_length, /* in */ ucs4_t phrase[], /* in */ phrase_token_t token){ return m_bitmap_table.add_index(phrase_length, phrase, token); } - int remove_index( int phrase_length, /* in */ utf16_t phrase[], /* out */ phrase_token_t & token){ + int remove_index( int phrase_length, /* in */ ucs4_t phrase[], /* out */ phrase_token_t & token){ return m_bitmap_table.remove_index(phrase_length, phrase, token); } }; -- cgit