summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-12-19 11:16:44 +0800
committerPeng Wu <alexepico@gmail.com>2011-12-19 11:21:08 +0800
commit66c80265f40d48519caba75e6e37a5e4ac9b83cd (patch)
tree2043d9b5634a6af2bd890003794e26c9e8d89a8a
parent7efb58accb3e2e9fea4a578350a27447cb03383c (diff)
downloadlibpinyin-66c80265f40d48519caba75e6e37a5e4ac9b83cd.zip
libpinyin-66c80265f40d48519caba75e6e37a5e4ac9b83cd.tar.gz
libpinyin-66c80265f40d48519caba75e6e37a5e4ac9b83cd.tar.xz
fixes pinyin_init
-rw-r--r--src/pinyin.cpp2
-rw-r--r--tests/lookup/test_pinyin_lookup.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/pinyin.cpp b/src/pinyin.cpp
index c8ff8dd..0fee2a8 100644
--- a/src/pinyin.cpp
+++ b/src/pinyin.cpp
@@ -50,6 +50,8 @@ struct _pinyin_context_t{
pinyin_context_t * pinyin_init(const char * systemdir, const char * userdir){
pinyin_context_t * context = new pinyin_context_t;
+ context->m_options = USE_TONE;
+
context->m_system_dir = g_strdup(systemdir);
context->m_user_dir = g_strdup(userdir);
context->m_modified = false;
diff --git a/tests/lookup/test_pinyin_lookup.cpp b/tests/lookup/test_pinyin_lookup.cpp
index b22e689..e8722af 100644
--- a/tests/lookup/test_pinyin_lookup.cpp
+++ b/tests/lookup/test_pinyin_lookup.cpp
@@ -6,7 +6,7 @@ size_t bench_times = 100;
int main( int argc, char * argv[]){
- pinyin_option_t options = PINYIN_CORRECT_ALL | USE_TONE;
+ pinyin_option_t options = USE_TONE | PINYIN_CORRECT_ALL | PINYIN_AMB_ALL;
ChewingLargeTable largetable(options);
MemoryChunk * new_chunk = new MemoryChunk;