diff options
author | Peng Wu <alexepico@gmail.com> | 2015-10-16 12:59:34 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2015-10-16 12:59:34 +0800 |
commit | 7f77d9dcbc043d00d3ef2eacfb1237b32b1d6136 (patch) | |
tree | 26be9cd04f8f4102757649ae1b91f62d19750f68 | |
parent | 51e7af528a4fe1c5da660eba48268369225c064c (diff) | |
download | libpinyin-7f77d9dcbc043d00d3ef2eacfb1237b32b1d6136.tar.gz libpinyin-7f77d9dcbc043d00d3ef2eacfb1237b32b1d6136.tar.xz libpinyin-7f77d9dcbc043d00d3ef2eacfb1237b32b1d6136.zip |
write pinyin_set_full_pinyin_scheme
-rw-r--r-- | src/libpinyin.ver | 1 | ||||
-rw-r--r-- | src/pinyin.cpp | 6 | ||||
-rw-r--r-- | src/pinyin.h | 12 | ||||
-rw-r--r-- | src/storage/pinyin_parser2.h | 1 |
4 files changed, 20 insertions, 0 deletions
diff --git a/src/libpinyin.ver b/src/libpinyin.ver index 40cd154..477b6e5 100644 --- a/src/libpinyin.ver +++ b/src/libpinyin.ver @@ -2,6 +2,7 @@ LIBPINYIN { global: pinyin_init; pinyin_save; + pinyin_set_full_pinyin_scheme; pinyin_set_double_pinyin_scheme; pinyin_set_chewing_scheme; pinyin_load_phrase_library; diff --git a/src/pinyin.cpp b/src/pinyin.cpp index 04911f8..f66a0c1 100644 --- a/src/pinyin.cpp +++ b/src/pinyin.cpp @@ -948,6 +948,12 @@ bool pinyin_save(pinyin_context_t * context){ return true; } +bool pinyin_set_full_pinyin_scheme(pinyin_context_t * context, + FullPinyinScheme scheme){ + context->m_full_pinyin_parser->set_scheme(scheme); + return true; +} + bool pinyin_set_double_pinyin_scheme(pinyin_context_t * context, DoublePinyinScheme scheme){ context->m_double_pinyin_parser->set_scheme(scheme); diff --git a/src/pinyin.h b/src/pinyin.h index adb2bb8..31c3bf5 100644 --- a/src/pinyin.h +++ b/src/pinyin.h @@ -204,6 +204,18 @@ void pinyin_end_get_phrases(export_iterator_t * iter); bool pinyin_save(pinyin_context_t * context); /** + * pinyin_set_full_pinyin_scheme: + * @context: the pinyin context. + * @scheme: the full pinyin scheme. + * @returns: whether the set full pinyin scheme succeeded. + * + * Change the full pinyin scheme of the pinyin context. + * + */ +bool pinyin_set_full_pinyin_scheme(pinyin_context_t * context, + FullPinyinScheme scheme); + +/** * pinyin_set_double_pinyin_scheme: * @context: the pinyin context. * @scheme: the double pinyin scheme. diff --git a/src/storage/pinyin_parser2.h b/src/storage/pinyin_parser2.h index 6faee17..b7d30ad 100644 --- a/src/storage/pinyin_parser2.h +++ b/src/storage/pinyin_parser2.h @@ -232,6 +232,7 @@ public: /* Direct Parser for Pinyin table load. */ class PinyinDirectParser2 : public PhoneticParser2 { + /* Only support Hanyu Pinyin now. */ const pinyin_index_item_t * m_pinyin_index; size_t m_pinyin_index_len; |