Language Converter
Finite-State Transducer implementation of MediaWiki LanguageConverter
|
Public Member Functions | |||||||
__construct () | |||||||
ReplacementMachine constructor. | |||||||
isValidCodePair ( $destCode, $invertCode) | |||||||
Override this method in subclass if you want to limit the possible code pairs bracketed.(For example, zh has a large number of variants, but we typically want to use only a limited number of these as possible invert codes.)
| |||||||
Public Member Functions inherited from Wikimedia\LangConv\FstReplacementMachine | |||||||
__construct ( $baseLanguage, $codes) | |||||||
ReplacementMachine constructor. | |||||||
getCodes () | |||||||
Return the set of language codes supported. | |||||||
loadFST (string $filename, bool $justBrackets=false) | |||||||
Load a conversion machine from a pFST file with filename $filename from the fst directory. | |||||||
countBrackets (string $s, $destCode, $invertCode) | |||||||
Quantify a guess about the "native" language of string s . | |||||||
convert ( $document, $s, $destCode, $invertCode) | |||||||
Convert a string of text. | |||||||
Public Member Functions inherited from Wikimedia\LangConv\ReplacementMachine | |||||||
replace ( $textNode, $destCode, $invertCode) | |||||||
Replace the given text Node with converted text, protecting any markup which can't be round-tripped back to invertCode with appropriate synthetic language-converter markup. | |||||||
jsonEncode (array $obj) | |||||||
Allow client to customize the JSON encoding of data-mw-variant attributes. | |||||||
Wikimedia\LangConv\ZhReplacementMachine::__construct | ( | ) |
ReplacementMachine constructor.
Reimplemented from Wikimedia\LangConv\ReplacementMachine.
Wikimedia\LangConv\ZhReplacementMachine::isValidCodePair | ( | $destCode, | |
$invertCode ) |
Override this method in subclass if you want to limit the possible code pairs bracketed.(For example, zh has a large number of variants, but we typically want to use only a limited number of these as possible invert codes.)
string | $destCode | |
string | $invertCode |
Reimplemented from Wikimedia\LangConv\ReplacementMachine.