Class FSA5Serializer

    • Constructor Detail

      • FSA5Serializer

        public FSA5Serializer()
    • Method Detail

      • withNumbers

        public FSA5Serializer withNumbers()
        Serialize the automaton with the number of right-language sequences in each node. This is required to implement perfect hashing. The numbering also preserves the order of input sequences.
        Specified by:
        withNumbers in interface FSASerializer
        Returns:
        Returns the same object for easier call chaining.
      • serialize

        public <T extends OutputStream> T serialize​(FSA fsa,
                                                    T os)
                                             throws IOException
        Serialize root state s to an output stream in FSA5 format.
        Specified by:
        serialize in interface FSASerializer
        Type Parameters:
        T - A subclass of OutputStream, returned for chaining.
        Parameters:
        fsa - The automaton to serialize.
        os - The output stream to serialize to.
        Returns:
        Returns os for chaining.
        Throws:
        IOException - Rethrown if an I/O error occurs.
        See Also:
        withNumbers()
      • getFlags

        public Set<FSAFlags> getFlags()
        Return supported flags.
        Specified by:
        getFlags in interface FSASerializer
        Returns:
        Returns the set of flags supported by the serializer (and the output automaton).