summaryrefslogtreecommitdiffstats
path: root/src/lookup/lookup.h
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2016-05-25 15:50:39 +0800
committerPeng Wu <alexepico@gmail.com>2016-05-25 15:50:39 +0800
commit955b6ea0f53ce0f8708c08d113ea1c44478d685d (patch)
tree3030d2fe9c0fb7cb41ae72d278971cddaaf87374 /src/lookup/lookup.h
parente3b1c578005402c45cc27049fafe4c732f7e493c (diff)
downloadlibpinyin-955b6ea0f53ce0f8708c08d113ea1c44478d685d.tar.gz
libpinyin-955b6ea0f53ce0f8708c08d113ea1c44478d685d.tar.xz
libpinyin-955b6ea0f53ce0f8708c08d113ea1c44478d685d.zip
update search_*gram method
Diffstat (limited to 'src/lookup/lookup.h')
-rw-r--r--src/lookup/lookup.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lookup/lookup.h b/src/lookup/lookup.h
index bcc7006..902ed0d 100644
--- a/src/lookup/lookup.h
+++ b/src/lookup/lookup.h
@@ -37,13 +37,17 @@ typedef phrase_token_t lookup_key_t;
struct lookup_value_t{
/* previous and current tokens of the node */
phrase_token_t m_handles[2];
+ /* the sentence length */
+ gint32 m_length;
/* maximum possibility of current node */
gfloat m_poss;
/* trace back information for final step */
gint32 m_last_step;
lookup_value_t(gfloat poss = FLT_MAX){
- m_handles[0] = null_token; m_handles[1] = null_token;
+ m_handles[0] = null_token;
+ m_handles[1] = null_token;
+ m_length = 0;
m_poss = poss;
m_last_step = -1;
}