View Source Tesserax.Command (Tesserax v0.1.2)
Builds a command containing information about Tesseract and which image to read.
Examples
command = Tesserax.Command.make_command(
image: File.read("path/to/image"),
languages: ["eng", "hin"],
tessdata: "path/to/tessdata/dir",
config: "path/to/config/file",
psm: psm_value,
oem: oem_value
)
Tesserax.Command.image(command)
#=> <<...>>
Tesserax.Command.languages(command)
#=> "eng+hin"
Tesserax.Command.tessdata(command)
#=> "path/to/tessdata/dir"
Tesserax.Command.config(command)
#=> "path/to/config/file"
Tesserax.Command.psm(command)
#=> psm_value
Tesserax.Command.oem(command)
#=> oem_value
Summary
Functions
Fetches the config file path from the command.
Fetches image field from the command.
Fetches the languages from the command.
Builds a command with available options: :image
, :languages
, :tessdata
, :config
, :psm
, :oem
.
Fetches the oem value from the command.
Prepares a command. Returns a map with non-nil
values from the command.
Fetches the psm value from the command.
Fetches the tessdata path from the command.
Fetches all values from a command.
Types
Functions
Fetches the config file path from the command.
Fetches image field from the command.
Fetches the languages from the command.
Builds a command with available options: :image
, :languages
, :tessdata
, :config
, :psm
, :oem
.
:image
is either the contents of an image (PNG format), or the path to an image.:languages
is the languages that Tesseract should recognize with, either a list or a string.:tessdata
is the path to tessdata dir.:config
is the path to the config file.:psm
is an integer representing Page Segmentation Mode in Tesseract.:oem
is an integer representing Ocr Engine Mode in Tesseract. Ignores invalid options.
Examples
Tesserax.Command.make_command(
image: File.read!("path/to/image"),
languages: ["eng", "hin"],
tessdata: "path/to/tessdata/dir",
config: "path/to/config/file",
psm: 0,
oem: 0
)
Fetches the oem value from the command.
Prepares a command. Returns a map with non-nil
values from the command.
Fetches the psm value from the command.
Fetches the tessdata path from the command.
Fetches all values from a command.