Class FSABuilder
java.lang.Object
morfologik.fsa.builders.FSABuilder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDebug and information constants. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator<byte[]> A comparator comparing full byte arrays. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(byte[] sequence, int start, int len) Add a single sequence of bytes to the FSA.static FSAbuild(byte[][] input) Build a minimal, deterministic automaton from a sorted list of byte sequences.static FSABuild a minimal, deterministic automaton from an iterable list of byte sequences.complete()getInfo()
-
Field Details
-
LEXICAL_ORDERING
A comparator comparing full byte arrays. Unsigned byte comparisons ('C'-locale).
-
-
Constructor Details
-
FSABuilder
public FSABuilder() -
FSABuilder
public FSABuilder(int bufferGrowthSize) - Parameters:
bufferGrowthSize- Buffer growth size (in bytes) when constructing the automaton.
-
-
Method Details
-
add
public void add(byte[] sequence, int start, int len) Add a single sequence of bytes to the FSA. The input must be lexicographically greater than any previously added sequence.- Parameters:
sequence- The array holding input sequence of bytes.start- Starting offset (inclusive)len- Length of the input sequence (at least 1 byte).
-
complete
- Returns:
- Finalizes the construction of the automaton and returns it.
-
build
Build a minimal, deterministic automaton from a sorted list of byte sequences.- Parameters:
input- Input sequences to build automaton from.- Returns:
- Returns the automaton encoding all input sequences.
-
build
-
getInfo
- Returns:
- Returns various statistics concerning the FSA and its compilation.
- See Also:
-