Module: TextDetector::Detector

Defined in:
lib/text_detector/detector.rb,
lib/text_detector/detector/base.rb,
lib/text_detector/detector/regexp.rb,
lib/text_detector/detector/simple.rb

Defined Under Namespace

Classes: Base, Regexp, Simple

Class Method Summary collapse

Class Method Details

.factory(type, dictionary) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/text_detector/detector.rb', line 6

def self.factory(type, dictionary)
  case type
  when :simple
    TextDetector::Detector::Simple.new(dictionary)
  when :regexp
    TextDetector::Detector::Regexp.new(dictionary)
  else
    raise NameError
  end
end