Class: DerivativeRodeo::Generators::WordCoordinatesGenerator
- Inherits:
-
BaseGenerator
- Object
- BaseGenerator
- DerivativeRodeo::Generators::WordCoordinatesGenerator
- Includes:
- HocrGenerator::RequiresExistingFile
- Defined in:
- lib/derivative_rodeo/generators/word_coordinates_generator.rb
Overview
Note:
Assumes that we’re receiving a HOCR file (generated via HocrGenerator).
Generate the word coordinates (as JSON) from the given input_uris.
Instance Attribute Summary
Attributes inherited from BaseGenerator
#input_uris, #output_extension, #output_location_template, #preprocessed_location_template
Instance Method Summary collapse
Methods included from HocrGenerator::RequiresExistingFile
#with_each_requisite_location_and_tmp_file_path
Methods inherited from BaseGenerator
#derive_preprocessed_template_from, #destination, #generated_files, #generated_uris, #initialize, #input_files, #run, #valid_instantiation?, #with_each_requisite_location_and_tmp_file_path
Constructor Details
This class inherits a constructor from DerivativeRodeo::Generators::BaseGenerator
Instance Method Details
#build_step(output_location:, input_tmp_file_path:) ⇒ StorageLocations::BaseLocation
22 23 24 25 26 |
# File 'lib/derivative_rodeo/generators/word_coordinates_generator.rb', line 22 def build_step(output_location:, input_tmp_file_path:, **) output_location.with_new_tmp_path do |output_tmp_file_path| convert_to_coordinates(path_to_hocr: input_tmp_file_path, path_to_coordinate: output_tmp_file_path) end end |