[Groonga-commit] groonga/groonga-command at 4744e3c [fix-travis-ci-error] Add default_tokenizer reader

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Jan 13 17:21:42 JST 2016


Kouhei Sutou	2014-03-14 18:01:10 +0900 (Fri, 14 Mar 2014)

  New Revision: 4744e3cb2f2bffec818731243fb4165a43406b80
  https://github.com/groonga/groonga-command/commit/4744e3cb2f2bffec818731243fb4165a43406b80

  Message:
    Add default_tokenizer reader

  Modified files:
    lib/groonga/command/table-create.rb
    test/command/test-table-create.rb

  Modified: lib/groonga/command/table-create.rb (+6 -0)
===================================================================
--- lib/groonga/command/table-create.rb    2014-03-14 17:59:32 +0900 (fc0f15d)
+++ lib/groonga/command/table-create.rb    2014-03-14 18:01:10 +0900 (2b621e5)
@@ -80,6 +80,12 @@ module Groonga
       def key_with_sis?
         flags.include?("KEY_WITH_SIS")
       end
+
+      # @return [String, nil] Default tokenizer name or nil.
+      # @since 1.0.7
+      def default_tokenizer
+        self[:default_tokenizer]
+      end
     end
   end
 end

  Modified: test/command/test-table-create.rb (+12 -0)
===================================================================
--- test/command/test-table-create.rb    2014-03-14 17:59:32 +0900 (ac2cc35)
+++ test/command/test-table-create.rb    2014-03-14 18:01:10 +0900 (a05742c)
@@ -161,4 +161,16 @@ class TableCreateCommandTest < Test::Unit::TestCase
       end
     end
   end
+
+  class DefaultTokenizerTest < self
+    def test_specified
+      command = table_create_command({"default_tokenizer" => "TokenBigram"})
+      assert_equal("TokenBigram", command.default_tokenizer)
+    end
+
+    def test_omitted
+      command = table_create_command
+      assert_nil(command.default_tokenizer)
+    end
+  end
 end
-------------- next part --------------
HTML����������������������������...
Download 



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