From 1847e018aff8c4bfe69e4ac73841ba20fed89999 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 11 Jul 2016 13:06:10 +0800 Subject: add comments --- src/pinyin.cpp | 5 +++++ src/pinyin_internal.cpp | 4 +++- src/storage/phonetic_key_matrix.cpp | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pinyin.cpp b/src/pinyin.cpp index 8153e37..c15e38b 100644 --- a/src/pinyin.cpp +++ b/src/pinyin.cpp @@ -2334,6 +2334,8 @@ static size_t _compute_zero_start(PhoneticKeyMatrix & matrix, size_t offset) { return offset; } +/* when lookup offset: + get the previous non-zero ChewingKey, then the first zero ChewingKey. */ bool pinyin_get_pinyin_offset(pinyin_instance_t * instance, size_t cursor, size_t * poffset) { @@ -2468,6 +2470,9 @@ bool pinyin_get_phrase_token(pinyin_instance_t * instance, return true; } +/* for auxiliary text: + use slow string concatenation, + and show the first ChewingKey and ChewingKeyRest together. */ static gchar * _get_aux_text_prefix(pinyin_instance_t * instance, size_t cursor, pinyin_option_t options) { diff --git a/src/pinyin_internal.cpp b/src/pinyin_internal.cpp index 7415ac8..5e0e190 100644 --- a/src/pinyin_internal.cpp +++ b/src/pinyin_internal.cpp @@ -1,7 +1,9 @@ #include "pinyin_internal.h" -/* deprecated headers, just keep it here for compiling. */ +/* deprecated headers: + * ChewingLargeTable and PhraseLargeTable2. + * just keep it here for compiling and compatibility. */ #include "chewing_large_table.h" #include "phrase_large_table2.h" #include "facade_chewing_table.h" diff --git a/src/storage/phonetic_key_matrix.cpp b/src/storage/phonetic_key_matrix.cpp index 856738f..66a1d4b 100644 --- a/src/storage/phonetic_key_matrix.cpp +++ b/src/storage/phonetic_key_matrix.cpp @@ -27,6 +27,7 @@ namespace pinyin{ +/* zero ChewingKey for "'" symbol and last key in fill_matrix function. */ bool fill_matrix(PhoneticKeyMatrix * matrix, ChewingKeyVector keys, ChewingKeyRestVector key_rests) { -- cgit