summaryrefslogtreecommitdiffstats
path: root/src/pinyin.h
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2017-02-09 15:44:35 +0800
committerPeng Wu <alexepico@gmail.com>2017-02-09 15:44:35 +0800
commit915bbf4b2719d4d4829a318e92538fd10e59a395 (patch)
tree704115a6ac13b72c0ffa7fe8f8d7eb3cc503d2e7 /src/pinyin.h
parent419d26da015f4348b758a7b15ec0df66ef251ded (diff)
downloadlibpinyin-915bbf4b2719d4d4829a318e92538fd10e59a395.tar.gz
libpinyin-915bbf4b2719d4d4829a318e92538fd10e59a395.tar.xz
libpinyin-915bbf4b2719d4d4829a318e92538fd10e59a395.zip
use nbest results in pinyin.cpp
Diffstat (limited to 'src/pinyin.h')
-rw-r--r--src/pinyin.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pinyin.h b/src/pinyin.h
index 9c86145..bde58c7 100644
--- a/src/pinyin.h
+++ b/src/pinyin.h
@@ -40,7 +40,7 @@ typedef struct _import_iterator_t import_iterator_t;
typedef struct _export_iterator_t export_iterator_t;
typedef enum _lookup_candidate_type_t{
- BEST_MATCH_CANDIDATE = 1,
+ NBEST_MATCH_CANDIDATE = 1,
NORMAL_CANDIDATE,
ZOMBIE_CANDIDATE,
PREDICTED_CANDIDATE,
@@ -351,6 +351,7 @@ bool pinyin_phrase_segment(pinyin_instance_t * instance,
/**
* pinyin_get_sentence:
* @instance: the pinyin instance.
+ * @index: the index of the nbest result.
* @sentence: the saved sentence in the instance.
* @returns: whether the sentence is already saved in the instance.
*
@@ -360,6 +361,7 @@ bool pinyin_phrase_segment(pinyin_instance_t * instance,
*
*/
bool pinyin_get_sentence(pinyin_instance_t * instance,
+ gint8 index,
char ** sentence);
/**
@@ -544,12 +546,13 @@ bool pinyin_lookup_tokens(pinyin_instance_t * instance,
/**
* pinyin_train:
* @instance: the pinyin instance.
+ * @index: the index of the nbest result.
* @returns: whether the sentence is trained.
*
* Train the current user input sentence.
*
*/
-bool pinyin_train(pinyin_instance_t * instance);
+bool pinyin_train(pinyin_instance_t * instance, gint8 index);
/**
* pinyin_reset: