Class: Xberg::OcrStrategyScannedPages

Inherits:
Data
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#min_confidenceObject (readonly)

Returns the value of attribute min_confidence



4647
4648
4649
# File 'lib/xberg/native.rb', line 4647

def min_confidence
  @min_confidence
end

Class Method Details

.from_hash(hash) ⇒ Object



4663
4664
4665
# File 'lib/xberg/native.rb', line 4663

def self.from_hash(hash)
  new(min_confidence: hash[:min_confidence] || hash["min_confidence"])
end

Instance Method Details

#auto?Boolean



4657
# File 'lib/xberg/native.rb', line 4657

def auto? = false

#scanned_pages?Boolean



4659
4660
4661
# File 'lib/xberg/native.rb', line 4659

def scanned_pages? = true
# @param hash [Hash] deserialized from the native extension
# @return [self]