class Smartdict::Translator::LanguageDetector::Matcher

Public Class Methods

new(chars) click to toggle source
# File lib/smartdict/translator/language_detector.rb, line 61
def initialize(chars)
  @chars = chars + [" ", "-"]
end

Public Instance Methods

match?(word) click to toggle source
# File lib/smartdict/translator/language_detector.rb, line 65
def match?(word)
  word.each_char do |char|
    return false unless @chars.include? char
  end
  true
end