Sha256: b0043a698c603620823b047a168a845df314019d42e79cf1240171f76acdba45
Contents?: true
Size: 791 Bytes
Versions: 23
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.to_sym] if index @specific = @specific[category.to_sym] 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
23 entries across 23 versions & 1 rubygems