summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-12-26 15:17:46 +0800
committerPeng Wu <alexepico@gmail.com>2011-12-26 15:20:19 +0800
commit49869f6917edf488f0daca22e32a8166cf6e0325 (patch)
treec8bb595bc05d4e7bc63ec28401656cde7bc79bfa
parent11dfb3b72c7128e05e8608ff501d06b80a2788c1 (diff)
downloadlibpinyin-49869f6917edf488f0daca22e32a8166cf6e0325.zip
libpinyin-49869f6917edf488f0daca22e32a8166cf6e0325.tar.gz
libpinyin-49869f6917edf488f0daca22e32a8166cf6e0325.tar.xz
increase train factor
-rw-r--r--src/lookup/pinyin_lookup.cpp2
-rw-r--r--src/pinyin.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/lookup/pinyin_lookup.cpp b/src/lookup/pinyin_lookup.cpp
index a01b28a..efad86f 100644
--- a/src/lookup/pinyin_lookup.cpp
+++ b/src/lookup/pinyin_lookup.cpp
@@ -446,7 +446,7 @@ bool PinyinLookup::train_result(ChewingKeyVector keys, CandidateConstraints cons
//TODO: verify the new training method.
phrase_token_t last_token = sentence_start;
// constraints->len + 1 == results->len
- const guint32 train_factor = 23 * 5;
+ const guint32 train_factor = 23 * 25;
for ( size_t i = 0; i < constraints->len; ++i){
phrase_token_t * token = &g_array_index(results, phrase_token_t, i);
if ( *token == null_token )
diff --git a/src/pinyin.cpp b/src/pinyin.cpp
index a3fd37d..5a1b683 100644
--- a/src/pinyin.cpp
+++ b/src/pinyin.cpp
@@ -594,7 +594,7 @@ bool pinyin_translate_token(pinyin_instance_t * instance,
item.get_phrase_string(buffer);
guint8 length = item.get_phrase_length();
*word = g_utf16_to_utf8(buffer, length, NULL, NULL, NULL);
- return retval == ERROR_OK;
+ return ERROR_OK == retval;
}
bool pinyin_train(pinyin_instance_t * instance){