naoa
null+****@clear*****
Sat Nov 15 23:16:54 JST 2014
naoa 2014-11-15 23:16:54 +0900 (Sat, 15 Nov 2014) New Revision: 20c285fdacbd8e1d7381338244f7d7d71f794971 https://github.com/groonga/groonga/commit/20c285fdacbd8e1d7381338244f7d7d71f794971 Merged 3b849a0: Merge pull request #244 from naoa/add-token-force-prefix Message: Add "GRN_TOKENIZER_TOKEN_FORCE_PREFIX" It's useful in tokenizer plugin Modified files: include/groonga/tokenizer.h lib/ii.c lib/token_cursor.c Modified: include/groonga/tokenizer.h (+2 -0) =================================================================== --- include/groonga/tokenizer.h 2014-11-15 17:45:20 +0900 (400166d) +++ include/groonga/tokenizer.h 2014-11-15 23:16:54 +0900 (7908af6) @@ -183,6 +183,8 @@ typedef unsigned int grn_tokenizer_status; #define GRN_TOKENIZER_TOKEN_SKIP (0x01L<<4) /* GRN_TOKENIZER_TOKEN_SKIP_WITH_POSITION means that the token and postion is skipped */ #define GRN_TOKENIZER_TOKEN_SKIP_WITH_POSITION (0x01L<<5) +/* GRN_TOKENIZER_TOKEN_FORCE_PREIX that the token is used common prefix search */ +#define GRN_TOKENIZER_TOKEN_FORCE_PREFIX (0x01L<<6) /* * GRN_TOKENIZER_CONTINUE and GRN_TOKENIZER_LAST are deprecated. They Modified: lib/ii.c (+1 -0) =================================================================== --- lib/ii.c 2014-11-15 17:45:20 +0900 (e342c73) +++ lib/ii.c 2014-11-15 23:16:54 +0900 (c8bd83d) @@ -5431,6 +5431,7 @@ token_info_build(grn_ctx *ctx, grn_obj *lexicon, grn_ii *ii, const char *string, tis[(*n)++] = ti; while (token_cursor->status == GRN_TOKEN_DOING) { tid = grn_token_cursor_next(ctx, token_cursor); + if (token_cursor->force_prefix) { ef |= EX_PREFIX; } switch (token_cursor->status) { case GRN_TOKEN_DONE_SKIP : continue; Modified: lib/token_cursor.c (+1 -0) =================================================================== --- lib/token_cursor.c 2014-11-15 17:45:20 +0900 (b12217d) +++ lib/token_cursor.c 2014-11-15 23:16:54 +0900 (1ffa726) @@ -212,6 +212,7 @@ grn_token_cursor_next(grn_ctx *ctx, grn_token_cursor *token_cursor) } } #undef SKIP_FLAGS + if (status & GRN_TOKENIZER_TOKEN_FORCE_PREFIX) { token_cursor->force_prefix = 1; } if (token_cursor->curr_size == 0) { char tokenizer_name[GRN_TABLE_MAX_KEY_SIZE]; int tokenizer_name_length; -------------- next part -------------- HTML����������������������������...下载