[Groonga-commit] ranguba/rroonga at c70a491 [master] Use "token" instead of "term"

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Feb 10 15:33:35 JST 2017


Kouhei Sutou	2017-02-10 15:33:35 +0900 (Fri, 10 Feb 2017)

  New Revision: c70a491731628e48180162bc7515d9cd07a3c159
  https://github.com/ranguba/rroonga/commit/c70a491731628e48180162bc7515d9cd07a3c159

  Message:
    Use "token" instead of "term"

  Modified files:
    ext/groonga/rb-grn-index-column.c

  Modified: ext/groonga/rb-grn-index-column.c (+20 -20)
===================================================================
--- ext/groonga/rb-grn-index-column.c    2017-02-10 15:32:32 +0900 (88fa28f)
+++ ext/groonga/rb-grn-index-column.c    2017-02-10 15:33:35 +0900 (537f9ad)
@@ -966,11 +966,11 @@ rb_grn_index_column_open_cursor (int argc, VALUE *argv, VALUE self)
     grn_column_flags  column_flags;
     grn_obj          *range_object;
     grn_table_cursor *table_cursor = NULL;
-    grn_id            term_id = GRN_ID_NIL;
+    grn_id            token_id = GRN_ID_NIL;
     grn_id            rid_min = GRN_ID_NIL;
     grn_id            rid_max = GRN_ID_MAX;
     int               flags   = 0;
-    VALUE             rb_table_cursor_or_term;
+    VALUE             rb_table_cursor_or_token;
     VALUE             options;
     VALUE             rb_with_section, rb_with_weight, rb_with_position;
     VALUE             rb_table;
@@ -983,7 +983,7 @@ rb_grn_index_column_open_cursor (int argc, VALUE *argv, VALUE self)
                                     NULL, &range_object,
                                     NULL, NULL);
 
-    rb_scan_args(argc, argv, "11", &rb_table_cursor_or_term, &options);
+    rb_scan_args(argc, argv, "11", &rb_table_cursor_or_token, &options);
     rb_grn_scan_options(options,
                         "with_section", &rb_with_section,
                         "with_weight", &rb_with_weight,
@@ -992,30 +992,30 @@ rb_grn_index_column_open_cursor (int argc, VALUE *argv, VALUE self)
 
     rb_table     = GRNOBJECT2RVAL(Qnil, context, range_object, GRN_FALSE);
     rb_lexicon   = rb_funcall(self, rb_intern("table"), 0);
-    if (CBOOL2RVAL(rb_obj_is_kind_of(rb_table_cursor_or_term,
+    if (CBOOL2RVAL(rb_obj_is_kind_of(rb_table_cursor_or_token,
                                      rb_cGrnTableCursor))) {
-        VALUE rb_table_cursor = rb_table_cursor_or_term;
+        VALUE rb_table_cursor = rb_table_cursor_or_token;
         table_cursor = RVAL2GRNTABLECURSOR(rb_table_cursor, NULL);
-    } else if (CBOOL2RVAL(rb_obj_is_kind_of(rb_table_cursor_or_term,
+    } else if (CBOOL2RVAL(rb_obj_is_kind_of(rb_table_cursor_or_token,
                                             rb_cInteger))) {
-        VALUE rb_term_id = rb_table_cursor_or_term;
-        term_id = NUM2UINT(rb_term_id);
-    } else if (CBOOL2RVAL(rb_obj_is_kind_of(rb_table_cursor_or_term,
+        VALUE rb_token_id = rb_table_cursor_or_token;
+        token_id = NUM2UINT(rb_token_id);
+    } else if (CBOOL2RVAL(rb_obj_is_kind_of(rb_table_cursor_or_token,
                                             rb_cGrnRecord))) {
-        VALUE rb_term = rb_table_cursor_or_term;
-        term_id = NUM2UINT(rb_funcall(rb_term, rb_intern("id"), 0));
+        VALUE rb_token = rb_table_cursor_or_token;
+        token_id = NUM2UINT(rb_funcall(rb_token, rb_intern("id"), 0));
     } else {
-        VALUE rb_term_key = rb_table_cursor_or_term;
-        VALUE rb_term;
+        VALUE rb_token_key = rb_table_cursor_or_token;
+        VALUE rb_token;
 
-        rb_term = rb_funcall(rb_lexicon, rb_intern("[]"), 1, rb_term_key);
-        if (NIL_P(rb_term)) {
+        rb_token = rb_funcall(rb_lexicon, rb_intern("[]"), 1, rb_token_key);
+        if (NIL_P(rb_token)) {
             rb_raise(rb_eArgError,
-                     "nonexistent term key: %" PRIsVALUE ": %" PRIsVALUE,
-                     rb_term_key,
+                     "nonexistent token key: %" PRIsVALUE ": %" PRIsVALUE,
+                     rb_token_key,
                      self);
         }
-        term_id = NUM2UINT(rb_funcall(rb_term, rb_intern("id"), 0));
+        token_id = NUM2UINT(rb_funcall(rb_token, rb_intern("id"), 0));
     }
 
     column_flags = grn_column_get_flags(context, column);
@@ -1054,7 +1054,7 @@ rb_grn_index_column_open_cursor (int argc, VALUE *argv, VALUE self)
         grn_ii_cursor *ii_cursor;
         ii_cursor = grn_ii_cursor_open(context,
                                        ii,
-                                       term_id,
+                                       token_id,
                                        rid_min,
                                        rid_max,
                                        /* TODO: Require Groonga 7.0.1. */
@@ -1062,7 +1062,7 @@ rb_grn_index_column_open_cursor (int argc, VALUE *argv, VALUE self)
                                        flags);
         rb_cursor = rb_grn_inverted_index_cursor_to_ruby_object(context,
                                                                 ii_cursor,
-                                                                term_id,
+                                                                token_id,
                                                                 flags,
                                                                 rb_table,
                                                                 rb_lexicon);
-------------- next part --------------
HTML����������������������������...
Download 



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