TextStatisticsService
in package
Service class for text statistics operations.
Tags
Table of Contents
Methods
-
getTextWordCount()
: array{total: array
, expr: array , stat: array >, totalu: array , expru: array , statu: array >} - Return statistics about a list of text IDs.
- getTodoWordsContent() : string
- Prepare HTML interactions for the words left to do in this text.
- getTodoWordsCount() : int
- Return the number of words left to do in this text.
- filterOwnedTextIds() : array<string|int, int>
- Filter text IDs down to those the current user owns.
- ownsText() : bool
- Check if the current user owns the given text.
Methods
getTextWordCount()
Return statistics about a list of text IDs.
public
getTextWordCount(array<string|int, int> $textIds) : array{total: array, expr: array, stat: array>, totalu: array, expru: array, statu: array>}
It is useful for unknown percent with this fork.
Parameters
- $textIds : array<string|int, int>
-
Array of text IDs
Return values
array{total: arrayTotal number of words, number of expressions, statistics, total unique, number of unique expressions, unique statistics
getTodoWordsContent()
Prepare HTML interactions for the words left to do in this text.
public
getTodoWordsContent(int $textId) : string
Parameters
- $textId : int
-
Text ID
Tags
Return values
string —HTML result
getTodoWordsCount()
Return the number of words left to do in this text.
public
getTodoWordsCount(int $textId) : int
Parameters
- $textId : int
-
Text ID
Return values
int —Number of words
filterOwnedTextIds()
Filter text IDs down to those the current user owns.
private
filterOwnedTextIds(array<string|int, int> $textIds) : array<string|int, int>
Mirrors WordListService::filterOwnedWordIds — single user-scoped SELECT, return surviving IDs.
Parameters
- $textIds : array<string|int, int>
-
Array of text IDs
Return values
array<string|int, int> —Owned IDs (subset of $textIds)
ownsText()
Check if the current user owns the given text.
private
ownsText(int $textId) : bool
Parameters
- $textId : int
-
The text ID to check