summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-09-21 14:46:12 +0800
committerPeng Wu <alexepico@gmail.com>2011-09-21 14:46:12 +0800
commitbe59e5b5f901f0959e8824e81a7f49c434229440 (patch)
treebcc1bc8d4e9c72dbd1aee8e3538a6031196fdf0b
parentc4873c80ffb34e6c4456d9f2b571c612af08ad71 (diff)
downloadlibpinyin-be59e5b5f901f0959e8824e81a7f49c434229440.tar.gz
libpinyin-be59e5b5f901f0959e8824e81a7f49c434229440.tar.xz
libpinyin-be59e5b5f901f0959e8824e81a7f49c434229440.zip
change api
-rw-r--r--src/pinyin.cpp18
-rw-r--r--src/pinyin.h12
2 files changed, 15 insertions, 15 deletions
diff --git a/src/pinyin.cpp b/src/pinyin.cpp
index 6757820..2d4015a 100644
--- a/src/pinyin.cpp
+++ b/src/pinyin.cpp
@@ -237,8 +237,8 @@ bool pinyin_parse_full_pinyin(pinyin_instance_t * instance,
return pinyin_len == parse_len;
}
-bool pinyin_parse_more_full_pinyins(pinyin_instance_t * instance,
- const char * pinyins){
+size_t pinyin_parse_more_full_pinyins(pinyin_instance_t * instance,
+ const char * pinyins){
pinyin_context_t * & context = instance->m_context;
int pinyin_len = strlen(pinyins);
@@ -246,7 +246,7 @@ bool pinyin_parse_more_full_pinyins(pinyin_instance_t * instance,
( context->m_validator, instance->m_pinyin_keys,
instance->m_pinyin_poses, pinyins, pinyin_len);
- return pinyin_len == parse_len;
+ return parse_len;
}
bool pinyin_parse_double_pinyin(pinyin_instance_t * instance,
@@ -260,8 +260,8 @@ bool pinyin_parse_double_pinyin(pinyin_instance_t * instance,
return pinyin_len == parse_len;
}
-bool pinyin_parse_more_double_pinyins(pinyin_instance_t * instance,
- const char * pinyins){
+size_t pinyin_parse_more_double_pinyins(pinyin_instance_t * instance,
+ const char * pinyins){
pinyin_context_t * & context = instance->m_context;
int pinyin_len = strlen(pinyins);
@@ -269,7 +269,7 @@ bool pinyin_parse_more_double_pinyins(pinyin_instance_t * instance,
( context->m_validator, instance->m_pinyin_keys,
instance->m_pinyin_poses, pinyins, pinyin_len);
- return pinyin_len == parse_len;
+ return parse_len;
}
bool pinyin_parse_chewing(pinyin_instance_t * instance,
@@ -283,8 +283,8 @@ bool pinyin_parse_chewing(pinyin_instance_t * instance,
return chewing_len == parse_len;
}
-bool pinyin_parse_more_chewings(pinyin_instance_t * instance,
- const char * chewings){
+size_t pinyin_parse_more_chewings(pinyin_instance_t * instance,
+ const char * chewings){
pinyin_context_t * & context = instance->m_context;
int chewing_len = strlen(chewings);
@@ -292,7 +292,7 @@ bool pinyin_parse_more_chewings(pinyin_instance_t * instance,
( context->m_validator, instance->m_pinyin_keys,
instance->m_pinyin_poses, chewings, chewing_len);
- return chewing_len == parse_len;
+ return parse_len;
}
diff --git a/src/pinyin.h b/src/pinyin.h
index 1d65416..b144ef1 100644
--- a/src/pinyin.h
+++ b/src/pinyin.h
@@ -63,20 +63,20 @@ bool pinyin_get_sentence(pinyin_instance_t * instance,
bool pinyin_parse_full_pinyin(pinyin_instance_t * instance,
const char * onepinyin,
PinyinKey * onekey);
-bool pinyin_parse_more_full_pinyins(pinyin_instance_t * instance,
- const char * pinyins);
+size_t pinyin_parse_more_full_pinyins(pinyin_instance_t * instance,
+ const char * pinyins);
bool pinyin_parse_double_pinyin(pinyin_instance_t * instance,
const char * onepinyin,
PinyinKey * onekey);
-bool pinyin_parse_more_double_pinyins(pinyin_instance_t * instance,
- const char * pinyins);
+size_t pinyin_parse_more_double_pinyins(pinyin_instance_t * instance,
+ const char * pinyins);
bool pinyin_parse_chewing(pinyin_instance_t * instance,
const char * onechewing,
PinyinKey * onekey);
-bool pinyin_parse_more_chewings(pinyin_instance_t * instance,
- const char * chewings);
+size_t pinyin_parse_more_chewings(pinyin_instance_t * instance,
+ const char * chewings);
bool pinyin_get_candidates(pinyin_instance_t * instance,
size_t offset,