[Groonga-commit] groonga/groonga at 32a48cc [master] tokenizer: add token_mode in grn_tokenizer_query

Back to archive index

naoa null+****@clear*****
Fri Aug 15 14:49:25 JST 2014


naoa	2014-08-15 14:49:25 +0900 (Fri, 15 Aug 2014)

  New Revision: 32a48cce5b3c72f0d86f0140a5042bdac77ffe30
  https://github.com/groonga/groonga/commit/32a48cce5b3c72f0d86f0140a5042bdac77ffe30

  Merged f87c462: Merge pull request #193 from naoa/add-token-position-skip

  Message:
    tokenizer: add token_mode in grn_tokenizer_query

  Modified files:
    include/groonga/tokenizer.h
    lib/tokenizer.c

  Modified: include/groonga/tokenizer.h (+1 -0)
===================================================================
--- include/groonga/tokenizer.h    2014-08-15 14:45:38 +0900 (a35d55c)
+++ include/groonga/tokenizer.h    2014-08-15 14:49:25 +0900 (bfafdde)
@@ -83,6 +83,7 @@ struct _grn_tokenizer_query {
   unsigned int length;
   grn_encoding encoding;
   unsigned int flags;
+  unsigned int token_mode;
   grn_bool have_tokenized_delimiter;
 };
 

  Modified: lib/tokenizer.c (+6 -0)
===================================================================
--- lib/tokenizer.c    2014-08-15 14:45:38 +0900 (0767fd2)
+++ lib/tokenizer.c    2014-08-15 14:49:25 +0900 (37d2278)
@@ -102,6 +102,7 @@ grn_tokenizer_query_open(grn_ctx *ctx, int num_args, grn_obj **args,
 {
   grn_obj *flags = grn_ctx_pop(ctx);
   grn_obj *query_str = grn_ctx_pop(ctx);
+  grn_obj *token_mode = grn_ctx_pop(ctx);
 
   if (query_str == NULL) {
     GRN_PLUGIN_ERROR(ctx, GRN_INVALID_ARGUMENT, "missing argument");
@@ -126,6 +127,11 @@ grn_tokenizer_query_open(grn_ctx *ctx, int num_args, grn_obj **args,
     } else {
       query->flags = 0;
     }
+    if (token_mode) {
+      query->token_mode = GRN_UINT32_VALUE(token_mode);
+    } else {
+      query->token_mode = GRN_TOKEN_ADD;
+    }
 
     {
       grn_obj * const table = args[0];
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index