fixes code style
authorPeng Wu <alexepico@gmail.com>
Thu, 15 Dec 2011 05:36:02 +0000 (13:36 +0800)
committerPeng Wu <alexepico@gmail.com>
Thu, 15 Dec 2011 05:36:02 +0000 (13:36 +0800)
scripts/chewingkey.py
src/storage/chewing_large_table.cpp
src/storage/phrase_index.cpp

index 51c89ea..9551f66 100644 (file)
@@ -147,7 +147,4 @@ def gen_table_index(content_table):
 
 ### main function ###
 if __name__ == "__main__":
-    print(gen_initials())
-    print(gen_middles())
-    print(gen_finals())
-    print(gen_tones())
+    print(gen_initials() + gen_middles() + gen_finals() + gen_tones())
index cf527d8..93eacfe 100644 (file)
@@ -650,7 +650,8 @@ bool ChewingLargeTable::load_text(FILE * infile) {
         parser.parse(options, keys, key_rests, pinyin, strlen(pinyin));
 
         if (len != keys->len) {
-            fprintf(stderr, "%s\t%s\t%u\t%ld\n", pinyin, phrase, token, freq);
+            fprintf(stderr, "ChewingLargeTable::load_text:%s\t%s\t%u\t%ld\n",
+                    pinyin, phrase, token, freq);
             continue;
         }
 
index 9fec159..0dc66bd 100644 (file)
@@ -476,8 +476,12 @@ bool FacadePhraseIndex::load_text(guint8 phrase_index, FILE * infile){
 
        parser.parse(options, keys, key_rests, pinyin, strlen(pinyin));
        
-       if (item_ptr->get_phrase_length() == keys->len)
+       if (item_ptr->get_phrase_length() == keys->len) {
             item_ptr->append_pronunciation((ChewingKey *)keys->data, freq);
+        } else {
+            fprintf(stderr, "FacadePhraseIndex::load_text:%s\t%s\n",
+                    pinyin, phrase);
+        }
 
        g_array_free(keys, TRUE);
        g_array_free(key_rests, TRUE);