use pinyin lookup2
authorPeng Wu <alexepico@gmail.com>
Tue, 11 Sep 2012 06:58:55 +0000 (14:58 +0800)
committerPeng Wu <alexepico@gmail.com>
Tue, 11 Sep 2012 06:58:55 +0000 (14:58 +0800)
src/lookup/Makefile.am
src/pinyin.cpp
src/pinyin_internal.h
tests/lookup/test_pinyin_lookup.cpp
utils/training/eval_correction_rate.cpp

index 3230966..3f15a99 100644 (file)
@@ -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
index 4a0b9fb..e2f9070 100644 (file)
@@ -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);
index f9739ab..da443c2 100644 (file)
@@ -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"
 
index eea0437..e74ed44 100644 (file)
@@ -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;
index d70e487..dd36750 100644 (file)
@@ -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. */