Language Converter
Finite-State Transducer implementation of MediaWiki LanguageConverter
Loading...
Searching...
No Matches
Wikimedia\LangConv\ZhReplacementMachine Class Reference
+ Inheritance diagram for Wikimedia\LangConv\ZhReplacementMachine:

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.)

Parameters
string$destCode
string$invertCode
Returns
bool whether this is a valid bracketing pair.

 
- 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.
 

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\LangConv\ZhReplacementMachine::__construct ( )

ReplacementMachine constructor.

Reimplemented from Wikimedia\LangConv\ReplacementMachine.

Member Function Documentation

◆ isValidCodePair()

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.)

Parameters
string$destCode
string$invertCode
Returns
bool whether this is a valid bracketing pair.

Reimplemented from Wikimedia\LangConv\ReplacementMachine.


The documentation for this class was generated from the following file: