summaryrefslogtreecommitdiffstats
path: root/src/storage/pinyin_parser2.h
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-03-21 14:31:57 +0800
committerPeng Wu <alexepico@gmail.com>2012-03-21 14:40:29 +0800
commit224d3f608d3b1c89e9d120ee94544a4ff761a3fe (patch)
tree62317bc7190e8e76ac0df2e30b4872d7f921c2ef /src/storage/pinyin_parser2.h
parentda357461c31dc73724eaae962742a00c21bed2a4 (diff)
downloadlibpinyin-224d3f608d3b1c89e9d120ee94544a4ff761a3fe.tar.gz
libpinyin-224d3f608d3b1c89e9d120ee94544a4ff761a3fe.tar.xz
libpinyin-224d3f608d3b1c89e9d120ee94544a4ff761a3fe.zip
add comments
Diffstat (limited to 'src/storage/pinyin_parser2.h')
-rw-r--r--src/storage/pinyin_parser2.h55
1 files changed, 38 insertions, 17 deletions
diff --git a/src/storage/pinyin_parser2.h b/src/storage/pinyin_parser2.h
index 2ff46f3..269aa4c 100644
--- a/src/storage/pinyin_parser2.h
+++ b/src/storage/pinyin_parser2.h
@@ -85,37 +85,46 @@ typedef GArray * ParseValueVector;
/**
- * @brief Class to translate string into ChewingKey.
+ * PinyinParser2:
+ *
+ * Parse the ascii string into an array of the struct ChewingKeys.
+ *
*/
class PinyinParser2
{
- /* constructor/destructor */
public:
+ /**
+ * PinyinParser2::~PinyinParser2:
+ *
+ * The destructor of the PinyinParser2.
+ *
+ */
virtual ~PinyinParser2() {}
- /* public method */
public:
/**
- * @brief Translate only one ChewingKey from a string.
+ * PinyinParser2::parse_one_key:
+ * @options: the pinyin options from pinyin_custom2.h.
+ * @key: the parsed result of struct ChewingKey.
+ * @str: the input of the ascii string.
+ * @len: the length of the str.
+ * @returns: whether the entire string is parsed as one key.
*
- * @param options pinyin options from pinyin_custom2.h.
- * @param key stores result ChewingKey.
- * @param str snput string in UTF-8 encoding, in most case this string is just a plain ASCII string.
- * @param len the length of str, in number of chars rather than bytes.
+ * Parse only one struct ChewingKey from a string.
*
- * @return whether the entire string is parsed as one key.
*/
virtual bool parse_one_key(pinyin_option_t options, ChewingKey & key, const char *str, int len) const = 0;
/**
- * @brief Translate the source string into a set of ChewingKeys.
+ * PinyinParser2::parse:
+ * @options: the pinyin options from pinyin_custom2.h.
+ * @keys: the parsed result of struct ChewingKeys.
+ * @str: the input of the ascii string.
+ * @len: the length of str.
+ * @returns: the number of chars were actually used.
*
- * @param options pinyin options from pinyin_custom2.h.
- * @param keys stores result ChewingKeys.
- * @param str input string in UTF-8 encoding, in most case this string is just a plain ASCII string.
- * @param len the length of str, in number of chars rather than bytes.
+ * Parse the ascii string into an array of struct ChewingKeys.
*
- * @return the number of chars were actually used.
*/
virtual int parse(pinyin_option_t options, ChewingKeyVector & keys, ChewingKeyRestVector & key_rests, const char *str, int len) const = 0;
@@ -123,7 +132,10 @@ public:
/**
- * The Full Pinyin Parser which parses full pinyin string into ChewingKeys.
+ * FullPinyinParser2:
+ *
+ * Parses the full pinyin string into an array of struct ChewingKeys.
+ *
*/
class FullPinyinParser2 : public PinyinParser2
{
@@ -153,6 +165,12 @@ public:
};
+/**
+ * DoublePinyinParser2:
+ *
+ * Parse the double pinyin string into an array of struct ChewingKeys.
+ *
+ */
/* The valid input chars of ShuangPin is a-z and ';'
*/
class DoublePinyinParser2 : public PinyinParser2
@@ -180,13 +198,16 @@ public:
/**
- * @brief Class to parse Chewing input string
+ * ChewingParser2:
+ *
+ * Parse the chewing string into an array of struct ChewingKeys.
*
* Several keyboard scheme are supported:
* * Chewing_STANDARD Standard ZhuYin keyboard, which maps 1 to Bo(ㄅ), q to Po(ㄆ) etc.
* * Chewing_IBM IBM ZhuYin keyboard, which maps 1 to Bo(ㄅ), 2 to Po(ㄆ) etc.
* * Chewing_GINYIEH Gin-Yieh ZhuYin keyboard.
* * Chewing_ETEN Eten (倚天) ZhuYin keyboard.
+ *
*/
/* Note: maybe yunmus shuffle will be supported later.