From 97807ae50bdeb9ae9222f415b32c0ff1424a7601 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Tue, 24 Sep 2013 15:53:42 +0800 Subject: begin to write ChewingDirectParser2 --- src/storage/pinyin_parser2.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/storage/pinyin_parser2.h b/src/storage/pinyin_parser2.h index 472ba5e..1cc6e2c 100644 --- a/src/storage/pinyin_parser2.h +++ b/src/storage/pinyin_parser2.h @@ -220,6 +220,23 @@ public: bool in_chewing_scheme(pinyin_option_t options, const char key, const char ** symbol) const; }; + +/* Direct Parser for Chewing table load. */ +class ChewingDirectParser2 : public PhoneticParser2 +{ + const chewing_index_item_t * m_chewing_index; + size_t m_chewing_index_len; + +public: + ChewingDirectParser2(); + + virtual ~ChewingDirectParser2() {} + + 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; +}; + /* compare pinyins with chewing internal representations. */ inline int pinyin_compare_initial2(pinyin_option_t options, ChewingInitial lhs, -- cgit