Language Converter
Finite-State Transducer implementation of MediaWiki LanguageConverter
Loading...
Searching...
No Matches
Wikimedia\LangConv\FST Class Reference

Load and execute a finite-state transducer (FST) based converter or bracketing machine from a compact string description. More...

Public Member Functions

 split (string $input, ?int $start=null, ?int $end=null)
 
 run (string $input, ?int $start=null, ?int $end=null, bool $unicode=false)
 

Static Public Member Functions

static compile (string $pfst, $justBrackets=false)
 Load an FST description and return a function which runs the machine.
 

Detailed Description

Load and execute a finite-state transducer (FST) based converter or bracketing machine from a compact string description.

Member Function Documentation

◆ compile()

static Wikimedia\LangConv\FST::compile ( string $pfst,
$justBrackets = false )
static

Load an FST description and return a function which runs the machine.

Parameters
string$pfstThe FST description as a filename (to be loaded synchronously)
bool$justBracketsThe machine will return an array of bracket locations, instead of the converted text.
Returns
FST

◆ run()

Wikimedia\LangConv\FST::run ( string $input,
?int $start = null,
?int $end = null,
bool $unicode = false )
Parameters
string$input
int | null$start
int | null$end
bool$unicode
Returns
string|array

◆ split()

Wikimedia\LangConv\FST::split ( string $input,
?int $start = null,
?int $end = null )
Parameters
string$input
int | null$start
int | null$end
Returns
array

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