LocaleField
extends BaseField
in package
The locale detected on the document.
Tags
Table of Contents
Properties
- $confidence : float
- $country : string|null
- $currency : string|null
- $language : string|null
- $pageId : int|null
- $reconstructed : bool
- $value : T|null
Methods
- __compare() : bool
- Compares with the value of another field.
- __construct() : mixed
- __toString() : string
- setConfidence() : void
- Sets the confidence score.
- getValue() : string|null
Properties
$confidence
public
float
$confidence
The confidence score.
$country
public
string|null
$country
The ISO 3166-1 alpha-2 code of the country.
$currency
public
string|null
$currency
The ISO 4217 code of the currency.
$language
public
string|null
$language
The ISO 639-1 code of the language.
$pageId
public
int|null
$pageId
The document page on which the information was found.
$reconstructed
public
bool
$reconstructed
= false
$value
public
T|null
$value
Raw field value.
Methods
__compare()
Compares with the value of another field.
public
__compare(BaseField<string|int, string|float|int|bool|Polygon> $obj) : bool
Parameters
Return values
bool__construct()
public
__construct(array<string, int|float|string|bool|null|array<string|int, mixed>> $rawPrediction[, int|null $pageId = null ][, bool $reconstructed = false ]) : mixed
Parameters
- $rawPrediction : array<string, int|float|string|bool|null|array<string|int, mixed>>
-
Raw prediction array.
- $pageId : int|null = null
-
Page number for multi pages document.
- $reconstructed : bool = false
-
Whether the field was reconstructed.
__toString()
public
__toString() : string
Return values
string —String representation.
setConfidence()
Sets the confidence score.
protected
setConfidence(array<string, int|float|string|bool|null|array<string|int, mixed>> $rawPrediction) : void
Parameters
- $rawPrediction : array<string, int|float|string|bool|null|array<string|int, mixed>>
-
Raw prediction array.
getValue()
private
static getValue(array<string, int|float|string|bool|null|array<string|int, mixed>> $localePrediction, string $key) : string|null
Parameters
- $localePrediction : array<string, int|float|string|bool|null|array<string|int, mixed>>
-
Raw locale prediction.
- $key : string
-
Name of the prediction key.