class Abbyy::Models::ProcessTextFieldRequest

Overview

Request object for /processTextField API-method.

Included Modules

Defined in:

abbyy/models/process_text_field_request.cr

Constant Summary

ALLOWED_TEXT_TYPES = TextType.values - [TextType::Handprinted]
DEFAULT_DESCRIPTION = ""
DEFAULT_LANGUAGE = Language::English
DEFAULT_LETTER_SET = ""
DEFAULT_MARKING_TYPE = FieldMarkingType::SimpleText
DEFAULT_ONE_TEXT_LINE = false
DEFAULT_ONE_WORD_PER_TEXT_LINE = false
DEFAULT_PASSWORD = ""
DEFAULT_PLACEHOLDERS_COUNT = 1
DEFAULT_REG_EXP = ""
DEFAULT_REGION = Region.new(-1, -1, -1, -1)
DEFAULT_TEXT_TYPE = TextType::Normal
DEFAULT_WRITING_STYLE = WritingStyle::Default

Constructors

Instance Method Summary

Instance methods inherited from module Abbyy::Models::FileBody

body : HTTP::Client::BodyType body, file_path : String file_path, file_path=(file_path : String) file_path=

Constructor methods inherited from module Abbyy::Models::FileBody

new(file_path : String) new

Instance methods inherited from class Abbyy::Models::BaseRequest

body : HTTP::Client::BodyType body, params : Hash(String, String) params

Constructor Detail

def self.new(file_path : String, region : Region | Nil = nil, language : Language | Array(Language) | Nil = nil, letter_set : String | Nil = nil, reg_exp : String | Nil = nil, text_type : TextType | Array(TextType) | Nil = nil, one_text_line : Bool | Nil = nil, one_word_per_text_line : Bool | Nil = nil, marking_type : FieldMarkingType | Nil = nil, placeholders_count : Int32 | Nil = nil, writing_style : WritingStyle | Nil = nil, description : String | Nil = nil, pdf_password : String | Nil = nil) #

[View source]

Instance Method Detail

def description : String | Nil #

Contains the description of the processing task. Cannot contain more than 255 characters.

This parameter is not required.


[View source]
def description=(description : String | Nil) #

[View source]
def language : Language | Array(Language) | Nil #

Specifies recognition language of the document. This parameter can contain one language or several languages in an array, for example:

request.language = Language::Spanish
# or
request.language = [
  Language::English,
  Language::French,
  Language::German,
]

See the list of available recognition languages.

Note that not all languages are available for handprint recognition. The languages which are available for handprint recognition are marked with a special comment.

This parameter is not required.

Default value is Language::English.


[View source]
def language=(language : Language | Array(Language) | Nil) #

Specifies recognition language of the document. This parameter can contain one language or several languages in an array, for example:

request.language = Language::Spanish
# or
request.language = [
  Language::English,
  Language::French,
  Language::German,
]

See the list of available recognition languages.

Note that not all languages are available for handprint recognition. The languages which are available for handprint recognition are marked with a special comment.

This parameter is not required.

Default value is Language::English.


[View source]
def letter_set : String | Nil #

Specifies the letter set, which should be used during recognition. Contains a string with the letter set characters. For example, "ABCDabcd'-.". By default, the letter set of the language, specified in the language parameter, is used.

This parameter is not required.


[View source]
def letter_set=(letter_set : String | Nil) #

Specifies the letter set, which should be used during recognition. Contains a string with the letter set characters. For example, "ABCDabcd'-.". By default, the letter set of the language, specified in the language parameter, is used.

This parameter is not required.


[View source]
def marking_type : FieldMarkingType | Nil #

This property is valid only for the handprint recognition. Specifies the type of marking around letters (for example, underline, frame, box, etc.). By default, there is no marking around letters. The value can be one of the following:

Note: For correct handprint recognition specify the value of the #placeholders_count parameter.

This parameter is not required.

Default value is FieldMarkingType::SimpleText.


[View source]
def marking_type=(marking_type : FieldMarkingType | Nil) #

This property is valid only for the handprint recognition. Specifies the type of marking around letters (for example, underline, frame, box, etc.). By default, there is no marking around letters. The value can be one of the following:

Note: For correct handprint recognition specify the value of the #placeholders_count parameter.

This parameter is not required.

Default value is FieldMarkingType::SimpleText.


[View source]
def one_text_line : Bool | Nil #

Specifies whether the field contains only one text line. The value should be true, if there is one text line in the field; otherwise it should be false.

This parameter is not required.

Default value is false.


[View source]
def one_text_line=(one_text_line : Bool | Nil) #

