PFABuilder

Concrete builder class for [[org.maraist.fa.DFA DFAs]] based on hash tables.

Type Params
S

The type of all states of the automaton

T

The type of labels on transitions of the automaton

Value members

Inherited methods

final
Inherited from
Growable
final
def +=(elem: PFAelements[S, T]): PFABuilder[S, T]
Inherited from
Growable
override
def accepts(s: Seq[T]): Boolean
Definition Classes
Inherited from
UnindexedPFA
override
def acceptsProb(ts: Seq[T]): Double
Definition Classes
Inherited from
PFABuilder
Inherited from
Growable
def addETransition(s1: S, s2: S, prob: Double): Unit
Inherited from
PFABuilder
def addFinalState(s: S, prob: Double): Unit
Inherited from
PFABuilder
def addInitialState(s: S, prob: Double): Unit
Inherited from
PFABuilder
override
def addOne(builder: PFAelements[S, T]): PFABuilder[S, T]
Definition Classes
Inherited from
PFABuilder
def addState(s: S): Unit
Inherited from
StatesMixin
def addTransition(s1: S, t: T, s2: S, prob: Double): Unit
Inherited from
PFABuilder
protected
def afterStatePlot(sb: StringBuilder, style: ProbabilisticAutomatonStyle[S, T], stateList: IndexedSeq[S], stateMap: Map[S, Int]): Unit
Inherited from
UnindexedFA
protected
def assemblePrettyTransition(before: Doc, arrow: Doc, after: Doc): Doc
Inherited from
UnindexedFA
protected
Inherited from
UnindexedFA
override
def clear(): Unit
Definition Classes
Inherited from
PFABuilder
protected
Inherited from
PFABuilder
def dump(out: PrintStream): Unit
Inherited from
UnindexedFA
def eTransition(s0: S, s1: S): Double
Inherited from
PFABuilder
override
Definition Classes
Inherited from
PFABuilder
def eTransitionProb(s0: S, s1: S): Double
Inherited from
PFABuilder
override protected
def edgeText(style: ProbabilisticAutomatonStyle[S, T], si0: Int, s0: S, si1: Int, s1: S): String
Definition Classes
Inherited from
UnindexedPFA
override protected
def edgeText(style: ProbabilisticAutomatonStyle[S, T], si0: Int, s0: S, ti0: Int, t: T, si1: Int, s1: S): String
Definition Classes
Inherited from
UnindexedPFA
Inherited from
PFABuilder
override

