Sha256: 33f2667bf911788e998eb66250cf0b5a52b8d8c065d294a2784285275efe4aa5
Contents?: true
Size: 921 Bytes
Versions: 87
Compression:
Stored size: 921 Bytes
Contents
module Picky # Try is used by # rake try[text,index,category] # to test how the text would be indexed and processed during a search. # class Try attr_reader :text, :specific def initialize text, index = nil, category = nil @text = text @specific = Picky::Indexes @specific = @specific[index.intern] if index @specific = @specific[category.intern] if category end def saved specific.tokenizer.tokenize(text.dup).first end def searched Picky::Tokenizer.searching.tokenize(text.dup).first end def output <<-OUTPUT \"#{text}\" is saved in the #{specific.identifier} index as #{saved} \"#{text}\" as a search will be tokenized as #{searched} (category qualifiers, e.g. title: are removed if they do not exist as a qualifier, so 'toitle:bla' -> 'bla') OUTPUT end def to_stdout puts output end end end
Version data entries
87 entries across 87 versions & 1 rubygems