diff options
author | Peng Wu <alexepico@gmail.com> | 2011-11-15 11:28:22 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-11-15 11:28:22 +0800 |
commit | aa88ca0ec666553b1a79b632ecaf9ef32049840f (patch) | |
tree | 16e56e346bc014bcf18c63bc81a3f03ba079fdcd /src/storage | |
parent | 8919f4c989c55e52ae6a18bfc4e1e4a1ed35d48b (diff) | |
download | libpinyin-aa88ca0ec666553b1a79b632ecaf9ef32049840f.tar.gz libpinyin-aa88ca0ec666553b1a79b632ecaf9ef32049840f.tar.xz libpinyin-aa88ca0ec666553b1a79b632ecaf9ef32049840f.zip |
refine pinyin parser2
Diffstat (limited to 'src/storage')
-rw-r--r-- | src/storage/pinyin_parser2.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/storage/pinyin_parser2.h b/src/storage/pinyin_parser2.h index 524340e..588a4f1 100644 --- a/src/storage/pinyin_parser2.h +++ b/src/storage/pinyin_parser2.h @@ -88,7 +88,7 @@ public: * * @return the number of chars were actually used. */ - virtual int parse_one_key (guint32 options, ChewingKey &key, const char *str, int len) const = 0; + virtual int parse_one_key (guint32 options, ChewingKey & key, ChewingKeyRest & key_rest, const char *str, int len) const = 0; /** * @brief Translate the source string into a set of ChewingKeys. @@ -103,7 +103,7 @@ public: /* Note: * the parse method will use dynamic programming to drive parse_one_key. */ - virtual int parse (guint32 options, ChewingKeyVector & keys, ChewingKeyRestVector & rests, const char *str, int len) const = 0; + virtual int parse (guint32 options, ChewingKeyVector & keys, ChewingKeyRestVector & key_rests, const char *str, int len) const = 0; }; @@ -118,7 +118,9 @@ class FullPinyinParser2 : public PinyinParser2 public: virtual ~FullPinyinParser2 () {} - virtual int parse_one_key (guint32 options, ChewingKey &key, const char *str, int len) const; + virtual int parse_one_key (guint32 options, ChewingKey & key, ChewingKeyRest & key_rest, const char *str, int len) const; + + virtual int parse (guint32 options, ChewingKeyVector & keys, ChewingKeyRestVector & key_rests, const char *str, int len) const; }; @@ -131,7 +133,9 @@ class DoublePinyinParser2 : public PinyinParser2 public: virtual ~DoublePinyinParser2 () {} - virtual int parse_one_key (guint32 options, ChewingKey &key, const char *str, int len) const; + virtual int parse_one_key (guint32 options, ChewingKey & key, ChewingKeyRest & key_rest, const char *str, int len) const; + + virtual int parse (guint32 options, ChewingKeyVector & keys, ChewingKeyRestVector & key_rests, const char *str, int len) const; public: bool set_scheme (DoublePinyinScheme scheme); @@ -156,7 +160,9 @@ class ChewingParser2 : public PinyinParser2 public: virtual ~ChewingParser2 () {} - virtual int parse_one_key (guint32 options, ChewingKey &key, const char *str, int len) const; + virtual int parse_one_key (guint32 options, ChewingKey & key, ChewingKeyRest & key_rest, const char *str, int len) const; + + virtual int parse (guint32 options, ChewingKeyVector & keys, ChewingKeyRestVector & key_rests, const char *str, int len) const; public: bool set_scheme (ChewingScheme scheme); |