summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-08-30 14:41:29 +0800
committerPeng Wu <alexepico@gmail.com>2011-08-30 14:41:29 +0800
commit12c6b51b1296aad330df572794693d37423179a4 (patch)
tree532066af19e5262c804f1dfef03b449b9f0639a6
parent293003483072888aa954f06d3097f5b46f55e1e5 (diff)
downloadlibpinyin-12c6b51b1296aad330df572794693d37423179a4.zip
libpinyin-12c6b51b1296aad330df572794693d37423179a4.tar.gz
libpinyin-12c6b51b1296aad330df572794693d37423179a4.tar.xz
switch to pinyin internal library
-rw-r--r--src/Makefile.am3
-rw-r--r--src/libpinyin.ver24
-rw-r--r--tests/lookup/Makefile.am4
-rw-r--r--tests/storage/Makefile.am16
-rw-r--r--tests/storage/test_parser.cpp2
-rw-r--r--utils/segment/Makefile.am4
-rw-r--r--utils/storage/Makefile.am8
-rw-r--r--utils/storage/gen_pinyin_table.cpp4
-rw-r--r--utils/training/Makefile.am29
9 files changed, 62 insertions, 32 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 4cb72f9..2ada1da 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -42,6 +42,9 @@ libpinyin_la_SOURCES = pinyin.cpp
libpinyin_la_LIBADD = storage/libstorage.la lookup/liblookup.la
+libpinyin_la_LDFLAGS = -Wl,--version-script=libpinyin.ver \
+ -version-info "0:3:0"
+
libpinyin_internal_la_SOURCES = pinyin_internal.cpp
libpinyin_internal_la_LIBADD = storage/libstorage.la lookup/liblookup.la
diff --git a/src/libpinyin.ver b/src/libpinyin.ver
new file mode 100644
index 0000000..0d9baaf
--- /dev/null
+++ b/src/libpinyin.ver
@@ -0,0 +1,24 @@
+LIBPINYIN {
+ global:
+ pinyin_choose_candidate;
+ pinyin_clear_constraint;
+ pinyin_clear_constraints;
+ pinyin_fini;
+ pinyin_get_candidates;
+ pinyin_get_guessed_sentence;
+ pinyin_init;
+ pinyin_parse_double;
+ pinyin_parse_more_doubles;
+ pinyin_parse_full;
+ pinyin_parse_more_fulls;
+ pinyin_phrase_segment;
+ pinyin_reset;
+ pinyin_save;
+ pinyin_set_options;
+ pinyin_set_pinyin_keys;
+ pinyin_train;
+ pinyin_translate_token;
+
+ local:
+ *;
+};
diff --git a/tests/lookup/Makefile.am b/tests/lookup/Makefile.am
index 6887605..68ef412 100644
--- a/tests/lookup/Makefile.am
+++ b/tests/lookup/Makefile.am
@@ -25,8 +25,8 @@ noinst_PROGRAMS = test_simple_lookup test_phrase_lookup
test_simple_lookup_SOURCES = test_simple_lookup.cpp
-test_simple_lookup_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+test_simple_lookup_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
test_phrase_lookup_SOURCES = test_phrase_lookup.cpp
-test_phrase_lookup_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@ \ No newline at end of file
+test_phrase_lookup_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@ \ No newline at end of file
diff --git a/tests/storage/Makefile.am b/tests/storage/Makefile.am
index 3097a28..d6a4c3a 100644
--- a/tests/storage/Makefile.am
+++ b/tests/storage/Makefile.am
@@ -32,28 +32,30 @@ noinst_PROGRAMS = test_parser \
test_parser_SOURCES = test_parser.cpp
-test_parser_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+test_parser_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
test_pinyin_index_SOURCES = test_pinyin_index.cpp
-test_pinyin_index_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+test_pinyin_index_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
test_phrase_index_SOURCES = test_phrase_index.cpp
-test_phrase_index_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+test_phrase_index_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
test_phrase_index_logger_SOURCES = test_phrase_index_logger.cpp
-test_phrase_index_logger_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+test_phrase_index_logger_LDADD = ../../src/libpinyin_internal.la \
+ @GLIB2_LDFLAGS@
test_phrase_table_SOURCES = test_phrase_table.cpp
-test_phrase_table_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+test_phrase_table_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
test_ngram_SOURCES = test_ngram.cpp
-test_ngram_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+test_ngram_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
test_flexible_ngram_SOURCES = test_flexible_ngram.cpp
-test_flexible_ngram_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+test_flexible_ngram_LDADD = ../../src/libpinyin_internal.la \
+ @GLIB2_LDFLAGS@
diff --git a/tests/storage/test_parser.cpp b/tests/storage/test_parser.cpp
index 4a5ebe3..08e1d43 100644
--- a/tests/storage/test_parser.cpp
+++ b/tests/storage/test_parser.cpp
@@ -26,7 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "pinyin.h"
+#include "pinyin_internal.h"
static const char *help_msg =
"Too few argument!\n"
diff --git a/utils/segment/Makefile.am b/utils/segment/Makefile.am
index 6317a89..b04f64f 100644
--- a/utils/segment/Makefile.am
+++ b/utils/segment/Makefile.am
@@ -27,8 +27,8 @@ noinst_PROGRAMS = spseg ngseg
spseg_SOURCES = spseg.cpp
-spseg_LDADD = @GLIB2_LDFLAGS@ ../../src/libpinyin.la
+spseg_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
ngseg_SOURCES = ngseg.cpp
-ngseg_LDADD = @GLIB2_LDFLAGS@ ../../src/libpinyin.la
+ngseg_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
diff --git a/utils/storage/Makefile.am b/utils/storage/Makefile.am
index bc033f1..36452a4 100644
--- a/utils/storage/Makefile.am
+++ b/utils/storage/Makefile.am
@@ -25,16 +25,16 @@ noinst_PROGRAMS = gen_pinyin_table gen_binary_files export_interpolatio
gen_pinyin_table_SOURCES = gen_pinyin_table.cpp
-gen_pinyin_table_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+gen_pinyin_table_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
gen_binary_files_SOURCES = gen_binary_files.cpp
-gen_binary_files_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+gen_binary_files_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
import_interpolation_SOURCES = import_interpolation.cpp
-import_interpolation_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+import_interpolation_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
export_interpolation_SOURCES = export_interpolation.cpp
-export_interpolation_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+export_interpolation_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
diff --git a/utils/storage/gen_pinyin_table.cpp b/utils/storage/gen_pinyin_table.cpp
index 83a5c8a..414946b 100644
--- a/utils/storage/gen_pinyin_table.cpp
+++ b/utils/storage/gen_pinyin_table.cpp
@@ -20,11 +20,9 @@
*/
#include <stdio.h>
-#include <errno.h>
-#include <stdlib.h>
#include <locale.h>
#include <glib.h>
-#include "pinyin.h"
+#include "pinyin_internal.h"
GTree * g_pinyin_tree;
diff --git a/utils/training/Makefile.am b/utils/training/Makefile.am
index 38fdd60..39d9731 100644
--- a/utils/training/Makefile.am
+++ b/utils/training/Makefile.am
@@ -41,52 +41,55 @@ noinst_PROGRAMS = gen_ngram \
gen_ngram_SOURCES = gen_ngram.cpp
-gen_ngram_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+gen_ngram_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
gen_deleted_ngram_SOURCES = gen_deleted_ngram.cpp
-gen_deleted_ngram_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+gen_deleted_ngram_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
gen_unigram_SOURCES = gen_unigram.cpp
-gen_unigram_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+gen_unigram_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
gen_k_mixture_model_SOURCES = gen_k_mixture_model.cpp
-gen_k_mixture_model_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+gen_k_mixture_model_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
estimate_interpolation_SOURCES = estimate_interpolation.cpp
-estimate_interpolation_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+estimate_interpolation_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
estimate_k_mixture_model_SOURCES = estimate_k_mixture_model.cpp
-estimate_k_mixture_model_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+estimate_k_mixture_model_LDADD = ../../src/libpinyin_internal.la \
+ @GLIB2_LDFLAGS@
merge_k_mixture_model_SOURCES = merge_k_mixture_model.cpp
-merge_k_mixture_model_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+merge_k_mixture_model_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
prune_k_mixture_model_SOURCES = prune_k_mixture_model.cpp
-prune_k_mixture_model_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+prune_k_mixture_model_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
import_k_mixture_model_SOURCES = import_k_mixture_model.cpp
-import_k_mixture_model_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+import_k_mixture_model_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
export_k_mixture_model_SOURCES = export_k_mixture_model.cpp
-export_k_mixture_model_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+export_k_mixture_model_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@
k_mixture_model_to_interpolation_SOURCES = k_mixture_model_to_interpolation.cpp
-k_mixture_model_to_interpolation_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+k_mixture_model_to_interpolation_LDADD = ../../src/libpinyin_internal.la \
+ @GLIB2_LDFLAGS@
validate_k_mixture_model_SOURCES = validate_k_mixture_model.cpp
-validate_k_mixture_model_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@
+validate_k_mixture_model_LDADD = ../../src/libpinyin_internal.la \
+ @GLIB2_LDFLAGS@
eval_correction_rate_SOURCES = eval_correction_rate.cpp
-eval_correction_rate_LDADD = ../../src/libpinyin.la @GLIB2_LDFLAGS@ \ No newline at end of file
+eval_correction_rate_LDADD = ../../src/libpinyin_internal.la @GLIB2_LDFLAGS@