[Groonga-commit] groonga/groonga [master] add a test for TokenBigramSplitSymbol.

Back to archive index

null+****@clear***** null+****@clear*****
2010年 7月 5日 (月) 16:46:26 JST


Kouhei Sutou	2010-07-05 07:46:26 +0000 (Mon, 05 Jul 2010)

  New Revision: 70070e253441b404ac897475a82e079949aa23d3

  Log:
    add a test for TokenBigramSplitSymbol.

  Modified files:
    test/unit/core/test-command-select.c

  Modified: test/unit/core/test-command-select.c (+28 -0)
===================================================================
--- test/unit/core/test-command-select.c    2010-07-05 06:58:25 +0000 (113f00c)
+++ test/unit/core/test-command-select.c    2010-07-05 07:46:26 +0000 (de9c610)
@@ -29,6 +29,7 @@ void test_vector_geo_point_with_query(void);
 void test_unmatched_output_columns(void);
 void test_vector_text(void);
 void test_nonexistent_id(void);
+void test_bigram_split_symbol_tokenizer(void);
 
 static gchar *tmp_directory;
 
@@ -270,3 +271,30 @@ test_nonexistent_id(void)
                                        "--output_columns '_id _key' "
                                        "--filter '_id == 100'"));
 }
+
+void
+test_bigram_split_symbol_tokenizer(void)
+{
+  assert_send_commands("table_create Softwares TABLE_HASH_KEY ShortText\n"
+                       "column_create Softwares comment "
+                       "COLUMN_SCALAR ShortText\n"
+                       "table_create Terms TABLE_PAT_KEY ShortText "
+                       "--default_tokenizer TokenBigramSplitSymbol\n"
+                       "column_create Terms Softwares_comment "
+                       "COLUMN_INDEX|WITH_POSITION Softwares comment\n"
+                       "load --table Softwares\n"
+                       "[\n"
+                       "[\"_key\", \"comment\"],\n"
+                       "[\"groonga\", \"うむ上々な仕上がりだね。\"],\n"
+                       "[\"Cutter\", \"使いやすいじゃないか。\"]\n"
+                       "[\"Senna\", \"悪くないね。上々だよ。\"]\n"
+                       "]");
+  cut_assert_equal_string("[[[2],"
+                           "[[\"_key\",\"ShortText\"]],"
+                           "[\"groonga\"],"
+                           "[\"Senna\"]]]",
+                          send_command("select Softwares "
+                                       "--output_columns '_key' "
+                                       "--match_columns comment "
+                                       "--query 上々"));
+}




Groonga-commit メーリングリストの案内
Back to archive index