From: Peng Wu Date: Mon, 22 Oct 2012 08:31:42 +0000 (+0800) Subject: move back get_first_token X-Git-Tag: 0.8.91~78 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=15d4a0e6298eca0def77b9d80d94ce6c4beccc95;p=platform%2Fupstream%2Flibpinyin.git move back get_first_token --- diff --git a/src/storage/phrase_large_table2.h b/src/storage/phrase_large_table2.h index dd1a1e4..c853f48 100644 --- a/src/storage/phrase_large_table2.h +++ b/src/storage/phrase_large_table2.h @@ -130,6 +130,20 @@ static inline int reduce_tokens(PhraseTokens tokens, return num; } +/* for compatibility. */ +static inline int get_first_token(PhraseTokens tokens, + /* out */ phrase_token_t & token){ + token = null_token; + + GArray * tokenarray = g_array_new(FALSE, FALSE, sizeof(phrase_token_t)); + int num = reduce_tokens(tokens, tokenarray); + if (num) + token = g_array_index(tokenarray, phrase_token_t, 0); + g_array_free(tokenarray, TRUE); + + return num; +} + }; #endif diff --git a/utils/segment/spseg.cpp b/utils/segment/spseg.cpp index 6205369..85ba8f2 100644 --- a/utils/segment/spseg.cpp +++ b/utils/segment/spseg.cpp @@ -26,20 +26,6 @@ #include "pinyin_internal.h" #include "utils_helper.h" -/* for compatibility. */ -int get_first_token(PhraseTokens tokens, - /* out */ phrase_token_t & token){ - token = null_token; - - GArray * tokenarray = g_array_new(FALSE, FALSE, sizeof(phrase_token_t)); - int num = reduce_tokens(tokens, tokenarray); - if (num) - token = g_array_index(tokenarray, phrase_token_t, 0); - g_array_free(tokenarray, TRUE); - - return num; -} - /* graph shortest path sentence segment. */