Returns the Set of final states in this automaton. For PFAs, this method returns the states which map via [[org.maraist.fa.PFA#finalStateProb]] to a non-zero probability.

Returns the Set of final states in this automaton. For PFAs, this method returns the states which map via [[org.maraist.fa.PFA#finalStateProb]] to a non-zero probability.

Definition Classes
Inherited from
UnindexedPFA
protected
Inherited from
UnindexedFA
def foreachETransition(action: (S, S, Double) => Unit): Unit
Inherited from
PFABuilder
override
def foreachETransition(action: (S, S) => Unit): Unit
Definition Classes
Inherited from
UnindexedPFA
def foreachFinalState(action: (S, Double) => Unit): Unit
Inherited from
PFABuilder
override
def foreachFinalState(action: S => Unit { def apply(s: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
def foreachInitialState(action: (S, Double) => Unit): Unit
Inherited from
PFABuilder
override
def foreachInitialState(action: S => Unit { def apply(s: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
def foreachState(action: (S, Double) => Unit): Unit
Inherited from
PFABuilder
override
def foreachState(action: S => Unit { def apply(s: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
def foreachTransition(action: (S, T, S, Double) => Unit): Unit
Inherited from
PFABuilder
override
def foreachTransition(action: (S, T, S) => Unit { def apply(s1: S, t: T, s2: S): Unit; }): Unit
Definition Classes
Inherited from
UnindexedFA
def graphviz(sourceFile: String, outputFile: String)(using options: ProbabilisticAutomatonStyle[S, T]): Unit

Use Graphviz to render this object as specified.

Use Graphviz to render this object as specified.

Inherited from
Graphable
def graphviz(fileRoot: String)(using options: ProbabilisticAutomatonStyle[S, T]): Unit

Use Graphviz to render this object (in the default format) to the given file.

Use Graphviz to render this object (in the default format) to the given file.

Inherited from
Graphable
protected
def initPlot(sb: StringBuilder, states: Int, labels: Int): Unit
Inherited from
UnindexedFA
Inherited from
PFABuilder
override

Returns the Set of initial states in this automaton. For PFAs, this method returns the states which map via [[org.maraist.fa.PFA#initialStateProb]] to a non-zero probability.

Returns the Set of initial states in this automaton. For PFAs, this method returns the states which map via [[org.maraist.fa.PFA#initialStateProb]] to a non-zero probability.

Definition Classes
Inherited from
UnindexedPFA
protected
def internalsToDOT(stateList: IndexedSeq[S], stateMap: Map[S, Int], theLabels: IndexedSeq[T], sb: StringBuilder)(using style: ProbabilisticAutomatonStyle[S, T]): Unit

Internal routine used by [[#toDOT]]. Subclesses may override, but still call super.internalsToDOT, to extend the Graphviz representation of a DFA.

Internal routine used by [[#toDOT]]. Subclesses may override, but still call super.internalsToDOT, to extend the Graphviz representation of a DFA.

Inherited from
UnindexedFA
override
Definition Classes
Inherited from
UnindexedPFA
override

Returns whether the given state s is initial in this automaton. For PFAs, this method returns true if s has a non-zero chance of being an initial state of the automaton.

Returns whether the given state s is initial in this automaton. For PFAs, this method returns true if s has a non-zero chance of being an initial state of the automaton.

Definition Classes
Inherited from
UnindexedPFA
def isState(s: S): Boolean
Inherited from
StatesMixin
Inherited from
Growable
def labels: Set[T]
Inherited from
PFABuilder
override
def map[S2, T2](stateMap: S => S2, transitionMap: T => T2): PFA[S2, T2, ProbabilisticAutomatonStyle]
Definition Classes
Inherited from
PFABuilder
def mapResult[NewTo](f: PFA[S, T] => NewTo): Builder[PFAelements[S, T], NewTo]
Inherited from
Builder
override
def mapStates[S2](stateMap: S => S2): PFA[S2, T, ProbabilisticAutomatonStyle]
Definition Classes
Inherited from
PFABuilder
override
def mapTransitions[T2](transitionMap: T => T2): PFA[S, T2, ProbabilisticAutomatonStyle]
Definition Classes
Inherited from
PFABuilder
Inherited from
PFABuilder
protected
Inherited from
UnindexedPFA
override protected
Definition Classes
Inherited from
UnindexedPFA
protected
def plotPresentEdge(sb: StringBuilder, style: ProbabilisticAutomatonStyle[S, T], stateList: IndexedSeq[S], stateMap: Map[S, Int], si0: Int, s0: S, si1: Int, s1: S): Unit
Inherited from
UnindexedFA
protected
def plotPresentEdge(sb: StringBuilder, style: ProbabilisticAutomatonStyle[S, T], stateList: IndexedSeq[S], stateMap: Map[S, Int], si0: Int, s0: S, ti0: Int, t: T, si1: Int, s1: S): Unit
Inherited from
UnindexedFA
protected
def plotState(sb: StringBuilder, style: ProbabilisticAutomatonStyle[S, T], si: Int, s: S, isInitial: Boolean, isFinal: Boolean): Unit
Inherited from
UnindexedFA
protected
def plotTransitions(stateList: IndexedSeq[S], stateMap: Map[S, Int], theLabels: IndexedSeq[T], sb: StringBuilder, style: ProbabilisticAutomatonStyle[S, T]): Unit
Inherited from
UnindexedFA
Inherited from
UnindexedPFA
def pretty: Doc
Inherited from
UnindexedFA
protected
def prettyETransition(src: S, dest: S): Doc
Inherited from
UnindexedFA
protected
def prettyETransitionArrow(src: S, dest: S): Doc
Inherited from
UnindexedFA
protected
def prettyFooter: Doc
Inherited from
UnindexedFA
protected
def prettyHeader: Doc
Inherited from
UnindexedFA
protected
def prettyState(s: S): Doc
Inherited from
UnindexedFA
protected
def prettyStateInTransition(state: S): Doc
Inherited from
UnindexedFA
protected
def prettyStateLeader(s: S): Doc
Inherited from
UnindexedFA
protected
def prettyStates: Doc
Inherited from
UnindexedFA
protected
def prettyTransition(src: S, label: T, dest: S): Doc
Inherited from
UnindexedFA
protected
def prettyTransitionArrow(src: S, label: T, dest: S): Doc
Inherited from
UnindexedFA
protected
Inherited from
UnindexedFA
def removeETransition(s1: S, s2: S): Unit
Inherited from
PFABuilder
Definition Classes
Inherited from
PFABuilder
Inherited from
PFABuilder
Inherited from
PFABuilder
def removeState(s: S): Unit
Inherited from
StatesMixin
def removeTransition(s1: S, t: T, s2: S): Unit
Inherited from
PFABuilder
def result(): PFA[S, T]
Inherited from
PFABuilder
def size: Int
Inherited from
StatesMixin
final
def sizeHint(coll: IterableOnce[_], delta: Int): Unit
Inherited from
Builder
def sizeHint(size: Int): Unit
Inherited from
Builder
final
def sizeHintBounded(size: Int, boundingColl: Iterable[_]): Unit
Inherited from
Builder
def states: Set[S]
Inherited from
StatesMixin
override
Definition Classes
UnindexedFA -> Graphable
Inherited from
UnindexedFA
override
Definition Classes
Inherited from
UnindexedPFA
def transition(s0: S, t: T): Map[S, Double]
Inherited from
PFABuilder
def transition(s0: S, t: T, s1: S): Double
Inherited from
PFABuilder
def transitionProb(s0: S, t: T, s1: S): Double
Inherited from
PFABuilder
override
Definition Classes
Inherited from
UnindexedFA
override
def transitions(s: S, t: T): Set[S]
Definition Classes
Inherited from
UnindexedPFA

Deprecated and Inherited methods

@inline @deprecated(message = "Use `++=` aka `addAll` instead of varargs `+=`; infix operations with an operand of multiple args will be deprecated", since = "2.13.0")
final
def +=(elem1: PFAelements[S, T], elem2: PFAelements[S, T], elems: PFAelements[S, T]*): PFABuilder[S, T]
Deprecated
[Since version 2.13.0] Use `++=` aka `addAll` instead of varargs `+=`; infix operations with an operand of multiple args will be deprecated
Inherited from
Growable

Inherited fields

protected

Storage for all state objects

Storage for all state objects

Inherited from
StatesMixin
Inherited from
PFABuilder
protected
Inherited from
PFABuilder
protected
Inherited from
PFABuilder
Inherited from
PFABuilder