summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2016-03-30 14:17:33 +0800
committerPeng Wu <alexepico@gmail.com>2016-03-30 14:31:55 +0800
commit9217eb5d25faa0bed91c9344fc28ac5b6d57c0ee (patch)
tree13c44dbc6b2fe1b7a7adc0a17135501816745a4c
parent8cd9960d54d50ebb18e6f1b5aedd6e40391be879 (diff)
downloadlibpinyin-9217eb5d25faa0bed91c9344fc28ac5b6d57c0ee.tar.gz
libpinyin-9217eb5d25faa0bed91c9344fc28ac5b6d57c0ee.tar.xz
libpinyin-9217eb5d25faa0bed91c9344fc28ac5b6d57c0ee.zip
switch to phrase large table 3
-rw-r--r--src/lookup/phrase_lookup.cpp3
-rw-r--r--src/lookup/phrase_lookup.h4
-rw-r--r--src/pinyin.cpp10
-rw-r--r--src/pinyin_internal.cpp3
-rw-r--r--src/pinyin_internal.h1
-rw-r--r--src/storage/tag_utility.cpp4
-rw-r--r--src/storage/tag_utility.h2
7 files changed, 14 insertions, 13 deletions
diff --git a/src/lookup/phrase_lookup.cpp b/src/lookup/phrase_lookup.cpp
index d2dce91..b22ef84 100644
--- a/src/lookup/phrase_lookup.cpp
+++ b/src/lookup/phrase_lookup.cpp
@@ -23,7 +23,6 @@
#include "stl_lite.h"
#include "novel_types.h"
#include "phrase_index.h"
-#include "facade_phrase_table2.h"
#include "facade_phrase_table3.h"
#include "phrase_lookup.h"
@@ -92,7 +91,7 @@ static void clear_steps(GPtrArray * steps_index,
}
PhraseLookup::PhraseLookup(const gfloat lambda,
- FacadePhraseTable2 * phrase_table,
+ FacadePhraseTable3 * phrase_table,
FacadePhraseIndex * phrase_index,
Bigram * system_bigram,
Bigram * user_bigram)
diff --git a/src/lookup/phrase_lookup.h b/src/lookup/phrase_lookup.h
index cf65692..341b7bc 100644
--- a/src/lookup/phrase_lookup.h
+++ b/src/lookup/phrase_lookup.h
@@ -50,7 +50,7 @@ private:
SingleGram m_merged_single_gram;
protected:
//saved varibles
- FacadePhraseTable2 * m_phrase_table;
+ FacadePhraseTable3 * m_phrase_table;
FacadePhraseIndex * m_phrase_index;
Bigram * m_system_bigram;
Bigram * m_user_bigram;
@@ -91,7 +91,7 @@ public:
*
*/
PhraseLookup(const gfloat lambda,
- FacadePhraseTable2 * phrase_table,
+ FacadePhraseTable3 * phrase_table,
FacadePhraseIndex * phrase_index,
Bigram * system_bigram,
Bigram * user_bigram);
diff --git a/src/pinyin.cpp b/src/pinyin.cpp
index 3390d37..2cb0472 100644
--- a/src/pinyin.cpp
+++ b/src/pinyin.cpp
@@ -43,7 +43,7 @@ struct _pinyin_context_t{
/* default tables. */
FacadeChewingTable * m_pinyin_table;
- FacadePhraseTable2 * m_phrase_table;
+ FacadePhraseTable3 * m_phrase_table;
FacadePhraseIndex * m_phrase_index;
Bigram * m_system_bigram;
Bigram * m_user_bigram;
@@ -54,7 +54,7 @@ struct _pinyin_context_t{
/* addon tables. */
FacadeChewingTable * m_addon_pinyin_table;
- FacadePhraseTable2 * m_addon_phrase_table;
+ FacadePhraseTable3 * m_addon_phrase_table;
FacadePhraseIndex * m_addon_phrase_index;
char * m_system_dir;
@@ -323,7 +323,7 @@ pinyin_context_t * pinyin_init(const char * systemdir, const char * userdir){
/* load phrase table */
- context->m_phrase_table = new FacadePhraseTable2;
+ context->m_phrase_table = new FacadePhraseTable3;
system_filename = g_build_filename
(context->m_system_dir, SYSTEM_PHRASE_INDEX, NULL);
@@ -386,7 +386,7 @@ pinyin_context_t * pinyin_init(const char * systemdir, const char * userdir){
g_free(system_filename);
/* load addon phrase table */
- context->m_addon_phrase_table = new FacadePhraseTable2;
+ context->m_addon_phrase_table = new FacadePhraseTable3;
system_filename = g_build_filename
(context->m_system_dir, ADDON_SYSTEM_PHRASE_INDEX, NULL);
@@ -479,7 +479,7 @@ bool pinyin_iterator_add_phrase(import_iterator_t * iter,
count = default_count;
pinyin_context_t * & context = iter->m_context;
- FacadePhraseTable2 * & phrase_table = context->m_phrase_table;
+ FacadePhraseTable3 * & phrase_table = context->m_phrase_table;
FacadeChewingTable * & pinyin_table = context->m_pinyin_table;
FacadePhraseIndex * & phrase_index = context->m_phrase_index;
diff --git a/src/pinyin_internal.cpp b/src/pinyin_internal.cpp
index 79fb688..5a6b20e 100644
--- a/src/pinyin_internal.cpp
+++ b/src/pinyin_internal.cpp
@@ -1,4 +1,7 @@
#include "pinyin_internal.h"
+/* deprecated headers, just keep it here for compiling. */
+#include "facade_phrase_table2.h"
+
/* Place holder for pinyin internal library. */
diff --git a/src/pinyin_internal.h b/src/pinyin_internal.h
index 01e715b..a478844 100644
--- a/src/pinyin_internal.h
+++ b/src/pinyin_internal.h
@@ -38,7 +38,6 @@
#include "phrase_large_table3.h"
#include "facade_chewing_table.h"
#include "facade_chewing_table2.h"
-#include "facade_phrase_table2.h"
#include "facade_phrase_table3.h"
#include "phrase_index.h"
#include "phrase_index_logger.h"
diff --git a/src/storage/tag_utility.cpp b/src/storage/tag_utility.cpp
index 081e931..232a07d 100644
--- a/src/storage/tag_utility.cpp
+++ b/src/storage/tag_utility.cpp
@@ -4,7 +4,7 @@
#include <assert.h>
#include "novel_types.h"
#include "phrase_index.h"
-#include "phrase_large_table2.h"
+#include "phrase_large_table3.h"
#include "tag_utility.h"
namespace pinyin{
@@ -332,7 +332,7 @@ static phrase_token_t taglib_special_string_to_token(const char * string){
return 0;
}
-phrase_token_t taglib_string_to_token(PhraseLargeTable2 * phrase_table,
+phrase_token_t taglib_string_to_token(PhraseLargeTable3 * phrase_table,
FacadePhraseIndex * phrase_index,
const char * string){
phrase_token_t token = null_token;
diff --git a/src/storage/tag_utility.h b/src/storage/tag_utility.h
index ceb1d6c..1dd90b8 100644
--- a/src/storage/tag_utility.h
+++ b/src/storage/tag_utility.h
@@ -111,7 +111,7 @@ bool taglib_pop_state();
*/
bool taglib_fini();
-class PhraseLargeTable2;
+
class FacadePhraseIndex;