summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-09-06 14:28:00 +0800
committerPeng Wu <alexepico@gmail.com>2011-09-06 14:28:00 +0800
commit574922492454300a5a0f4ea8bec845171387833a (patch)
tree3c291c3a40866ba030bac64beb20b1714074a009
parenta49d9240720f7a8de1e2418a039f9850ccc08ca8 (diff)
downloadlibpinyin-574922492454300a5a0f4ea8bec845171387833a.zip
libpinyin-574922492454300a5a0f4ea8bec845171387833a.tar.gz
libpinyin-574922492454300a5a0f4ea8bec845171387833a.tar.xz
expose pinyin pos vector
-rw-r--r--tests/test_chewing.cpp8
-rw-r--r--tests/test_pinyin.cpp7
2 files changed, 9 insertions, 6 deletions
diff --git a/tests/test_chewing.cpp b/tests/test_chewing.cpp
index 060d482..912a932 100644
--- a/tests/test_chewing.cpp
+++ b/tests/test_chewing.cpp
@@ -28,11 +28,12 @@ int main(int argc, char * argv[]){
pinyin_init("../data", "../data");
PinyinKeyVector pinyin_keys = NULL;
+ PinyinKeyPosVector pinyin_poses = NULL;
CandidateConstraints constraints = NULL;
MatchResults match_results = NULL;
pinyin_alloc_auxiliary_arrays
- (context, &pinyin_keys, &constraints, &match_results);
+ (context, &pinyin_keys, &pinyin_poses, &constraints, &match_results);
char* linebuf = NULL;
size_t size = 0;
@@ -45,7 +46,8 @@ int main(int argc, char * argv[]){
if ( strcmp ( linebuf, "quit" ) == 0)
break;
- pinyin_parse_more_chewings(context, linebuf, pinyin_keys);
+ pinyin_parse_more_chewings
+ (context, linebuf, pinyin_keys, pinyin_poses);
pinyin_update_constraints(context, pinyin_keys, constraints);
pinyin_get_guessed_tokens(context, pinyin_keys, constraints,
match_results);
@@ -61,7 +63,7 @@ int main(int argc, char * argv[]){
}
pinyin_free_auxiliary_arrays
- (context, &pinyin_keys, &constraints, &match_results);
+ (context, &pinyin_keys, &pinyin_poses, &constraints, &match_results);
pinyin_fini(context);
free(linebuf);
return 0;
diff --git a/tests/test_pinyin.cpp b/tests/test_pinyin.cpp
index 1009adb..d8bc49a 100644
--- a/tests/test_pinyin.cpp
+++ b/tests/test_pinyin.cpp
@@ -28,11 +28,12 @@ int main(int argc, char * argv[]){
pinyin_init("../data", "../data");
PinyinKeyVector pinyin_keys = NULL;
+ PinyinKeyPosVector pinyin_poses = NULL;
CandidateConstraints constraints = NULL;
MatchResults match_results = NULL;
pinyin_alloc_auxiliary_arrays
- (context, &pinyin_keys, &constraints, &match_results);
+ (context, &pinyin_keys, &pinyin_poses, &constraints, &match_results);
char* linebuf = NULL;
size_t size = 0;
@@ -45,7 +46,7 @@ int main(int argc, char * argv[]){
if ( strcmp ( linebuf, "quit" ) == 0)
break;
- pinyin_parse_more_fulls(context, linebuf, pinyin_keys);
+ pinyin_parse_more_fulls(context, linebuf, pinyin_keys, pinyin_poses);
pinyin_update_constraints(context, pinyin_keys, constraints);
pinyin_get_guessed_tokens(context, pinyin_keys, constraints,
match_results);
@@ -61,7 +62,7 @@ int main(int argc, char * argv[]){
}
pinyin_free_auxiliary_arrays
- (context, &pinyin_keys, &constraints, &match_results);
+ (context, &pinyin_keys, &pinyin_poses, &constraints, &match_results);
pinyin_fini(context);
free(linebuf);
return 0;