summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2018-04-10 13:55:32 +0800
committerPeng Wu <alexepico@gmail.com>2018-04-10 14:07:18 +0800
commit3a41e1671aa3c71add07fc3dc09de6b71767b64a (patch)
tree8442c53387ec9f561cbdef553f837d2b32e35634
parentc5b2a03a056032a69564470f39a0b272ac35cbdd (diff)
downloadlibpinyin-3a41e1671aa3c71add07fc3dc09de6b71767b64a.zip
libpinyin-3a41e1671aa3c71add07fc3dc09de6b71767b64a.tar.gz
libpinyin-3a41e1671aa3c71add07fc3dc09de6b71767b64a.tar.xz
reduce memory usage
-rw-r--r--src/pinyin.cpp4
-rw-r--r--tests/lookup/test_pinyin_lookup.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/pinyin.cpp b/src/pinyin.cpp
index 3933860..8e4c85b 100644
--- a/src/pinyin.cpp
+++ b/src/pinyin.cpp
@@ -49,7 +49,7 @@ struct _pinyin_context_t{
Bigram * m_user_bigram;
/* lookups. */
- PhoneticLookup<3, 3> * m_pinyin_lookup;
+ PhoneticLookup<1, 3> * m_pinyin_lookup;
PhraseLookup * m_phrase_lookup;
/* addon tables. */
@@ -367,7 +367,7 @@ pinyin_context_t * pinyin_init(const char * systemdir, const char * userdir){
gfloat lambda = context->m_system_table_info.get_lambda();
- context->m_pinyin_lookup = new PhoneticLookup<3, 3>
+ context->m_pinyin_lookup = new PhoneticLookup<1, 3>
(lambda,
context->m_pinyin_table, context->m_phrase_index,
context->m_system_bigram, context->m_user_bigram);
diff --git a/tests/lookup/test_pinyin_lookup.cpp b/tests/lookup/test_pinyin_lookup.cpp
index e3d6d1b..5ff418f 100644
--- a/tests/lookup/test_pinyin_lookup.cpp
+++ b/tests/lookup/test_pinyin_lookup.cpp
@@ -59,8 +59,8 @@ int main( int argc, char * argv[]){
gfloat lambda = system_table_info.get_lambda();
- PhoneticLookup<3, 3> pinyin_lookup(lambda, &largetable, &phrase_index,
- &system_bigram, &user_bigram);
+ PhoneticLookup<1, 3> pinyin_lookup(lambda, &largetable, &phrase_index,
+ &system_bigram, &user_bigram);
/* prepare the prefixes for get_nbest_match. */
TokenVector prefixes = g_array_new