summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-09-06 11:06:29 +0800
committerPeng Wu <alexepico@gmail.com>2011-09-06 11:06:29 +0800
commitdbdfd3b658f0f723513fd08415d08554d125f302 (patch)
tree5a4f779f19716f209ce79a4cf668584bfa531e0e /src
parent2f401a29ab5317e5b1a7621fde958559bb355433 (diff)
downloadlibpinyin-dbdfd3b658f0f723513fd08415d08554d125f302.tar.gz
libpinyin-dbdfd3b658f0f723513fd08415d08554d125f302.tar.xz
libpinyin-dbdfd3b658f0f723513fd08415d08554d125f302.zip
update pinyin header
Diffstat (limited to 'src')
-rw-r--r--src/include/novel_types.h3
-rw-r--r--src/lookup/pinyin_lookup.h1
-rw-r--r--src/pinyin.h38
3 files changed, 32 insertions, 10 deletions
diff --git a/src/include/novel_types.h b/src/include/novel_types.h
index 62063ba..2c11752 100644
--- a/src/include/novel_types.h
+++ b/src/include/novel_types.h
@@ -150,6 +150,9 @@ typedef double parameter_t;
typedef GArray * TokenVector;
typedef TokenVector MatchResults;
+/* Array of lookup_constraint_t */
+typedef GArray * CandidateConstraints;
+
};
#endif
diff --git a/src/lookup/pinyin_lookup.h b/src/lookup/pinyin_lookup.h
index a6f89e6..f96aa66 100644
--- a/src/lookup/pinyin_lookup.h
+++ b/src/lookup/pinyin_lookup.h
@@ -63,7 +63,6 @@ struct lookup_constraint_t{
};
};
-typedef GArray * CandidateConstraints; /* Array of lookup_constraint_t */
/* Note:
* winner tree for beam search.
diff --git a/src/pinyin.h b/src/pinyin.h
index cff0663..57c2dba 100644
--- a/src/pinyin.h
+++ b/src/pinyin.h
@@ -39,11 +39,20 @@ void pinyin_fini(pinyin_context_t * context);
bool pinyin_set_options(pinyin_context_t * context,
PinyinCustomSettings * custom);
-bool pinyin_set_pinyin_keys(pinyin_context_t * context,
- PinyinKeyVector pinyin_keys);
-bool pinyin_get_guessed_sentence(pinyin_context_t * context,
- char ** sentence);
+bool pinyin_update_constraints(pinyin_context_t * context,
+ PinyinKeyVector pinyin_keys,
+ CandidateConstraints constraints);
+
+bool pinyin_get_guessed_tokens(pinyin_context_t * context,
+ PinyinKeyVector pinyin_keys,
+ CandidateConstraints constraints,
+ MatchResults match_results);
+
+bool pinyin_get_sentence(pinyin_context_t * context,
+ MatchResults match_results,
+ char ** sentence);
+
bool pinyin_parse_full(pinyin_context_t * context,
const char * onepinyin,
PinyinKey * onekey);
@@ -58,13 +67,21 @@ bool pinyin_parse_more_doubles(pinyin_context_t * context,
PinyinKeyVector pinyin_keys);
bool pinyin_get_candidates(pinyin_context_t * context,
- size_t offset, TokenVector candidates);
+ size_t offset,
+ PinyinKeyVector pinyin_keys,
+ TokenVector candidates);
+
bool pinyin_choose_candidate(pinyin_context_t * context,
- size_t offset, phrase_token_t token);
+ size_t offset,
+ PinyinKeyVector pinyin_keys,
+ CandidateConstraints constraints,
+ phrase_token_t token);
bool pinyin_clear_constraint(pinyin_context_t * context,
- size_t offset);
-bool pinyin_clear_constraints(pinyin_context_t * context);
+ size_t offset,
+ CandidateConstraints constraints);
+bool pinyin_clear_constraints(pinyin_context_t * context,
+ CandidateConstraints constraints);
bool pinyin_phrase_segment(pinyin_context_t * context,
const char * sentence,
@@ -72,7 +89,10 @@ bool pinyin_phrase_segment(pinyin_context_t * context,
bool pinyin_translate_token(pinyin_context_t * context,
phrase_token_t token, char ** word);
-bool pinyin_train(pinyin_context_t * context);
+bool pinyin_train(pinyin_context_t * context,
+ PinyinKeyVector pinyin_keys,
+ CandidateConstraints constraints,
+ MatchResults match_results);
bool pinyin_save(pinyin_context_t * context);
bool pinyin_reset(pinyin_context_t * context);