diff options
author | Peng Wu <alexepico@gmail.com> | 2011-11-09 10:33:22 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-11-09 10:33:22 +0800 |
commit | 4fbe19e5eaeb4d1bdb509daafeedbf923438b1b7 (patch) | |
tree | 9a7e81b11b467a05c95e2df9a388f49deba3171c | |
parent | c389ac98652ac83bb3bbc16368fee799df3aef29 (diff) | |
download | libpinyin-4fbe19e5eaeb4d1bdb509daafeedbf923438b1b7.tar.gz libpinyin-4fbe19e5eaeb4d1bdb509daafeedbf923438b1b7.tar.xz libpinyin-4fbe19e5eaeb4d1bdb509daafeedbf923438b1b7.zip |
fixes pinyin parser table compile
-rw-r--r-- | scripts/pinyin_parser_table.h.in | 4 | ||||
-rw-r--r-- | scripts/pinyintable.py | 2 | ||||
-rw-r--r-- | src/storage/chewing_key.h | 10 | ||||
-rw-r--r-- | src/storage/pinyin_parser2.cpp | 1 | ||||
-rw-r--r-- | src/storage/pinyin_parser2.h | 3 |
5 files changed, 19 insertions, 1 deletions
diff --git a/scripts/pinyin_parser_table.h.in b/scripts/pinyin_parser_table.h.in index efd27cd..ae8093d 100644 --- a/scripts/pinyin_parser_table.h.in +++ b/scripts/pinyin_parser_table.h.in @@ -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 diff --git a/scripts/pinyintable.py b/scripts/pinyintable.py index 603159e..a825fea 100644 --- a/scripts/pinyintable.py +++ b/scripts/pinyintable.py @@ -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 diff --git a/src/storage/chewing_key.h b/src/storage/chewing_key.h index 970ed72..8234a4f 100644 --- a/src/storage/chewing_key.h +++ b/src/storage/chewing_key.h @@ -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 diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp index 7553ef6..0d68235 100644 --- a/src/storage/pinyin_parser2.cpp +++ b/src/storage/pinyin_parser2.cpp @@ -21,4 +21,5 @@ #include "pinyin_custom2.h" #include "chewing_key.h" +#include "pinyin_parser2.h" #include "pinyin_parser_table.h" diff --git a/src/storage/pinyin_parser2.h b/src/storage/pinyin_parser2.h index e2c09a8..c2702cd 100644 --- a/src/storage/pinyin_parser2.h +++ b/src/storage/pinyin_parser2.h @@ -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 |