laser.regularlanguage.util
Class FSAtoREConverter<L extends LabelInterface>

java.lang.Object
  extended by laser.regularlanguage.util.FSAtoREConverter<L>
Type Parameters:
L - The type of labels that the FSA and RE use
Direct Known Subclasses:
StringFSAtoREConverter

public class FSAtoREConverter<L extends LabelInterface>
extends java.lang.Object

The FSAtoREConverter class converts from the given FSA to the corresponding RE.

Author:
Heather M. Conboy (laser-software@cs.umass.edu)

Field Summary
protected  REFactory<L> reFactory_
          The REFactory to be used to create new REs
protected  RLFactory<L> rlFactory_
          The RLFactory to be used to convert from RE to FSA args
 
Constructor Summary
FSAtoREConverter(REFactory<L> reFactory, RLFactory<L> rlFactory)
          Creates a new FSAtoREConverter.
 
Method Summary
 RE<L> convert(RunnableFSAInterface<L> theFSA)
          Converts from the given FSA to the corresponding RE.
protected  GNFA<L> createGNFA(RunnableFSAInterface<L> theFSA)
          Converts the given FSA into the corresponding GNFA.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reFactory_

protected REFactory<L extends LabelInterface> reFactory_
The REFactory to be used to create new REs


rlFactory_

protected RLFactory<L extends LabelInterface> rlFactory_
The RLFactory to be used to convert from RE to FSA args

Constructor Detail

FSAtoREConverter

public FSAtoREConverter(REFactory<L> reFactory,
                        RLFactory<L> rlFactory)
Creates a new FSAtoREConverter.

Parameters:
reFactory - The REFactory to be used to create new REs (non-null)
rlFactory - The RLFactory to be used to convert between REs and FSAs (non-null)
Method Detail

convert

public RE<L> convert(RunnableFSAInterface<L> theFSA)
                                     throws FSAInterfaceException,
                                            REException
Converts from the given FSA to the corresponding RE.

PRECONDITIONS:

Parameters:
theFSA - The FSA to be converted
Returns:
The corresponding RE
Throws:
FSAInterfaceException - if an FSA related error occurs
REException - if an RE related error occurs

createGNFA

protected GNFA<L> createGNFA(RunnableFSAInterface<L> theFSA)
Converts the given FSA into the corresponding GNFA.

Parameters:
theFSA - The FSA to be converted
Returns:
The corresponding GNFA