Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\Language\MachineLanguageGuesser Class Reference

Use a {@Link ReplacementMachine} to predict the best "source language" for every node in a DOM. More...

+ Inheritance diagram for Wikimedia\Parsoid\Language\MachineLanguageGuesser:
+ Collaboration diagram for Wikimedia\Parsoid\Language\MachineLanguageGuesser:

Public Member Functions

 __construct (FstReplacementMachine $machine, Node $root, $destCode)
 MachineLanguageGuesser constructor.
 
 guessLang (Element $node)
 
Parameters
Element$node
Returns
Bcp47Code predicted source language

 

Detailed Description

Use a {@Link ReplacementMachine} to predict the best "source language" for every node in a DOM.

Appropriate for wikis which are written in a mix of variants.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Parsoid\Language\MachineLanguageGuesser::__construct ( FstReplacementMachine $machine,
Node $root,
$destCode )

MachineLanguageGuesser constructor.

Parameters
FstReplacementMachine$machine
Node$root
Bcp47Code$destCodea language code

Member Function Documentation

◆ guessLang()

Wikimedia\Parsoid\Language\MachineLanguageGuesser::guessLang ( Element $node)

Parameters
Element$node
Returns
Bcp47Code predicted source language

Reimplemented from Wikimedia\Parsoid\Language\LanguageGuesser.


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