summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2016-05-27 13:48:09 +0800
committerPeng Wu <alexepico@gmail.com>2016-05-27 13:48:09 +0800
commitd393fb21d62a46e9faa94deb14227e43c4e44109 (patch)
treeae1f52b445aceef3dd85a1e1475e2a69cb4e92a3
parentdb55283f014cfa5abd35c3be76e655bc1ee677ff (diff)
downloadlibpinyin-d393fb21d62a46e9faa94deb14227e43c4e44109.tar.gz
libpinyin-d393fb21d62a46e9faa94deb14227e43c4e44109.tar.xz
libpinyin-d393fb21d62a46e9faa94deb14227e43c4e44109.zip
update class PinyinLookup2
-rw-r--r--src/lookup/pinyin_lookup2.cpp10
-rw-r--r--src/lookup/pinyin_lookup2.h16
2 files changed, 4 insertions, 22 deletions
diff --git a/src/lookup/pinyin_lookup2.cpp b/src/lookup/pinyin_lookup2.cpp
index d1aad4d..b2503bf 100644
--- a/src/lookup/pinyin_lookup2.cpp
+++ b/src/lookup/pinyin_lookup2.cpp
@@ -186,7 +186,6 @@ static void clear_steps(GPtrArray * steps_index, GPtrArray * steps_content){
PinyinLookup2::PinyinLookup2(const gfloat lambda,
- pinyin_option_t options,
FacadeChewingTable2 * pinyin_table,
FacadePhraseIndex * phrase_index,
Bigram * system_bigram,
@@ -194,7 +193,6 @@ PinyinLookup2::PinyinLookup2(const gfloat lambda,
: bigram_lambda(lambda),
unigram_lambda(1. - lambda)
{
- m_options = options;
m_pinyin_table = pinyin_table;
m_phrase_index = phrase_index;
m_system_bigram = system_bigram;
@@ -408,7 +406,7 @@ bool PinyinLookup2::unigram_gen_next_step(int start, int end,
return false;
gfloat pinyin_poss = compute_pronunciation_possibility
- (m_options, m_matrix, start, end, m_cached_keys, m_cached_phrase_item);
+ (m_matrix, start, end, m_cached_keys, m_cached_phrase_item);
if (pinyin_poss < FLT_EPSILON )
return false;
@@ -436,7 +434,7 @@ bool PinyinLookup2::bigram_gen_next_step(int start, int end,
return false;
gfloat pinyin_poss = compute_pronunciation_possibility
- (m_options, m_matrix, start, end, m_cached_keys, m_cached_phrase_item);
+ (m_matrix, start, end, m_cached_keys, m_cached_phrase_item);
if ( pinyin_poss < FLT_EPSILON )
return false;
@@ -613,7 +611,7 @@ bool PinyinLookup2::train_result2(PhoneticKeyMatrix * matrix,
/* train uni-gram */
m_phrase_index->get_phrase_item(*token, m_cached_phrase_item);
increase_pronunciation_possibility
- (m_options, matrix, i, constraint->m_end,
+ (matrix, i, constraint->m_end,
m_cached_keys, m_cached_phrase_item, seed * pinyin_factor);
m_phrase_index->add_unigram_frequency
(*token, seed * unigram_factor);
@@ -723,7 +721,7 @@ bool PinyinLookup2::validate_constraint(PhoneticKeyMatrix * matrix,
}
gfloat pinyin_poss = compute_pronunciation_possibility
- (m_options, matrix, i, end,
+ (matrix, i, end,
m_cached_keys, m_cached_phrase_item);
/* clear invalid pinyin */
if (pinyin_poss < FLT_EPSILON)
diff --git a/src/lookup/pinyin_lookup2.h b/src/lookup/pinyin_lookup2.h
index 6bae846..19f0313 100644
--- a/src/lookup/pinyin_lookup2.h
+++ b/src/lookup/pinyin_lookup2.h
@@ -96,7 +96,6 @@ protected:
CandidateConstraints m_constraints;
PhoneticKeyMatrix * m_matrix;
- pinyin_option_t m_options;
FacadeChewingTable2 * m_pinyin_table;
FacadePhraseIndex * m_phrase_index;
Bigram * m_system_bigram;
@@ -132,7 +131,6 @@ public:
/**
* PinyinLookup2::PinyinLookup2:
* @lambda: the lambda parameter for interpolation model.
- * @options: the pinyin options.
* @pinyin_table: the pinyin table.
* @phrase_index: the phrase index.
* @system_bigram: the system bi-gram.
@@ -142,7 +140,6 @@ public:
*
*/
PinyinLookup2(const gfloat lambda,
- pinyin_option_t options,
FacadeChewingTable2 * pinyin_table,
FacadePhraseIndex * phrase_index,
Bigram * system_bigram,
@@ -157,19 +154,6 @@ public:
~PinyinLookup2();
/**
- * PinyinLookup2::set_options:
- * @options: the pinyin options.
- * @returns: whether the set operation is successful.
- *
- * Set the pinyin options.
- *
- */
- bool set_options(pinyin_option_t options) {
- m_options = options;
- return true;
- }
-
- /**
* PinyinLookup2::get_best_match:
* @prefixes: the phrase tokens before the guessed sentence.
* @matrix: the matrix of the pinyin keys.