[Groonga-commit] groonga/groonga at 89328e1 [master] dump: support normalizer with options

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Apr 17 15:45:13 JST 2018


Kouhei Sutou	2018-04-17 15:45:13 +0900 (Tue, 17 Apr 2018)

  New Revision: 89328e14d11d20cf8dc431472a45cf9de75e7837
  https://github.com/groonga/groonga/commit/89328e14d11d20cf8dc431472a45cf9de75e7837

  Message:
    dump: support normalizer with options

  Added files:
    test/command/suite/dump/schema/table/double_array_trie/normalizer_with_options.expected
    test/command/suite/dump/schema/table/double_array_trie/normalizer_with_options.test
    test/command/suite/dump/schema/table/hash/normalizer_with_options.expected
    test/command/suite/dump/schema/table/hash/normalizer_with_options.test
    test/command/suite/dump/schema/table/patricia_trie/normalizer_with_options.expected
    test/command/suite/dump/schema/table/patricia_trie/normalizer_with_options.test
  Modified files:
    lib/proc/proc_dump.c

  Modified: lib/proc/proc_dump.c (+5 -1)
===================================================================
--- lib/proc/proc_dump.c    2018-04-16 11:18:08 +0900 (b6bb29f13)
+++ lib/proc/proc_dump.c    2018-04-17 15:45:13 +0900 (47ab688ed)
@@ -785,8 +785,12 @@ dump_table(grn_ctx *ctx, grn_dumper *dumper, grn_obj *table)
     GRN_OBJ_FIN(ctx, &sub_output);
   }
   if (normalizer) {
+    grn_obj sub_output;
     GRN_TEXT_PUTS(ctx, dumper->output, " --normalizer ");
-    dump_obj_name(ctx, dumper, normalizer);
+    GRN_TEXT_INIT(&sub_output, 0);
+    grn_table_get_normalizer_string(ctx, table, &sub_output);
+    dump_optionable_obj_string(ctx, dumper, &sub_output);
+    GRN_OBJ_FIN(ctx, &sub_output);
   }
   if (table->header.type != GRN_TABLE_NO_KEY) {
     int n_token_filters;

  Added: test/command/suite/dump/schema/table/double_array_trie/normalizer_with_options.expected (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/dump/schema/table/double_array_trie/normalizer_with_options.expected    2018-04-17 15:45:13 +0900 (ddeca067c)
@@ -0,0 +1,4 @@
+table_create Users TABLE_DAT_KEY ShortText   --normalizer 'NormalizerNFKC100("unify_kana", true)'
+[[0,0.0,0.0],true]
+dump
+table_create Users TABLE_DAT_KEY ShortText --normalizer "NormalizerNFKC100(\"unify_kana\", true)"

  Added: test/command/suite/dump/schema/table/double_array_trie/normalizer_with_options.test (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/dump/schema/table/double_array_trie/normalizer_with_options.test    2018-04-17 15:45:13 +0900 (21ee68528)
@@ -0,0 +1,4 @@
+table_create Users TABLE_DAT_KEY ShortText \
+  --normalizer 'NormalizerNFKC100("unify_kana", true)'
+
+dump

  Added: test/command/suite/dump/schema/table/hash/normalizer_with_options.expected (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/dump/schema/table/hash/normalizer_with_options.expected    2018-04-17 15:45:13 +0900 (1fcba0708)
@@ -0,0 +1,4 @@
+table_create Users TABLE_HASH_KEY ShortText   --normalizer 'NormalizerNFKC100("unify_kana", true)'
+[[0,0.0,0.0],true]
+dump
+table_create Users TABLE_HASH_KEY ShortText --normalizer "NormalizerNFKC100(\"unify_kana\", true)"

  Added: test/command/suite/dump/schema/table/hash/normalizer_with_options.test (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/dump/schema/table/hash/normalizer_with_options.test    2018-04-17 15:45:13 +0900 (50774376b)
@@ -0,0 +1,4 @@
+table_create Users TABLE_HASH_KEY ShortText \
+  --normalizer 'NormalizerNFKC100("unify_kana", true)'
+
+dump

  Added: test/command/suite/dump/schema/table/patricia_trie/normalizer_with_options.expected (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/dump/schema/table/patricia_trie/normalizer_with_options.expected    2018-04-17 15:45:13 +0900 (121ff8985)
@@ -0,0 +1,4 @@
+table_create Users TABLE_PAT_KEY ShortText   --normalizer 'NormalizerNFKC100("unify_kana", true)'
+[[0,0.0,0.0],true]
+dump
+table_create Users TABLE_PAT_KEY ShortText --normalizer "NormalizerNFKC100(\"unify_kana\", true)"

  Added: test/command/suite/dump/schema/table/patricia_trie/normalizer_with_options.test (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/dump/schema/table/patricia_trie/normalizer_with_options.test    2018-04-17 15:45:13 +0900 (80757da17)
@@ -0,0 +1,4 @@
+table_create Users TABLE_PAT_KEY ShortText \
+  --normalizer 'NormalizerNFKC100("unify_kana", true)'
+
+dump
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180417/c8ea2264/attachment-0001.htm 



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