class SomethingLikeThat::Query

Holds a string phrase to be compared to other (candidate) MatchPhrases. Queries may be abbreviated/truncated; candidates should be complete.

Attributes

scorer[R]

Public Class Methods

new(phrase) click to toggle source
Calls superclass method
# File lib/something_like_that/query.rb, line 7
def initialize(phrase)
  super phrase
  @scorer = Scorer.new(self)
end

Public Instance Methods

match(candidate) click to toggle source
# File lib/something_like_that/query.rb, line 12
def match(candidate)
  scorer.score(MatchPhrase.new(candidate))
end
match?(candidate) click to toggle source
# File lib/something_like_that/query.rb, line 16
def match?(candidate)
  scorer.match?(MatchPhrase.new(candidate))
end