Sha256: b3daf6642dc904f519e07051f3a7ed940d56da0b47923b475d74ebbef523d73c

Contents?: true

Size: 603 Bytes

Versions: 7

Compression:

Stored size: 603 Bytes

Contents

module Picky

  module Tokenizers

    # The base indexing tokenizer.
    #
    # Override in indexing subclasses and define in configuration.
    #
    class Index < Base

      def self.default= new_default
        @default = new_default
      end
      def self.default
        @default ||= new
      end

      # Does not actually return a token, but a
      # symbol "token".
      #
      def tokens_for words
        words.collect! { |word| word.downcase! if downcase?; word.to_sym }
      end
      # Returns empty tokens.
      #
      def empty_tokens
        []
      end

    end

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
picky-3.0.1 lib/picky/tokenizers/index.rb
picky-3.0.0 lib/picky/tokenizers/index.rb
picky-3.0.0.pre5 lib/picky/tokenizers/index.rb
picky-3.0.0.pre4 lib/picky/tokenizers/index.rb
picky-3.0.0.pre3 lib/picky/tokenizers/index.rb
picky-3.0.0.pre2 lib/picky/tokenizers/index.rb
picky-3.0.0.pre1 lib/picky/tokenizers/index.rb