Class: Tabula::Detectors::DetectionAlgorithm
- Inherits:
-
Object
- Object
- Tabula::Detectors::DetectionAlgorithm
- Defined in:
- lib/tabula/detectors/detection_algorithm.rb
Overview
Base class for table detection algorithms
Direct Known Subclasses
Class Method Summary collapse
-
.detect(page, **options) ⇒ Array<Rectangle>
Detect table areas on a page.
Instance Method Summary collapse
-
#detect(page) ⇒ Array<Rectangle>
Detect table areas on a page.
-
#initialize(**options) ⇒ DetectionAlgorithm
constructor
A new instance of DetectionAlgorithm.
-
#name ⇒ String
Get algorithm name.
Constructor Details
#initialize(**options) ⇒ DetectionAlgorithm
Returns a new instance of DetectionAlgorithm.
16 17 18 |
# File 'lib/tabula/detectors/detection_algorithm.rb', line 16 def initialize(**) @options = end |
Class Method Details
.detect(page, **options) ⇒ Array<Rectangle>
Detect table areas on a page
11 12 13 |
# File 'lib/tabula/detectors/detection_algorithm.rb', line 11 def self.detect(page, **) new(**).detect(page) end |
Instance Method Details
#detect(page) ⇒ Array<Rectangle>
Detect table areas on a page
23 24 25 |
# File 'lib/tabula/detectors/detection_algorithm.rb', line 23 def detect(page) raise NotImplementedError, 'Subclasses must implement #detect' end |
#name ⇒ String
Get algorithm name
29 30 31 |
# File 'lib/tabula/detectors/detection_algorithm.rb', line 29 def name self.class.name.split('::').last end |