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

GENerate a REPLacement string FST. More...

Public Member Functions

 applyDown (string $input)
 For testing: apply the resulting FST to the given input string.
 
 applyUp (string $input)
 For testing: run the resulting FST "in reverse" against the given input string.
 
 __construct (string $name, array $replacementTable, string $fdPrefix='')
 Convert the given $replacementTable (strtr-style) to an FST.
 
 writeATT ( $handle)
 Write the FST to the given file handle in AT&T format.
 

Detailed Description

GENerate a REPLacement string FST.

Create an FST from a replacement string array (aka, as would be provided to str_tr or ReplacementArray in mediawiki core).

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\LangConv\Construct\GenReplFst::__construct ( string $name,
array $replacementTable,
string $fdPrefix = '' )

Convert the given $replacementTable (strtr-style) to an FST.

Parameters
string$name
array<string,string>$replacementTable
string$fdPrefixFlag diacritic feature prefix, for uniqueness

Member Function Documentation

◆ applyDown()

Wikimedia\LangConv\Construct\GenReplFst::applyDown ( string $input)

For testing: apply the resulting FST to the given input string.

Parameters
string$input
Returns
string[] The possible outputs.

◆ applyUp()

Wikimedia\LangConv\Construct\GenReplFst::applyUp ( string $input)

For testing: run the resulting FST "in reverse" against the given input string.

Parameters
string$input
Returns
string[] The possible outputs.

◆ writeATT()

Wikimedia\LangConv\Construct\GenReplFst::writeATT ( $handle)

Write the FST to the given file handle in AT&T format.

Parameters
resource$handle

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