Sha256: 12e32ce7393594477c0a55d718559adc2cfdd9e13e6770db0cd048f1987b1a7b
Contents?: true
Size: 791 Bytes
Versions: 22
Compression:
Stored size: 791 Bytes
Contents
module Picky 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.query_default.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
22 entries across 22 versions & 1 rubygems
Version | Path |
---|---|
picky-3.5.1 | lib/tasks/try.rb |
picky-3.5.0 | lib/tasks/try.rb |