Documentation

PositionField extends BaseField
in package

A field indicating a position or area on the document.

Tags
extends

Table of Contents

Properties

$boundingBox  : Polygon|null
$confidence  : float
$pageId  : int|null
$polygon  : Polygon|null
$quadrangle  : Polygon|null
$reconstructed  : bool
$rectangle  : Polygon|null
$value  : T|null

Methods

__compare()  : bool
Compares with the value of another field.
__construct()  : mixed
__toString()  : string
setConfidence()  : void
Sets the confidence score.
getPolygon()  : Polygon|null
Retrieves the polygon of a prediction.
getQuadrilateral()  : Polygon|null
Retrieves the quadrilateral of a prediction.

Properties

$boundingBox

public Polygon|null $boundingBox

Straight rectangle of cropped area (does not exceed the canvas).

$pageId

public int|null $pageId

The document page on which the information was found.

$quadrangle

public Polygon|null $quadrangle

Quadrangle of cropped area (does not exceed the canvas).

$reconstructed

public bool $reconstructed = false

$rectangle

public Polygon|null $rectangle

Oriented rectangle of cropped area (may exceed the canvas).

$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
$obj : BaseField<string|int, string|float|int|bool|Polygon>

Field to compare.

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 ][, string $valueKey = 'polygon' ]) : mixed
Parameters
$rawPrediction : array<string, int|float|string|bool|null|array<string|int, mixed>>

Raw prediction array.

$pageId : int|null = null

Page id.

$reconstructed : bool = false

Whether the field was reconstructed.

$valueKey : string = 'polygon'

Key to use for the value.

__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.

getPolygon()

Retrieves the polygon of a prediction.

private static getPolygon(array<string, int|float|string|bool|null|array<string|int, mixed>> $rawPrediction, string $key) : Polygon|null
Parameters
$rawPrediction : array<string, int|float|string|bool|null|array<string|int, mixed>>

Raw prediction array.

$key : string

Key to use for the value.

Return values
Polygon|null

getQuadrilateral()

Retrieves the quadrilateral of a prediction.

private static getQuadrilateral(array<string, int|float|string|bool|null|array<string|int, mixed>> $rawPrediction, string $key) : Polygon|null
Parameters
$rawPrediction : array<string, int|float|string|bool|null|array<string|int, mixed>>

Raw prediction array.

$key : string

Key to use for the value.

Return values
Polygon|null
On this page

Search results