summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-10-22 16:31:42 +0800
committerPeng Wu <alexepico@gmail.com>2012-10-22 16:31:42 +0800
commit15d4a0e6298eca0def77b9d80d94ce6c4beccc95 (patch)
tree3ef98a1c1ec645e81a8aea2daafbf17ab8e08881
parentbf3f5d029bb0432fbae882b8d0465d7a9b01f896 (diff)
downloadlibpinyin-15d4a0e6298eca0def77b9d80d94ce6c4beccc95.tar.gz
libpinyin-15d4a0e6298eca0def77b9d80d94ce6c4beccc95.tar.xz
libpinyin-15d4a0e6298eca0def77b9d80d94ce6c4beccc95.zip
move back get_first_token
-rw-r--r--src/storage/phrase_large_table2.h14
-rw-r--r--utils/segment/spseg.cpp14
2 files changed, 14 insertions, 14 deletions
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. */