TextReadingService
in package
Service class for text reading display.
Tags
Table of Contents
Methods
- echoTerm() : void
- Print the output when the word is a term.
- mainWordLoop() : void
- Get all words and start the iterate over them.
- parseItem() : void
- Process each text item (can be punctuation, term, etc...)
- parseSentence() : int
- Check if a new sentence SPAN should be started.
Methods
echoTerm()
Print the output when the word is a term.
public
echoTerm(int $actcode, bool $showAll, string $spanid, string $hidetag, int $currcharcount, array<string, mixed> $record[, array<int, array{0: int, 1: string, 2: int}> &$exprs = array() ]) : void
Parameters
- $actcode : int
-
Action code, > 1 for multiword
- $showAll : bool
-
Show all words or not
- $spanid : string
-
ID for this span element
- $hidetag : string
-
Hide tag string
- $currcharcount : int
-
Current number of characters
- $record : array<string, mixed>
-
Various data from database
- $exprs : array<int, array{0: int, 1: string, 2: int}> = array()
-
Current expressions (passed by reference)
mainWordLoop()
Get all words and start the iterate over them.
public
mainWordLoop(int $textId, int $showAll) : void
Parameters
- $textId : int
-
ID of the text
- $showAll : int
-
Show all words or not (0 or 1)
parseItem()
Process each text item (can be punctuation, term, etc...)
public
parseItem(array<string, mixed> $record, int $showAll, int $currcharcount, bool $hide[, array<int, array{0: int, 1: string, 2: int}> &$exprs = array() ]) : void
Parameters
- $record : array<string, mixed>
-
Text item information
- $showAll : int
-
Show all words or not (0 or 1)
- $currcharcount : int
-
Current number of characters
- $hide : bool
-
Should some item be hidden, depends on $showAll
- $exprs : array<int, array{0: int, 1: string, 2: int}> = array()
-
Current expressions
parseSentence()
Check if a new sentence SPAN should be started.
public
parseSentence(int $sid, int $old_sid) : int
Parameters
- $sid : int
-
Sentence ID
- $old_sid : int
-
Old sentence ID
Return values
int —Sentence ID