morfologik.fsa
Class FSAUtils

java.lang.Object
  extended by morfologik.fsa.FSAUtils

public final class FSAUtils
extends java.lang.Object

Other FSA-related utilities not directly associated with the class hierarchy.


Nested Class Summary
static class FSAUtils.IntIntHolder
           
 
Constructor Summary
FSAUtils()
           
 
Method Summary
static java.util.TreeMap<java.lang.Integer,java.lang.Integer> calculateFanOuts(FSA fsa, int root)
          Calculate fan-out ratio.
static java.util.ArrayList<byte[]> rightLanguage(FSA fsa, int state)
          All byte sequences generated as the right language of state.
static com.carrotsearch.hppc.IntIntOpenHashMap rightLanguageForAllStates(FSA fsa)
          Calculate the size of right language for each state in an FSA.
static java.lang.String toDot(FSA fsa, int node)
          Returns the right-language reachable from a given FSA node, formatted as an input for the graphviz package (expressed in the dot language).
static void toDot(java.io.Writer w, FSA fsa, int node)
          Saves the right-language reachable from a given FSA node, formatted as an input for the graphviz package (expressed in the dot language), to the given writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FSAUtils

public FSAUtils()
Method Detail

toDot

public static java.lang.String toDot(FSA fsa,
                                     int node)
Returns the right-language reachable from a given FSA node, formatted as an input for the graphviz package (expressed in the dot language).


toDot

public static void toDot(java.io.Writer w,
                         FSA fsa,
                         int node)
                  throws java.io.IOException
Saves the right-language reachable from a given FSA node, formatted as an input for the graphviz package (expressed in the dot language), to the given writer.

Throws:
java.io.IOException

rightLanguage

public static java.util.ArrayList<byte[]> rightLanguage(FSA fsa,
                                                        int state)
All byte sequences generated as the right language of state.


calculateFanOuts

public static java.util.TreeMap<java.lang.Integer,java.lang.Integer> calculateFanOuts(FSA fsa,
                                                                                      int root)
Calculate fan-out ratio.

Returns:
The returned array: result[outgoing-arcs]

rightLanguageForAllStates

public static com.carrotsearch.hppc.IntIntOpenHashMap rightLanguageForAllStates(FSA fsa)
Calculate the size of right language for each state in an FSA.