Specifies whether the field contains only one text line. The value should be true, if there is one text line in the field; otherwise it should be false.

This parameter is not required.

Default value is false.


[View source]
def one_word_per_text_line : Bool | Nil #

Specifies whether the field contains only one word in each text line. The value should be true, if no text line contains more than one word (so the lines of text will be recognized as a single word); otherwise it should be false.

This parameter is not required.

Default value is false.


[View source]
def one_word_per_text_line=(one_word_per_text_line : Bool | Nil) #

Specifies whether the field contains only one word in each text line. The value should be true, if no text line contains more than one word (so the lines of text will be recognized as a single word); otherwise it should be false.

This parameter is not required.

Default value is false.


[View source]
def params : Hash(String, String) #

[View source]
def pdf_password : String | Nil #

Contains a password for accessing password-protected images in PDF format.

This parameter is not required.


[View source]
def pdf_password=(pdf_password : String | Nil) #

Contains a password for accessing password-protected images in PDF format.

This parameter is not required.


[View source]
def placeholders_count : Int32 | Nil #

Specifies the number of character cells for the field.

This property has a sense only for the field marking types (the #marking_type parameter) that imply splitting the text in cells.

Default value for this property is 1, but you should set the appropriate value to recognize the text correctly. #placeholders_count parameter.

This parameter is not required.


[View source]
def placeholders_count=(placeholders_count : Int32 | Nil) #

Specifies the number of character cells for the field.

This property has a sense only for the field marking types (the #marking_type parameter) that imply splitting the text in cells.

Default value for this property is 1, but you should set the appropriate value to recognize the text correctly. #placeholders_count parameter.

This parameter is not required.


[View source]
def reg_exp : String | Nil #

Specifies the regular expression which defines which words are allowed in the field and which are not. See the description of regular expressions. By default, the set of allowed words is defined by the dictionary of the language, specified in the #language parameter.

Note that regular expressions do not strictly limit the set of characters of the output result, i.e. the recognized value may contain characters which are not included into the regular expression. During recognition all hypotheses of a word recognition are checked against the specified regular expression. If a given recognition variant conforms to the expression, it has higher probability of being selected as final recognition output. But if there is no variant that matches regular expression, the result will not conform to the expression. If you want to limit the set of characters, which can be recognized, the best way to do it is to use letterSet parameter.

This parameter is not required.


[View source]
def reg_exp=(reg_exp : String | Nil) #

Specifies the regular expression which defines which words are allowed in the field and which are not. See the description of regular expressions. By default, the set of allowed words is defined by the dictionary of the language, specified in the #language parameter.

Note that regular expressions do not strictly limit the set of characters of the output result, i.e. the recognized value may contain characters which are not included into the regular expression. During recognition all hypotheses of a word recognition are checked against the specified regular expression. If a given recognition variant conforms to the expression, it has higher probability of being selected as final recognition output. But if there is no variant that matches regular expression, the result will not conform to the expression. If you want to limit the set of characters, which can be recognized, the best way to do it is to use letterSet parameter.

This parameter is not required.


[View source]
def region : Region | Nil #

Specifies the region of the text field on the image. The coordinates of the region are measured in pixels relative to the left top corner of the image and are specified in the following order: left, top, right, bottom. By default, the region of the whole image is used.

This parameter is not required.

Default value is Region.new(-1, -1, -1, -1).


[View source]
def region=(region : Region | Nil) #

Specifies the region of the text field on the image. The coordinates of the region are measured in pixels relative to the left top corner of the image and are specified in the following order: left, top, right, bottom. By default, the region of the whole image is used.

This parameter is not required.

Default value is Region.new(-1, -1, -1, -1).


[View source]
def region=(coordinates : Array(Int32)) #

[View source]
def text_type : TextType | Array(TextType) | Nil #

Specifies the type of the text on a page. This parameter may also contain several text types in an array, for example:

[TextType::Normal, TextType::Matrix]

The following values can be used:

  • TextType::Normal
  • TextType::Typewriter
  • TextType::Matrix
  • TextType::Index
  • TextType::OcrA
  • TextType::OcrB
  • TextType::E13b
  • TextType::Cmc7
  • TextType::Gothic

This parameter is not required.

Default value is TextType::Normal.


[View source]
def text_type=(text_type : TextType | Array(TextType) | Nil) #

[View source]
def writing_style : WritingStyle | Nil #

Provides additional information about handprinted letters writing style.

This parameter is not required.

Default value is WritingStyle::Default.


[View source]
def writing_style=(writing_style : WritingStyle | Nil) #

Provides additional information about handprinted letters writing style.

This parameter is not required.

Default value is WritingStyle::Default.


[View source]