diff options
Diffstat (limited to 'src/storage/pinyin_parser2.h')
-rw-r--r-- | src/storage/pinyin_parser2.h | 153 |
1 files changed, 0 insertions, 153 deletions
diff --git a/src/storage/pinyin_parser2.h b/src/storage/pinyin_parser2.h index 4a80495..0135409 100644 --- a/src/storage/pinyin_parser2.h +++ b/src/storage/pinyin_parser2.h @@ -247,159 +247,6 @@ public: }; -/** - * ZhuyinParser2: - * - * Parse the chewing input string into an array of struct ChewingKeys. - * - */ -class ZhuyinParser2 : public PhoneticParser2 -{ -public: - virtual ~ZhuyinParser2() {} - -public: - /** - * ZhuyinParser2::in_chewing_scheme: - * @options: the pinyin options. - * @key: the user input ascii character. - * @symbol: the corresponding chewing symbol. - * @returns: whether the character is in the chewing scheme. - * - * Check whether the input character is in the chewing keyboard mapping. - * - */ - virtual bool in_chewing_scheme(pinyin_option_t options, const char key, gchar ** & symbols) const = 0; -}; - - - /** - * ZhuyinSimpleParser2: - * - * Parse the chewing string into an array of struct ChewingKeys. - * - * Several keyboard scheme are supported: - * * ZHUYIN_STANDARD Standard ZhuYin keyboard, which maps 1 to Bo(ㄅ), q to Po(ㄆ) etc. - * * ZHUYIN_IBM IBM ZhuYin keyboard, which maps 1 to Bo(ㄅ), 2 to Po(ㄆ) etc. - * * ZHUYIN_GINYIEH Gin-Yieh ZhuYin keyboard. - * * ZHUYIN_ETEN Eten (倚天) ZhuYin keyboard. - * * ZHUYIN_STANDARD_DVORAK Standard Dvorak ZhuYin keyboard - * - */ - -class ZhuyinSimpleParser2 : public ZhuyinParser2 -{ - /* internal options for chewing parsing. */ - pinyin_option_t m_options; - - /* Note: some internal pointers to chewing scheme table. */ -protected: - const zhuyin_symbol_item_t * m_symbol_table; - const zhuyin_tone_item_t * m_tone_table; - -public: - ZhuyinSimpleParser2() { - m_symbol_table = NULL; m_tone_table = NULL; - set_scheme(ZHUYIN_DEFAULT); - } - - virtual ~ZhuyinSimpleParser2() {} - - virtual bool parse_one_key(pinyin_option_t options, ChewingKey & key, const char *str, int len) const; - - virtual int parse(pinyin_option_t options, ChewingKeyVector & keys, ChewingKeyRestVector & key_rests, const char *str, int len) const; - -public: - bool set_scheme(ZhuyinScheme scheme); - virtual bool in_chewing_scheme(pinyin_option_t options, const char key, gchar ** & symbols) const; -}; - - -/** - * ZhuyinDiscreteParser2: - * - * Parse the chewing string into an array of struct ChewingKeys. - * - * Initially will support HSU, HSU Dvorak and ETEN26. - * - */ - -class ZhuyinDiscreteParser2 : public ZhuyinParser2 -{ -protected: - /* internal options for chewing parsing. */ - pinyin_option_t m_options; - - /* some internal pointers to chewing scheme table. */ - const chewing_index_item_t * m_chewing_index; - size_t m_chewing_index_len; - const zhuyin_symbol_item_t * m_initial_table; - const zhuyin_symbol_item_t * m_middle_table; - const zhuyin_symbol_item_t * m_final_table; - const zhuyin_tone_item_t * m_tone_table; - -public: - ZhuyinDiscreteParser2() { - m_options = 0; - m_chewing_index = NULL; m_chewing_index_len = 0; - m_initial_table = NULL; m_middle_table = NULL; - m_final_table = NULL; m_tone_table = NULL; - set_scheme(ZHUYIN_HSU); - } - - virtual ~ZhuyinDiscreteParser2() {} - - virtual bool parse_one_key(pinyin_option_t options, ChewingKey & key, const char *str, int len) const; - - virtual int parse(pinyin_option_t options, ChewingKeyVector & keys, ChewingKeyRestVector & key_rests, const char *str, int len) const; - -public: - bool set_scheme(ZhuyinScheme scheme); - virtual bool in_chewing_scheme(pinyin_option_t options, const char key, gchar ** & symbols) const; -}; - - -class ZhuyinDaChenCP26Parser2 : public ZhuyinParser2 -{ - /* some internal pointers to chewing scheme table. */ - const chewing_index_item_t * m_chewing_index; - size_t m_chewing_index_len; - const zhuyin_symbol_item_t * m_initial_table; - const zhuyin_symbol_item_t * m_middle_table; - const zhuyin_symbol_item_t * m_final_table; - const zhuyin_tone_item_t * m_tone_table; - -public: - ZhuyinDaChenCP26Parser2(); - - virtual ~ZhuyinDaChenCP26Parser2() {} - - virtual bool parse_one_key(pinyin_option_t options, ChewingKey & key, const char *str, int len) const; - - virtual int parse(pinyin_option_t options, ChewingKeyVector & keys, ChewingKeyRestVector & key_rests, const char *str, int len) const; - -public: - virtual bool in_chewing_scheme(pinyin_option_t options, const char key, gchar ** & symbols) const; -}; - - -/* Direct Parser for Zhuyin table load. */ -class ZhuyinDirectParser2 : public PhoneticParser2 -{ - const chewing_index_item_t * m_chewing_index; - size_t m_chewing_index_len; - -public: - ZhuyinDirectParser2(); - - virtual ~ZhuyinDirectParser2() {} - - virtual bool parse_one_key(pinyin_option_t options, ChewingKey & key, const char *str, int len) const; - - virtual int parse(pinyin_option_t options, ChewingKeyVector & keys, ChewingKeyRestVector & key_rests, const char *str, int len) const; -}; - - }; #endif |