summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-09-11 14:58:55 +0800
committerPeng Wu <alexepico@gmail.com>2012-09-11 14:58:55 +0800
commit9f1c534806b7391c0c9b96277a75708b1b07c04c (patch)
tree94a75e9c6a7bbcbe6aa227b8987d20ce7e23b60b
parent621f971e2574322e21aada3a08af1fb25129af0d (diff)
downloadlibpinyin-9f1c534806b7391c0c9b96277a75708b1b07c04c.tar.gz
libpinyin-9f1c534806b7391c0c9b96277a75708b1b07c04c.tar.xz
libpinyin-9f1c534806b7391c0c9b96277a75708b1b07c04c.zip
use pinyin lookup2
-rw-r--r--src/lookup/Makefile.am8
-rw-r--r--src/pinyin.cpp4
-rw-r--r--src/pinyin_internal.h2
-rw-r--r--tests/lookup/test_pinyin_lookup.cpp2
-rw-r--r--utils/training/eval_correction_rate.cpp6
5 files changed, 9 insertions, 13 deletions
diff --git a/src/lookup/Makefile.am b/src/lookup/Makefile.am
index 3230966..3f15a99 100644
--- a/src/lookup/Makefile.am
+++ b/src/lookup/Makefile.am
@@ -22,10 +22,8 @@ INCLUDES = -I$(top_srcdir)/src/include \
@GLIB2_CPPFLAGS@
noinst_HEADERS = lookup.h \
- pinyin_lookup.h \
pinyin_lookup2.h \
- phrase_lookup.h \
- winner_tree.h
+ phrase_lookup.h
noinst_LTLIBRARIES = liblookup.la
@@ -33,8 +31,6 @@ liblookup_la_CXXFLAGS = "-fPIC"
liblookup_la_LDFLAGS = -static
-liblookup_la_SOURCES = pinyin_lookup.cpp \
- pinyin_lookup2.cpp \
- winner_tree.cpp \
+liblookup_la_SOURCES = pinyin_lookup2.cpp \
phrase_lookup.cpp \
lookup.cpp
diff --git a/src/pinyin.cpp b/src/pinyin.cpp
index 4a0b9fb..e2f9070 100644
--- a/src/pinyin.cpp
+++ b/src/pinyin.cpp
@@ -41,7 +41,7 @@ struct _pinyin_context_t{
Bigram * m_system_bigram;
Bigram * m_user_bigram;
- PinyinLookup * m_pinyin_lookup;
+ PinyinLookup2 * m_pinyin_lookup;
PhraseLookup * m_phrase_lookup;
char * m_system_dir;
@@ -190,7 +190,7 @@ pinyin_context_t * pinyin_init(const char * systemdir, const char * userdir){
context->m_user_bigram->load_db(filename);
g_free(filename);
- context->m_pinyin_lookup = new PinyinLookup
+ context->m_pinyin_lookup = new PinyinLookup2
( context->m_options, context->m_pinyin_table,
context->m_phrase_index, context->m_system_bigram,
context->m_user_bigram);
diff --git a/src/pinyin_internal.h b/src/pinyin_internal.h
index f9739ab..da443c2 100644
--- a/src/pinyin_internal.h
+++ b/src/pinyin_internal.h
@@ -38,7 +38,7 @@
#include "phrase_index_logger.h"
#include "ngram.h"
#include "lookup.h"
-#include "pinyin_lookup.h"
+#include "pinyin_lookup2.h"
#include "phrase_lookup.h"
#include "tag_utility.h"
diff --git a/tests/lookup/test_pinyin_lookup.cpp b/tests/lookup/test_pinyin_lookup.cpp
index eea0437..e74ed44 100644
--- a/tests/lookup/test_pinyin_lookup.cpp
+++ b/tests/lookup/test_pinyin_lookup.cpp
@@ -46,7 +46,7 @@ int main( int argc, char * argv[]){
Bigram user_bigram;
user_bigram.attach(NULL, ATTACH_CREATE|ATTACH_READWRITE);
- PinyinLookup pinyin_lookup(options, &largetable, &phrase_index,
+ PinyinLookup2 pinyin_lookup(options, &largetable, &phrase_index,
&system_bigram, &user_bigram);
char* linebuf = NULL;
diff --git a/utils/training/eval_correction_rate.cpp b/utils/training/eval_correction_rate.cpp
index d70e487..dd36750 100644
--- a/utils/training/eval_correction_rate.cpp
+++ b/utils/training/eval_correction_rate.cpp
@@ -57,7 +57,7 @@ bool get_possible_pinyin(FacadePhraseIndex * phrase_index,
return true;
}
-bool get_best_match(PinyinLookup * pinyin_lookup,
+bool get_best_match(PinyinLookup2 * pinyin_lookup,
ChewingKeyVector keys, TokenVector tokens){
/* prepare the prefixes for get_best_match. */
TokenVector prefixes = g_array_new
@@ -81,7 +81,7 @@ bool get_best_match(PinyinLookup * pinyin_lookup,
return retval;
}
-bool do_one_test(PinyinLookup * pinyin_lookup,
+bool do_one_test(PinyinLookup2 * pinyin_lookup,
FacadePhraseIndex * phrase_index,
TokenVector tokens){
bool retval = false;
@@ -137,7 +137,7 @@ int main(int argc, char * argv[]){
Bigram user_bigram;
user_bigram.attach(NULL, ATTACH_CREATE|ATTACH_READWRITE);
- PinyinLookup pinyin_lookup(options, &largetable, &phrase_index,
+ PinyinLookup2 pinyin_lookup(options, &largetable, &phrase_index,
&system_bigram, &user_bigram);
/* open evals.text. */