MediaWiki
1.30.2
|
Parser for rules of language conversion , parse rules in -{ }- tag. More...
Public Member Functions | |
__construct ( $text, $converter) | |
generateConvTable () | |
Generate conversion table for all text. More... | |
getConvTable () | |
Get conversion table. More... | |
getDisplay () | |
Get display text on markup -{...}-. More... | |
getFlags () | |
Get conversion flags. More... | |
getRuleConvertedStr ( $variant) | |
Parse rules conversion. More... | |
getRuleConvertedTitle ( $variant) | |
Similar to getRuleConvertedStr(), but this prefers to use original page title if $variant === $this->mConverter->mMainLanguageCode and may return false in this case (so this title conversion rule will be ignored and the original title is shown). More... | |
getRules () | |
Get conversion rules string. More... | |
getRulesAction () | |
Return how deal with conversion rules. More... | |
getRulesDesc () | |
getTextInBidtable ( $variants) | |
Check if variants array in convert array. More... | |
getTitle () | |
Get converted title. More... | |
hasRules () | |
Checks if there are conversion rules. More... | |
parse ( $variant=null) | |
Parse rules and flags. More... | |
parseFlags () | |
Parse flags with syntax -{FLAG| ... More... | |
parseRules () | |
Generate conversion table. More... | |
Public Attributes | |
$mBidtable = [] | |
$mConverter | |
$mConvTable = [] | |
$mFlags = [] | |
$mRuleDisplay = '' | |
$mRules = '' | |
$mRulesAction = 'none' | |
$mRuleTitle = false | |
$mText | |
$mUnidtable = [] | |
$mVariantFlags = [] | |
Parser for rules of language conversion , parse rules in -{ }- tag.
Definition at line 27 of file ConverterRule.php.
ConverterRule::__construct | ( | $text, | |
$converter | |||
) |
string | $text | The text between -{ and }- |
LanguageConverter | $converter |
Definition at line 44 of file ConverterRule.php.
ConverterRule::generateConvTable | ( | ) |
Generate conversion table for all text.
Definition at line 277 of file ConverterRule.php.
References $mBidtable, $mUnidtable, as, and getTextInBidtable().
Referenced by parse().
ConverterRule::getConvTable | ( | ) |
Get conversion table.
(bidirectional and unidirectional conversion table)
Definition at line 481 of file ConverterRule.php.
References $mConvTable.
ConverterRule::getDisplay | ( | ) |
Get display text on markup -{...}-.
Definition at line 456 of file ConverterRule.php.
References $mRuleDisplay.
ConverterRule::getFlags | ( | ) |
Get conversion flags.
Definition at line 497 of file ConverterRule.php.
References $mFlags.
ConverterRule::getRuleConvertedStr | ( | $variant | ) |
Parse rules conversion.
string | $variant |
Definition at line 213 of file ConverterRule.php.
References $mBidtable, $mRules, $mUnidtable, captcha-old\count, and getTextInBidtable().
Referenced by getRuleConvertedTitle(), and parse().
ConverterRule::getRuleConvertedTitle | ( | $variant | ) |
Similar to getRuleConvertedStr(), but this prefers to use original page title if $variant === $this->mConverter->mMainLanguageCode and may return false in this case (so this title conversion rule will be ignored and the original title is shown).
string | $variant | The variant code to display page title in |
Definition at line 253 of file ConverterRule.php.
References getRuleConvertedStr(), and getTextInBidtable().
Referenced by parse().
ConverterRule::getRules | ( | ) |
Get conversion rules string.
Definition at line 489 of file ConverterRule.php.
References $mRules.
ConverterRule::getRulesAction | ( | ) |
Return how deal with conversion rules.
Definition at line 472 of file ConverterRule.php.
References $mRulesAction.
ConverterRule::getRulesDesc | ( | ) |
Definition at line 189 of file ConverterRule.php.
References as.
Referenced by parse().
ConverterRule::getTextInBidtable | ( | $variants | ) |
Check if variants array in convert array.
array | string | $variants | Variant language code |
Definition at line 55 of file ConverterRule.php.
Referenced by generateConvTable(), getRuleConvertedStr(), and getRuleConvertedTitle().
ConverterRule::getTitle | ( | ) |
Get converted title.
Definition at line 464 of file ConverterRule.php.
References $mRuleTitle.
ConverterRule::hasRules | ( | ) |
ConverterRule::parse | ( | $variant = null | ) |
Parse rules and flags.
string | $variant | Variant language code |
Definition at line 335 of file ConverterRule.php.
References $flags, $mFlags, $mRules, as, generateConvTable(), getRuleConvertedStr(), getRuleConvertedTitle(), getRulesDesc(), parseFlags(), parseRules(), true, and wfMessage().
ConverterRule::parseFlags | ( | ) |
Parse flags with syntax -{FLAG| ...
}-
Definition at line 72 of file ConverterRule.php.
References $flags, $mText, as, captcha-old\count, StringUtils\explode(), and true.
Referenced by parse().
ConverterRule::parseRules | ( | ) |
Generate conversion table.
Definition at line 135 of file ConverterRule.php.
References $mRules, as, and captcha-old\count.
Referenced by parse().
ConverterRule::$mBidtable = [] |
Definition at line 37 of file ConverterRule.php.
Referenced by generateConvTable(), and getRuleConvertedStr().
ConverterRule::$mConverter |
Definition at line 29 of file ConverterRule.php.
ConverterRule::$mConvTable = [] |
Definition at line 36 of file ConverterRule.php.
Referenced by getConvTable().
ConverterRule::$mFlags = [] |
Definition at line 34 of file ConverterRule.php.
Referenced by getFlags(), and parse().
ConverterRule::$mRuleDisplay = '' |
Definition at line 30 of file ConverterRule.php.
Referenced by getDisplay().
ConverterRule::$mRules = '' |
Definition at line 32 of file ConverterRule.php.
Referenced by getRuleConvertedStr(), getRules(), parse(), and parseRules().
ConverterRule::$mRulesAction = 'none' |
Definition at line 33 of file ConverterRule.php.
Referenced by getRulesAction().
ConverterRule::$mRuleTitle = false |
Definition at line 31 of file ConverterRule.php.
Referenced by getTitle().
ConverterRule::$mText |
Definition at line 28 of file ConverterRule.php.
Referenced by parseFlags().
ConverterRule::$mUnidtable = [] |
Definition at line 38 of file ConverterRule.php.
Referenced by generateConvTable(), and getRuleConvertedStr().
ConverterRule::$mVariantFlags = [] |
Definition at line 35 of file ConverterRule.php.