[Groonga-commit] groonga/groonga at 416cad0 [master] schema: support normalizer

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Oct 20 11:31:03 JST 2015


Kouhei Sutou	2015-10-20 11:31:03 +0900 (Tue, 20 Oct 2015)

  New Revision: 416cad0cb9536fc4c7964a8739de6782de947f5e
  https://github.com/groonga/groonga/commit/416cad0cb9536fc4c7964a8739de6782de947f5e

  Message:
    schema: support normalizer

  Added files:
    test/command/suite/schema/tables/normalizer.test
  Copied files:
    test/command/suite/schema/tables/normalizer.expected
      (from test/command/suite/schema/tables/tokenizer.expected)
  Modified files:
    lib/proc.c
    test/command/suite/schema/tables/tokenizer.expected
    test/command/suite/schema/tables/type/array.expected
    test/command/suite/schema/tables/type/hash_table.expected
    test/command/suite/schema/tables/value_type/reference.expected
    test/command/suite/schema/tables/value_type/type.expected

  Modified: lib/proc.c (+12 -1)
===================================================================
--- lib/proc.c    2015-10-20 11:28:13 +0900 (26edd23)
+++ lib/proc.c    2015-10-20 11:31:03 +0900 (a23953c)
@@ -7539,6 +7539,14 @@ proc_schema_table_output_tokenizer(grn_ctx *ctx, grn_obj *table)
 }
 
 static void
+proc_schema_table_output_normalizer(grn_ctx *ctx, grn_obj *table)
+{
+  grn_obj *normalizer;
+  normalizer = grn_obj_get_info(ctx, table, GRN_INFO_NORMALIZER, NULL);
+  proc_schema_output_name(ctx, normalizer);
+}
+
+static void
 proc_schema_tables(grn_ctx *ctx)
 {
   grn_obj tables;
@@ -7559,7 +7567,7 @@ proc_schema_tables(grn_ctx *ctx)
 
     proc_schema_output_name(ctx, table);
 
-    GRN_OUTPUT_MAP_OPEN("table", 5);
+    GRN_OUTPUT_MAP_OPEN("table", 6);
 
     GRN_OUTPUT_CSTR("name");
     proc_schema_output_name(ctx, table);
@@ -7576,6 +7584,9 @@ proc_schema_tables(grn_ctx *ctx)
     GRN_OUTPUT_CSTR("tokenizer");
     proc_schema_table_output_tokenizer(ctx, table);
 
+    GRN_OUTPUT_CSTR("normalizer");
+    proc_schema_table_output_normalizer(ctx, table);
+
     GRN_OUTPUT_MAP_CLOSE();
   }
   GRN_OUTPUT_MAP_CLOSE();

  Copied: test/command/suite/schema/tables/normalizer.expected (+5 -4) 95%
===================================================================
--- test/command/suite/schema/tables/tokenizer.expected    2015-10-20 11:28:13 +0900 (31c87fc)
+++ test/command/suite/schema/tables/normalizer.expected    2015-10-20 11:31:03 +0900 (5aca588)
@@ -1,4 +1,4 @@
-table_create Terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
+table_create Tags TABLE_PAT_KEY ShortText --normalizer NormalizerAuto
 [[0,0.0,0.0],true]
 schema
 [
@@ -167,15 +167,16 @@ schema
       }
     },
     "tables": {
-      "Terms": {
-        "name": "Terms",
+      "Tags": {
+        "name": "Tags",
         "type": "patricia trie",
         "key_type": {
           "name": "ShortText",
           "type": "type"
         },
         "value_type": null,
-        "tokenizer": "TokenBigram"
+        "tokenizer": null,
+        "normalizer": "NormalizerAuto"
       }
     }
   }

  Added: test/command/suite/schema/tables/normalizer.test (+3 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/schema/tables/normalizer.test    2015-10-20 11:31:03 +0900 (21b8e96)
@@ -0,0 +1,3 @@
+table_create Tags TABLE_PAT_KEY ShortText --normalizer NormalizerAuto
+
+schema

  Modified: test/command/suite/schema/tables/tokenizer.expected (+2 -1)
===================================================================
--- test/command/suite/schema/tables/tokenizer.expected    2015-10-20 11:28:13 +0900 (31c87fc)
+++ test/command/suite/schema/tables/tokenizer.expected    2015-10-20 11:31:03 +0900 (c35fc17)
@@ -175,7 +175,8 @@ schema
           "type": "type"
         },
         "value_type": null,
-        "tokenizer": "TokenBigram"
+        "tokenizer": "TokenBigram",
+        "normalizer": null
       }
     }
   }

  Modified: test/command/suite/schema/tables/type/array.expected (+2 -1)
===================================================================
--- test/command/suite/schema/tables/type/array.expected    2015-10-20 11:28:13 +0900 (4bf3bcf)
+++ test/command/suite/schema/tables/type/array.expected    2015-10-20 11:31:03 +0900 (79e2129)
@@ -172,7 +172,8 @@ schema
         "type": "array",
         "key_type": null,
         "value_type": null,
-        "tokenizer": null
+        "tokenizer": null,
+        "normalizer": null
       }
     }
   }

  Modified: test/command/suite/schema/tables/type/hash_table.expected (+2 -1)
===================================================================
--- test/command/suite/schema/tables/type/hash_table.expected    2015-10-20 11:28:13 +0900 (3714826)
+++ test/command/suite/schema/tables/type/hash_table.expected    2015-10-20 11:31:03 +0900 (b5d3670)
@@ -175,7 +175,8 @@ schema
           "type": "type"
         },
         "value_type": null,
-        "tokenizer": null
+        "tokenizer": null,
+        "normalizer": null
       }
     }
   }

  Modified: test/command/suite/schema/tables/value_type/reference.expected (+4 -2)
===================================================================
--- test/command/suite/schema/tables/value_type/reference.expected    2015-10-20 11:28:13 +0900 (f71ea27)
+++ test/command/suite/schema/tables/value_type/reference.expected    2015-10-20 11:31:03 +0900 (25d465e)
@@ -177,7 +177,8 @@ schema
           "name": "Users",
           "type": "reference"
         },
-        "tokenizer": null
+        "tokenizer": null,
+        "normalizer": null
       },
       "Users": {
         "name": "Users",
@@ -187,7 +188,8 @@ schema
           "type": "type"
         },
         "value_type": null,
-        "tokenizer": null
+        "tokenizer": null,
+        "normalizer": null
       }
     }
   }

  Modified: test/command/suite/schema/tables/value_type/type.expected (+2 -1)
===================================================================
--- test/command/suite/schema/tables/value_type/type.expected    2015-10-20 11:28:13 +0900 (77e82a2)
+++ test/command/suite/schema/tables/value_type/type.expected    2015-10-20 11:31:03 +0900 (ee4941f)
@@ -175,7 +175,8 @@ schema
           "name": "Int32",
           "type": "type"
         },
-        "tokenizer": null
+        "tokenizer": null,
+        "normalizer": null
       }
     }
   }
-------------- next part --------------
HTML����������������������������...
Download 



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