class OCR::Path

Constants

EXTENS

Public Class Methods

new(input_file) click to toggle source

Initialize your Input File.

@params [String] path to input file.

# File lib/simple-ocr/path.rb, line 9
def initialize(input_file)
        @input_file = input_file
end

Public Instance Methods

clean_image_path() click to toggle source

Clean your Input File

@return [String] Cleaned Image Path

# File lib/simple-ocr/path.rb, line 39
def clean_image_path
        duppath = duplicate_path
        duppath[get_filename] = "cleaned_"+get_filename+".png"
        duppath
end
duplicate_path() click to toggle source

Duplicate the input file path

@return [String] input file path

# File lib/simple-ocr/path.rb, line 23
def duplicate_path
        @input_file.dup
end
get_filename() click to toggle source

Get the FileName

@return [String] Filename

# File lib/simple-ocr/path.rb, line 48
def get_filename
        File.basename(@input_file)
end
image_path() click to toggle source

From PDF to Image conversion

@return [String] Converted Image Path

# File lib/simple-ocr/path.rb, line 30
def image_path
        duppath = duplicate_path
        duppath[name_exten[1]] = Path::EXTENS[:png]
        duppath
end
name_exten() click to toggle source

Split the Realname

@return [Array] name and extension

# File lib/simple-ocr/path.rb, line 16
def name_exten
        File.basename(@input_file).split(".")
end