Class FSA5Serializer

java.lang.Object
morfologik.fsa.builders.FSA5Serializer
All Implemented Interfaces:
FSASerializer

public final class FSA5Serializer extends Object implements FSASerializer
Serializes in-memory FSA graphs to a binary format compatible with Jan Daciuk's fsa's package FSA5 format.

It is possible to serialize the automaton with numbers required for perfect hashing. See withNumbers() method.

See Also:
  • Field Details

    • MAX_ARC_SIZE

      private static final int MAX_ARC_SIZE
      Maximum number of bytes for a serialized arc.
      See Also:
    • MAX_NODE_DATA_SIZE

      private static final int MAX_NODE_DATA_SIZE
      Maximum number of bytes for per-node data.
      See Also:
    • SIZEOF_FLAGS

      private static final int SIZEOF_FLAGS
      Number of bytes for the arc's flags header (arc representation without the goto address).
      See Also:
    • flags

      private static final EnumSet<FSAFlags> flags
      Supported flags.
    • fillerByte

      public byte fillerByte
      See Also:
    • annotationByte

      public byte annotationByte
      See Also:
    • withNumbers

      private boolean withNumbers
      true if we should serialize with numbers.
      See Also:
    • offsets

      private com.carrotsearch.hppc.IntIntHashMap offsets
      A hash map of [state, offset] pairs.
    • numbers

      private com.carrotsearch.hppc.IntIntHashMap numbers
      A hash map of [state, right-language-count] pairs.
  • Constructor Details

    • FSA5Serializer

      public FSA5Serializer()
  • Method Details