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

A state in a mutable FST. More...

Public Member Functions

 __construct (int $id)
 Create a new state.
 
 addEdge (string $upper, string $lower, State $to)
 Add an edge from this state to another.
 
 writeATT ( $handle)
 Write the edges of this state to the given $handle as an AT&T format file.
 

Public Attributes

 $id
 
 $edges = []
 
 $isFinal = false
 

Detailed Description

A state in a mutable FST.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\LangConv\Construct\State::__construct ( int $id)

Create a new state.

Parameters
int$idThe index of this state in the parent MutableFST.

Member Function Documentation

◆ addEdge()

Wikimedia\LangConv\Construct\State::addEdge ( string $upper,
string $lower,
State $to )

Add an edge from this state to another.

Parameters
string$upperThe token on the upper side of the edge
string$lowerThe token on the lower side of the edge
State$toThe destination of the edge

◆ writeATT()

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

Write the edges of this state to the given $handle as an AT&T format file.

Parameters
resource$handle

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