Class: TextDetector::Executor
- Inherits:
-
Object
- Object
- TextDetector::Executor
- Defined in:
- lib/text_detector/executor.rb
Instance Method Summary collapse
- #detect(text) ⇒ Object
- #detect_all(text) ⇒ Object
-
#initialize(type, dictionary) ⇒ Executor
constructor
A new instance of Executor.
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 |