MediaWiki
1.30.2
|
Class allowing to explore structure of parsed wikitext. More...
Public Member Functions | |
__construct (ParserOutput $parserOutput) | |
getAuxiliaryText () | |
Get auxiliary text. More... | |
getDefaultSort () | |
Get the defaultsort property. More... | |
getMainText () | |
Get main text. More... | |
getOpeningText () | |
Get opening text. More... | |
headings () | |
Get headings on the page. More... | |
Static Public Member Functions | |
static | parseSettingsInMessage ( $message) |
Parse a message content into an array. More... | |
Private Member Functions | |
extractHeadingBeforeFirstHeading ( $text) | |
Get text before first heading. More... | |
extractWikitextParts () | |
Extract parts of the text - opening, main and auxiliary. More... | |
getIgnoredHeadings () | |
Get list of heading to ignore. More... | |
Private Attributes | |
string | $allText |
string[] | $auxiliaryElementSelectors |
selectors to elements that are considered auxiliary to article text for search More... | |
string[] | $auxText = [] |
string[] | $excludedElementSelectors |
selectors to elements that are excluded entirely from search More... | |
string | $openingText |
ParserOutput | $parserOutput |
Class allowing to explore structure of parsed wikitext.
Definition at line 8 of file WikiTextStructure.php.
WikiTextStructure::__construct | ( | ParserOutput | $parserOutput | ) |
ParserOutput | $parserOutput |
Definition at line 64 of file WikiTextStructure.php.
References $parserOutput.
|
private |
Get text before first heading.
string | $text |
Definition at line 188 of file WikiTextStructure.php.
References $matches.
Referenced by extractWikitextParts().
|
private |
Extract parts of the text - opening, main and auxiliary.
Definition at line 145 of file WikiTextStructure.php.
References as, and extractHeadingBeforeFirstHeading().
Referenced by getAuxiliaryText(), getMainText(), and getOpeningText().
WikiTextStructure::getAuxiliaryText | ( | ) |
Get auxiliary text.
Definition at line 239 of file WikiTextStructure.php.
References $auxText, and extractWikitextParts().
WikiTextStructure::getDefaultSort | ( | ) |
Get the defaultsort property.
Definition at line 248 of file WikiTextStructure.php.
|
private |
Get list of heading to ignore.
Definition at line 125 of file WikiTextStructure.php.
References $lines, $source, parseSettingsInMessage(), and wfMessage().
Referenced by headings().
WikiTextStructure::getMainText | ( | ) |
Get main text.
Definition at line 230 of file WikiTextStructure.php.
References $allText, and extractWikitextParts().
WikiTextStructure::getOpeningText | ( | ) |
Get opening text.
Definition at line 221 of file WikiTextStructure.php.
References $openingText, and extractWikitextParts().
WikiTextStructure::headings | ( | ) |
Get headings on the page.
Definition at line 81 of file WikiTextStructure.php.
References as, and getIgnoredHeadings().
|
static |
Parse a message content into an array.
This function is generally used to parse settings stored as i18n messages (see search-ignored-headings).
string | $message |
Definition at line 113 of file WikiTextStructure.php.
References $lines.
Referenced by getIgnoredHeadings().
|
private |
Definition at line 16 of file WikiTextStructure.php.
Referenced by getMainText().
|
private |
selectors to elements that are considered auxiliary to article text for search
Definition at line 48 of file WikiTextStructure.php.
|
private |
Definition at line 20 of file WikiTextStructure.php.
Referenced by getAuxiliaryText().
|
private |
selectors to elements that are excluded entirely from search
Definition at line 29 of file WikiTextStructure.php.
|
private |
Definition at line 12 of file WikiTextStructure.php.
Referenced by getOpeningText().
|
private |
Definition at line 24 of file WikiTextStructure.php.
Referenced by __construct().