fixes pinyin parser table compile
authorPeng Wu <alexepico@gmail.com>
Wed, 9 Nov 2011 02:33:22 +0000 (10:33 +0800)
committerPeng Wu <alexepico@gmail.com>
Wed, 9 Nov 2011 02:33:22 +0000 (10:33 +0800)
scripts/pinyin_parser_table.h.in
scripts/pinyintable.py
src/storage/chewing_key.h
src/storage/pinyin_parser2.cpp
src/storage/pinyin_parser2.h

index efd27cd..ae8093d 100644 (file)
@@ -4,6 +4,8 @@
 #ifndef PINYIN_PARSER_TABLE_H
 #define PINYIN_PARSER_TABLE_H
 
+namespace pinyin{
+
 const pinyin_index_item_t pinyin_index[] = {
 @PINYIN_INDEX@
 };
@@ -24,4 +26,6 @@ const resplit_table_item_t resplit_table[] = {
 @RESPLIT_TABLE@
 };
 
+};
+
 #endif
index 603159e..a825fea 100644 (file)
@@ -117,7 +117,7 @@ def get_shengmu_chewing(shengmu):
         initial = chewing_key
     else:
         initial = 'PINYIN_{0}'.format(shengmu.upper())
-    return initial, "CHEWING_ZREO_MIDDLE", "CHEWING_ZERO_FINAL"
+    return initial, "CHEWING_ZERO_MIDDLE", "CHEWING_ZERO_FINAL"
 
 def gen_shengmu():
     #generate all shengmu
index 970ed72..8234a4f 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef CHEWING_KEY_H
 #define CHEWING_KEY_H
 
+#include <glib.h>
+
 /** @file chewing_key.h
  *  @brief the definitions of chewing key related classes and structs.
  */
@@ -137,6 +139,14 @@ struct ChewingKey
         m_final   = CHEWING_ZERO_FINAL;
         m_tone    = CHEWING_ZERO_TONE;
     }
+
+    ChewingKey(ChewingInitial initial, ChewingMiddle middle,
+               ChewingFinal final) {
+        m_initial = initial;
+        m_middle = middle;
+        m_final = final;
+        m_tone = CHEWING_ZERO_TONE;
+    }
 };
 
 struct ChewingKeyRest
index 7553ef6..0d68235 100644 (file)
@@ -21,4 +21,5 @@
 
 #include "pinyin_custom2.h"
 #include "chewing_key.h"
+#include "pinyin_parser2.h"
 #include "pinyin_parser_table.h"
index e2c09a8..c2702cd 100644 (file)
@@ -24,6 +24,8 @@
 
 #include "chewing_key.h"
 
+namespace pinyin{
+
 typedef struct {
     const char * m_pinyin_str;
     const char * m_chewing_str;
@@ -57,4 +59,5 @@ typedef struct {
     gfloat       m_benefit;
 } resplit_table_item_t;
 
+};
 #endif