Class: Xberg::OcrStrategyScannedPages
- Inherits:
-
Data
- Object
- Data
- Xberg::OcrStrategyScannedPages
- Extended by:
- T::Sig
- Includes:
- OcrStrategy
- Defined in:
- lib/xberg/native.rb
Overview
Additionally OCR every page that looks like a scan.
Pages are graded on raster coverage, whether the text layer is invisible
or absent, the image codec, and the producer. Pages at or above
min_confidence are OCR'd; the rest keep native text and still go through
the Auto quality check.
Detects that a text layer came from a scanner, not whether it is accurate, so a page carrying a good sidecar is OCR'd too.
Instance Attribute Summary collapse
-
#min_confidence ⇒ Object
readonly
rubocop:disable Lint/UselessMethodDefinition.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#min_confidence ⇒ Object (readonly)
rubocop:disable Lint/UselessMethodDefinition
542 543 544 |
# File 'lib/xberg/native.rb', line 542 def min_confidence @min_confidence end |
Class Method Details
.from_hash(hash) ⇒ Object
558 559 560 |
# File 'lib/xberg/native.rb', line 558 def self.from_hash(hash) new(min_confidence: hash[:min_confidence] || hash["min_confidence"]) end |
Instance Method Details
#auto? ⇒ Boolean
552 |
# File 'lib/xberg/native.rb', line 552 def auto? = false |
#scanned_pages? ⇒ Boolean
554 555 556 |
# File 'lib/xberg/native.rb', line 554 def scanned_pages? = true # @param hash [Hash] deserialized from the native extension # @return [self] |