summaryrefslogtreecommitdiffstats
path: root/src/storage/phrase_index.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-08-18 15:56:12 +0800
committerPeng Wu <alexepico@gmail.com>2011-08-18 15:56:12 +0800
commit30283199261a82a3807342d61ab36e8103f04063 (patch)
treea39e5e40ad70db26dda0010e5226568d7b8a093c /src/storage/phrase_index.cpp
parent05f2dbbd28982192545fcfb2f38479d560987a90 (diff)
downloadlibpinyin-30283199261a82a3807342d61ab36e8103f04063.tar.gz
libpinyin-30283199261a82a3807342d61ab36e8103f04063.tar.xz
libpinyin-30283199261a82a3807342d61ab36e8103f04063.zip
write get candidates
Diffstat (limited to 'src/storage/phrase_index.cpp')
-rw-r--r--src/storage/phrase_index.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/storage/phrase_index.cpp b/src/storage/phrase_index.cpp
index 4e1eb70..5517169 100644
--- a/src/storage/phrase_index.cpp
+++ b/src/storage/phrase_index.cpp
@@ -456,6 +456,18 @@ bool FacadePhraseIndex::load_text(guint8 phrase_index, FILE * infile){
return true;
}
+int FacadePhraseIndex::get_sub_phrase_range(guint8 & min_index,
+ guint8 & max_index){
+ min_index = PHRASE_INDEX_LIBRARY_COUNT; max_index = 0;
+ for ( guint8 i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i ){
+ if ( m_sub_phrase_indices[i] ) {
+ min_index = std_lite::min(min_index, i);
+ max_index = std_lite::max(max_index, i);
+ }
+ }
+ return ERROR_OK;
+}
+
int FacadePhraseIndex::get_range(guint8 phrase_index, /* out */ PhraseIndexRange & range){
SubPhraseIndex * sub_phrase = m_sub_phrase_indices[phrase_index];
if ( !sub_phrase )