public final class FSA5Serializer extends Object implements FSASerializer
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.
FSA5
,
FSA.read(java.io.InputStream)
Modifier and Type | Field and Description |
---|---|
byte |
annotationByte |
byte |
fillerByte |
Constructor and Description |
---|
FSA5Serializer() |
Modifier and Type | Method and Description |
---|---|
Set<FSAFlags> |
getFlags()
Return supported flags.
|
<T extends OutputStream> |
serialize(FSA fsa,
T os)
Serialize root state
s to an output stream in
FSA5 format. |
FSA5Serializer |
withAnnotationSeparator(byte annotationSeparator)
Supports built-in annotation separator.
|
FSA5Serializer |
withFiller(byte filler)
Supports built-in filler separator.
|
FSASerializer |
withLogger(IMessageLogger logger)
Log extra messages during construction.
|
FSA5Serializer |
withNumbers()
Serialize the automaton with the number of right-language sequences in
each node.
|
public byte fillerByte
FSA5.filler
public byte annotationByte
FSA5.annotation
public FSA5Serializer withNumbers()
withNumbers
in interface FSASerializer
public FSA5Serializer withFiller(byte filler)
FSASerializer.getFlags()
returns
FSAFlags.SEPARATORS
.withFiller
in interface FSASerializer
public FSA5Serializer withAnnotationSeparator(byte annotationSeparator)
FSASerializer.getFlags()
returns
FSAFlags.SEPARATORS
.withAnnotationSeparator
in interface FSASerializer
public FSASerializer withLogger(IMessageLogger logger)
withLogger
in interface FSASerializer
public <T extends OutputStream> T serialize(FSA fsa, T os) throws IOException
s
to an output stream in
FSA5
format.serialize
in interface FSASerializer
os
for chaining.IOException
withNumbers
public Set<FSAFlags> getFlags()
getFlags
in interface FSASerializer
Copyright © 2017. All rights reserved.