move back get_first_token
authorPeng Wu <alexepico@gmail.com>
Mon, 22 Oct 2012 08:31:42 +0000 (16:31 +0800)
committerPeng Wu <alexepico@gmail.com>
Mon, 22 Oct 2012 08:31:42 +0000 (16:31 +0800)
src/storage/phrase_large_table2.h
utils/segment/spseg.cpp

index dd1a1e4..c853f48 100644 (file)
@@ -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
index 6205369..85ba8f2 100644 (file)
 #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. */