setasign\SetaPDF2\Extractor\Result

Word This class represents a single word

File: /SetaPDF v2/Extractor/Result/Word.php
Old class name (alias): \SetaPDF_Extractor_Result_Word

Class hierarchy

Implements

Summary

Properties

$_bounds

The bounds of this word.

$_delimiterType

protected int Word::$_delimiterType

The delimiter type of the word.

$_filterId

protected ?string Word::$_filterId

The filter id of the first text item in.

$_parts

protected self[] Word::$_parts = array()

The initial words that were used to create this word.

$_word

protected array Word::$_word = array()

The resulting word in a specific encoding.


Static Methods

merge()

public static Word::merge (
self $a,
self $b,
string $resultingString = null
): self

Merges two Word instances into a new one.

The words text-content will be $resultingString.

Parameters
$a : self
 
$b : self
 
$resultingString : string

In UTF-8 encoding.

Exceptions

Throws \ReflectionException


Methods

__construct()

public Word::__construct (
\SetaPDF_Extractor_Result_Glyph[] $glyphs,
int $delimiterType = 0
)

The constructor.

Parameters
$glyphs : \SetaPDF_Extractor_Result_Glyph[]
 
$delimiterType : int
 
Exceptions

Throws \setasign\SetaPDF2\Core\Exception

__toString()

public Word::__toString (
void
): string

Implementation of the magic method __toString().

See

cleanUp()

public Word::cleanUp (
void
): void

Release memory and cycled references.

getBounds()

Get the bounds of this word.

getDelimiterType()

public Word::getDelimiterType (
void
): int

Get the delimiter type.

getFilterId()

public Word::getFilterId (
void
): ?string

Get the id of the filter instance that accepted this result.

getParts()

public Word::getParts (
void
): self[]

Get all parts of this word.

If the word is not created by several words, this method will return itself.

getString()

public Word::getString (
string $encoding = 'utf-8'
): string

Get the words string value in a specific encoding.

Parameters
$encoding : string
 

setDelimiterType()

public Word::setDelimiterType (
int $delimiterType
): void

Set the delimiter type.

Parameters
$delimiterType : int