diff options
author | Peng Wu <alexepico@gmail.com> | 2015-10-14 11:03:57 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2015-10-14 11:03:57 +0800 |
commit | 3c89c1aa4c818205cf2e871b932b1f4f0fe3fb21 (patch) | |
tree | 26422860100544c45e9f2f4993ff69371b3024b8 /src/storage/pinyin_parser2.cpp | |
parent | f699a47356f3ec5062a505ec2e5cddd929144ce3 (diff) | |
download | libpinyin-3c89c1aa4c818205cf2e871b932b1f4f0fe3fb21.tar.gz libpinyin-3c89c1aa4c818205cf2e871b932b1f4f0fe3fb21.tar.xz libpinyin-3c89c1aa4c818205cf2e871b932b1f4f0fe3fb21.zip |
update FullPinyinParser2
Diffstat (limited to 'src/storage/pinyin_parser2.cpp')
-rw-r--r-- | src/storage/pinyin_parser2.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp index d3442ee..a5c3985 100644 --- a/src/storage/pinyin_parser2.cpp +++ b/src/storage/pinyin_parser2.cpp @@ -438,6 +438,26 @@ int FullPinyinParser2::final_step(size_t step_len, ChewingKeyVector & keys, return parsed_len; } +bool FullPinyinParser2::set_scheme(ZhuyinScheme scheme){ + switch(scheme){ + case FULL_PINYIN_HANYU: + m_pinyin_index = hanyu_pinyin_index; + m_pinyin_index_len = G_N_ELEMENTS(hanyu_pinyin_index); + break; + case FULL_PINYIN_LUOMA: + m_pinyin_index = luoma_pinyin_index; + m_pinyin_index_len = G_N_ELEMENTS(luoma_pinyin_index); + break; + case FULL_PINYIN_SECONDARY_BOPOMOFO: + m_pinyin_index = secondary_bopomofo_index; + m_pinyin_index_len = G_N_ELEMENTS(secondary_bopomofo_index); + break; + default: + assert(false); + } + return true; +} + bool FullPinyinParser2::post_process2(pinyin_option_t options, ChewingKeyVector & keys, ChewingKeyRestVector & key_rests, |