summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-12-20 14:29:37 +0800
committerPeng Wu <alexepico@gmail.com>2011-12-20 14:29:37 +0800
commit0bd6c94bd4d1d78e411d7d4fb52c5f7f3cb07aa8 (patch)
tree3a8343f2ad934f191a42bf17989041514dac9f0e
parent54304fd1441d9bb67299651b943577848c246892 (diff)
downloadlibpinyin-0bd6c94bd4d1d78e411d7d4fb52c5f7f3cb07aa8.zip
libpinyin-0bd6c94bd4d1d78e411d7d4fb52c5f7f3cb07aa8.tar.gz
libpinyin-0bd6c94bd4d1d78e411d7d4fb52c5f7f3cb07aa8.tar.xz
add set options to pinyin lookup
-rw-r--r--src/lookup/pinyin_lookup.h5
-rw-r--r--src/pinyin.cpp1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/lookup/pinyin_lookup.h b/src/lookup/pinyin_lookup.h
index 3211acf..ec30957 100644
--- a/src/lookup/pinyin_lookup.h
+++ b/src/lookup/pinyin_lookup.h
@@ -128,6 +128,11 @@ public:
~PinyinLookup();
+ bool set_options(pinyin_option_t options) {
+ m_options = options;
+ return true;
+ }
+
bool get_best_match(ChewingKeyVector keys, CandidateConstraints constraints, MatchResults & results);
bool train_result(ChewingKeyVector keys, CandidateConstraints constraints, MatchResults & results);
diff --git a/src/pinyin.cpp b/src/pinyin.cpp
index 87f61fc..8467570 100644
--- a/src/pinyin.cpp
+++ b/src/pinyin.cpp
@@ -261,6 +261,7 @@ bool pinyin_set_options(pinyin_context_t * context,
pinyin_option_t options){
context->m_options = options;
context->m_pinyin_table->set_options(context->m_options);
+ context->m_pinyin_lookup->set_options(context->m_options);
return true;
}