summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2016-07-11 13:06:10 +0800
committerPeng Wu <alexepico@gmail.com>2016-07-11 13:06:10 +0800
commit1847e018aff8c4bfe69e4ac73841ba20fed89999 (patch)
tree016380dbf3f9fe2bf0d46c300763442200ba8752
parent3eec489d3c827dc3c7275418fbb0c1f84a5164ad (diff)
downloadlibpinyin-1847e018aff8c4bfe69e4ac73841ba20fed89999.tar.gz
libpinyin-1847e018aff8c4bfe69e4ac73841ba20fed89999.tar.xz
libpinyin-1847e018aff8c4bfe69e4ac73841ba20fed89999.zip
add comments
-rw-r--r--src/pinyin.cpp5
-rw-r--r--src/pinyin_internal.cpp4
-rw-r--r--src/storage/phonetic_key_matrix.cpp1
3 files changed, 9 insertions, 1 deletions
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) {