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

A mutable FST. More...

Public Member Functions

 __construct (array $alphabet)
 Create a new MutableFST with the given alphabet.
 
 newState ()
 Add a new state to this FST.
 
 getStartState ()
 Return the start state of this FST.
 
 applyDown (array $input)
 Apply the given FST to the array of input tokens.
 
 applyUp (array $input)
 Apply the given FST to the array of input tokens.
 
 optimize ()
 Perform simple optimization on the FST, trimming unreachable states and attempting to combine edges containing epsilons.
 
 writeATT ( $handle)
 Write an AT&T format description of this FST to the given filehandle.
 

Public Attributes

const EPSILON = '@0@'
 Special alphabet symbol for nothing used in AT&T format FST files.
 
const UNKNOWN = '@_UNKNOWN_SYMBOL_@'
 Special alphabet symbol for upper-side ? used in AT&T format FST files.
 
const IDENTITY = '@_IDENTITY_SYMBOL_@'
 Special alphabet symbol for lower-side ? used in AT&T format FST files.
 

Detailed Description

A mutable FST.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\LangConv\Construct\MutableFST::__construct ( array $alphabet)

Create a new MutableFST with the given alphabet.

Parameters
string[]$alphabet

Member Function Documentation

◆ applyDown()

Wikimedia\LangConv\Construct\MutableFST::applyDown ( array $input)

Apply the given FST to the array of input tokens.

Symbols in 'upper' are matched and symbols in 'lower' are emitted.

Parameters
string[]$input
Returns
array<array<string>>

◆ applyUp()

Wikimedia\LangConv\Construct\MutableFST::applyUp ( array $input)

Apply the given FST to the array of input tokens.

Symbols in 'lower' are matched and symbols in 'upper' are emitted.

Parameters
string[]$input
Returns
array<array<string>>

◆ getStartState()

Wikimedia\LangConv\Construct\MutableFST::getStartState ( )

Return the start state of this FST.

Returns
State the start state.

◆ newState()

Wikimedia\LangConv\Construct\MutableFST::newState ( )

Add a new state to this FST.

Returns
State the new state.

◆ writeATT()

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

Write an AT&T format description of this FST to the given filehandle.

Parameters
resource$handle

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