Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\Language\SrConverter Class Reference
+ Inheritance diagram for Wikimedia\Parsoid\Language\SrConverter:
+ Collaboration diagram for Wikimedia\Parsoid\Language\SrConverter:

Public Member Functions

 loadDefaultTables ()
 
 findVariantLink ( $link, $nt, $ignoreOtherCond)
 
 guessVariant ( $text, $variant)
 Variant based on the ReplacementMachine's bracketing abilities.
 
- Public Member Functions inherited from Wikimedia\Parsoid\Language\LanguageConverter
 __construct (Language $language, string $langCode, array $variants, ?array $variantfallbacks=null, ?array $flags=null, ?array $manualLevel=null)
 
 getMachine ()
 Return the ReplacementMachine powering this conversion.
 
 setMachine (ReplacementMachine $machine)
 
 translate ( $fromVariant, $text, $toVariant)
 

Additional Inherited Members

- Static Public Member Functions inherited from Wikimedia\Parsoid\Language\LanguageConverter
static classFromCode (string $code, bool $fallback)
 Try to return a classname from a given code.
 
static loadLanguage (Env $env, Bcp47Code $lang, bool $fallback=false)
 
static maybeConvert (Env $env, Document $doc, ?Bcp47Code $htmlVariantLanguage, ?Bcp47Code $wtVariantLanguage)
 Convert the given document into $htmlVariantLanguage, if: 1) language converter is enabled on this wiki, and 2) the htmlVariantLanguage is specified, and it is a known variant (not a base language code)
 
static baseToVariant (Env $env, Node $rootNode, $htmlVariantLanguage, $wtVariantLanguage)
 Convert a text in the "base variant" to a specific variant, given by htmlVariantLanguage.
 
static implementsLanguageConversionBcp47 (Env $env, Bcp47Code $htmlVariantLanguage)
 Check if support for html variant conversion is implemented.
 
static autoConvertToAllVariants (Env $env, DOMDocument $doc, string $text)
 Convert a string in an unknown variant of the page language to all its possible variants.
 

Member Function Documentation

◆ findVariantLink()

Wikimedia\Parsoid\Language\SrConverter::findVariantLink ( $link,
$nt,
$ignoreOtherCond )

◆ guessVariant()

Wikimedia\Parsoid\Language\SrConverter::guessVariant ( $text,
$variant )

Variant based on the ReplacementMachine's bracketing abilities.

Parameters
string$text
Bcp47Code$varianta language code
Returns
bool

Reimplemented from Wikimedia\Parsoid\Language\LanguageConverter.

◆ loadDefaultTables()

Wikimedia\Parsoid\Language\SrConverter::loadDefaultTables ( )

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