Class: TextDetector::Executor

Inherits:
Object
  • Object
show all
Defined in:
lib/text_detector/executor.rb

Instance Method Summary collapse

Constructor Details

#initialize(type, dictionary) ⇒ Executor

Returns a new instance of Executor.



6
7
8
# File 'lib/text_detector/executor.rb', line 6

def initialize(type, dictionary)
  @detector = Detector.factory(type, Dictionary.factory(dictionary))
end

Instance Method Details

#detect(text) ⇒ Object



10
11
12
# File 'lib/text_detector/executor.rb', line 10

def detect(text)
  @detector.detect(TextDetector.shallow_normalize(text))
end

#detect_all(text) ⇒ Object



14
15
16
# File 'lib/text_detector/executor.rb', line 14

def detect_all(text)
  @detector.detect_all(TextDetector.shallow_normalize(text))
end