summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-02-20 11:00:48 +0800
committerPeng Wu <alexepico@gmail.com>2012-02-20 11:00:48 +0800
commit14a05845995550c15c8267a82750103c1149daac (patch)
tree9e924ad6299aac8d8dc221820eca67bc00e6bdd6
parent036cd24c064bac2b3a5d7e8e92c3bb34f376f353 (diff)
downloadlibpinyin-14a05845995550c15c8267a82750103c1149daac.zip
libpinyin-14a05845995550c15c8267a82750103c1149daac.tar.gz
libpinyin-14a05845995550c15c8267a82750103c1149daac.tar.xz
update phrase table headers
-rw-r--r--src/storage/facade_phrase_table.h6
-rw-r--r--src/storage/phrase_large_table.h16
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);
}
};