public final class FST<T> extends Object
The format is similar to what's used by Morfologik (http://sourceforge.net/projects/morfologik).
 See the package
      documentation for some simple examples.
| Modifier and Type | Class and Description | 
|---|---|
| static class  | FST.Arc<T>Represents a single arc. | 
| static class  | FST.BytesReaderReads bytes stored in an FST. | 
| static class  | FST.INPUT_TYPESpecifies allowed range of each int input label for
  this FST. | 
| Modifier and Type | Field and Description | 
|---|---|
| long | arcCount | 
| long | arcWithOutputCount | 
| static int | DEFAULT_MAX_BLOCK_BITS | 
| static int | END_LABELIf arc has this label then that arc is final/accepted | 
| FST.INPUT_TYPE | inputType | 
| long | nodeCount | 
| Outputs<T> | outputs | 
| Constructor and Description | 
|---|
| FST(DataInput in,
   Outputs<T> outputs)Load a previously saved FST. | 
| FST(DataInput in,
   Outputs<T> outputs,
   int maxBlockBits)Load a previously saved FST; maxBlockBits allows you to
  control the size of the byte[] pages used to hold the FST bytes. | 
| Modifier and Type | Method and Description | 
|---|---|
| FST.Arc<T> | findTargetArc(int labelToMatch,
             FST.Arc<T> follow,
             FST.Arc<T> arc,
             FST.BytesReader in)Finds an arc leaving the incoming arc, replacing the arc in place. | 
| long | getArcCount() | 
| long | getArcWithOutputCount() | 
| FST.BytesReader | getBytesReader()Returns a  FST.BytesReaderfor this FST, positioned at
  position 0. | 
| T | getEmptyOutput() | 
| FST.Arc<T> | getFirstArc(FST.Arc<T> arc)Fills virtual 'start' arc, ie, an empty incoming arc to
  the FST's start node | 
| FST.INPUT_TYPE | getInputType() | 
| long | getNodeCount() | 
| static <T> FST<T> | read(File file,
    Outputs<T> outputs)Reads an automaton from a file. | 
| FST.Arc<T> | readFirstRealTargetArc(long node,
                      FST.Arc<T> arc,
                      FST.BytesReader in) | 
| FST.Arc<T> | readFirstTargetArc(FST.Arc<T> follow,
                  FST.Arc<T> arc,
                  FST.BytesReader in)Follow the  followarc and read the first arc of its target;
 this changes the providedarc(2nd arg) in-place and returns
 it. | 
| FST.Arc<T> | readLastTargetArc(FST.Arc<T> follow,
                 FST.Arc<T> arc,
                 FST.BytesReader in)Follows the  followarc and reads the last
  arc of its target; this changes the providedarc(2nd arg) in-place and returns it. | 
| FST.Arc<T> | readNextArc(FST.Arc<T> arc,
           FST.BytesReader in)In-place read; returns the arc. | 
| int | readNextArcLabel(FST.Arc<T> arc,
                FST.BytesReader in)Peeks at next arc's label; does not alter arc. | 
| FST.Arc<T> | readNextRealArc(FST.Arc<T> arc,
               FST.BytesReader in)Never returns null, but you should never call this if
  arc.isLast() is true. | 
| void | readRootArcs(FST.Arc<T>[] arcs) | 
| void | save(DataOutput out) | 
| void | save(File file)Writes an automaton to a file. | 
| long | sizeInBytes()Returns bytes used to represent the FST | 
| static <T> boolean | targetHasArcs(FST.Arc<T> arc)returns true if the node at this address has any
  outgoing arcs | 
public final FST.INPUT_TYPE inputType
public long nodeCount
public long arcCount
public long arcWithOutputCount
public static final int END_LABEL
public static final int DEFAULT_MAX_BLOCK_BITS
public FST(DataInput in, Outputs<T> outputs) throws IOException
IOExceptionpublic FST(DataInput in, Outputs<T> outputs, int maxBlockBits) throws IOException
IOExceptionpublic FST.INPUT_TYPE getInputType()
public long sizeInBytes()
public void readRootArcs(FST.Arc<T>[] arcs) throws IOException
IOExceptionpublic T getEmptyOutput()
public void save(DataOutput out) throws IOException
IOExceptionpublic void save(File file) throws IOException
IOExceptionpublic static <T> FST<T> read(File file, Outputs<T> outputs) throws IOException
IOExceptionpublic static <T> boolean targetHasArcs(FST.Arc<T> arc)
public FST.Arc<T> getFirstArc(FST.Arc<T> arc)
public FST.Arc<T> readLastTargetArc(FST.Arc<T> follow, FST.Arc<T> arc, FST.BytesReader in) throws IOException
follow arc and reads the last
  arc of its target; this changes the provided
  arc (2nd arg) in-place and returns it.arc).IOExceptionpublic FST.Arc<T> readFirstTargetArc(FST.Arc<T> follow, FST.Arc<T> arc, FST.BytesReader in) throws IOException
follow arc and read the first arc of its target;
 this changes the provided arc (2nd arg) in-place and returns
 it.arc).IOExceptionpublic FST.Arc<T> readFirstRealTargetArc(long node, FST.Arc<T> arc, FST.BytesReader in) throws IOException
IOExceptionpublic FST.Arc<T> readNextArc(FST.Arc<T> arc, FST.BytesReader in) throws IOException
IOExceptionpublic int readNextArcLabel(FST.Arc<T> arc, FST.BytesReader in) throws IOException
IOExceptionpublic FST.Arc<T> readNextRealArc(FST.Arc<T> arc, FST.BytesReader in) throws IOException
IOExceptionpublic FST.Arc<T> findTargetArc(int labelToMatch, FST.Arc<T> follow, FST.Arc<T> arc, FST.BytesReader in) throws IOException
IOExceptionpublic long getNodeCount()
public long getArcCount()
public long getArcWithOutputCount()
public FST.BytesReader getBytesReader()
FST.BytesReader for this FST, positioned at
  position 0.Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.