diff options
author | Peng Wu <alexepico@gmail.com> | 2011-12-08 16:55:49 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-12-09 13:34:47 +0800 |
commit | 669d5b63478a83df3938ae128f52dd3ef4fd7d2f (patch) | |
tree | 1d3671aeafed52f11054b75f93fcd3b886978829 /src/lookup/pinyin_lookup.h | |
parent | fcd6aa844697457b3b5e8d38c485d57f92789ea9 (diff) | |
download | libpinyin-669d5b63478a83df3938ae128f52dd3ef4fd7d2f.tar.gz libpinyin-669d5b63478a83df3938ae128f52dd3ef4fd7d2f.tar.xz libpinyin-669d5b63478a83df3938ae128f52dd3ef4fd7d2f.zip |
port pinyin lookup
Diffstat (limited to 'src/lookup/pinyin_lookup.h')
-rw-r--r-- | src/lookup/pinyin_lookup.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/lookup/pinyin_lookup.h b/src/lookup/pinyin_lookup.h index dd28b4d..3211acf 100644 --- a/src/lookup/pinyin_lookup.h +++ b/src/lookup/pinyin_lookup.h @@ -22,12 +22,16 @@ #ifndef PINYIN_LOOKUP_H #define PINYIN_LOOKUP_H + #include <float.h> #include <glib.h> #include "novel_types.h" -#include "pinyin_base.h" +#include "chewing_key.h" +#include "phrase_index.h" +#include "chewing_large_table.h" #include "lookup.h" + namespace pinyin{ class WinnerTree; @@ -84,11 +88,11 @@ private: protected: //saved varibles CandidateConstraints m_constraints; - PinyinKeyVector m_keys; + ChewingKeyVector m_keys; - PinyinLargeTable * m_pinyin_table; + ChewingLargeTable * m_pinyin_table; FacadePhraseIndex * m_phrase_index; - PinyinCustomSettings * m_custom; + pinyin_option_t m_options; Bigram * m_system_bigram; Bigram * m_user_bigram; @@ -118,13 +122,15 @@ protected: bool final_step(MatchResults & results); public: - PinyinLookup( PinyinCustomSettings * custom, PinyinLargeTable * pinyin_table, FacadePhraseIndex * phrase_index, Bigram * system_bigram, Bigram * user_bigram); + PinyinLookup(pinyin_option_t options, ChewingLargeTable * pinyin_table, + FacadePhraseIndex * phrase_index, Bigram * system_bigram, + Bigram * user_bigram); ~PinyinLookup(); - bool get_best_match(PinyinKeyVector keys, CandidateConstraints constraints, MatchResults & results); + bool get_best_match(ChewingKeyVector keys, CandidateConstraints constraints, MatchResults & results); - bool train_result(PinyinKeyVector keys, CandidateConstraints constraints, MatchResults & results); + bool train_result(ChewingKeyVector keys, CandidateConstraints constraints, MatchResults & results); bool convert_to_utf8(MatchResults results, /* out */ char * & result_string) @@ -138,7 +144,7 @@ public: bool clear_constraint(CandidateConstraints constraints, size_t index); - bool validate_constraint(CandidateConstraints constraints, PinyinKeyVector m_parsed_keys); + bool validate_constraint(CandidateConstraints constraints, ChewingKeyVector m_parsed_keys); /* init pinyin table lookup array */ bool prepare_pinyin_lookup(PhraseIndexRanges ranges); |