summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libpinyin.ver2
-rw-r--r--src/pinyin.cpp13
-rw-r--r--src/pinyin.h4
3 files changed, 19 insertions, 0 deletions
diff --git a/src/libpinyin.ver b/src/libpinyin.ver
index 59b12ca..1b6b718 100644
--- a/src/libpinyin.ver
+++ b/src/libpinyin.ver
@@ -2,6 +2,8 @@ LIBPINYIN {
global:
pinyin_init;
pinyin_save;
+ pinyin_set_double_pinyin_scheme;
+ pinyin_set_chewing_scheme;
pinyin_fini;
pinyin_set_options;
pinyin_alloc_instance;
diff --git a/src/pinyin.cpp b/src/pinyin.cpp
index dae72df..71e2b17 100644
--- a/src/pinyin.cpp
+++ b/src/pinyin.cpp
@@ -150,6 +150,19 @@ bool pinyin_save(pinyin_context_t * context){
return true;
}
+bool pinyin_set_double_pinyin_scheme(pinyin_context_t * context,
+ PinyinShuangPinScheme scheme){
+ context->m_shuang_pin_parser->set_scheme(scheme);
+ return true;
+}
+
+bool pinyin_set_chewing_scheme(pinyin_context_t * context,
+ PinyinZhuYinScheme scheme){
+ context->m_chewing_parser->set_scheme(scheme);
+ return true;
+}
+
+
void pinyin_fini(pinyin_context_t * context){
delete context->m_default_parser;
delete context->m_shuang_pin_parser;
diff --git a/src/pinyin.h b/src/pinyin.h
index b144ef1..8b34a52 100644
--- a/src/pinyin.h
+++ b/src/pinyin.h
@@ -44,6 +44,10 @@ typedef struct {
pinyin_context_t * pinyin_init(const char * systemdir, const char * userdir);
bool pinyin_save(pinyin_context_t * context);
+bool pinyin_set_double_pinyin_scheme(pinyin_context_t * context,
+ PinyinShuangPinScheme scheme);
+bool pinyin_set_chewing_scheme(pinyin_context_t * context,
+ PinyinZhuYinScheme scheme);
void pinyin_fini(pinyin_context_t * context);
bool pinyin_set_options(pinyin_context_t * context,