Class StringUnionOperations
- java.lang.Object
-
- org.apache.pinot.segment.local.utils.nativefst.automaton.StringUnionOperations
-
public final class StringUnionOperations extends Object
Operations for building minimal deterministic automata from sets of strings. The algorithm requires sorted input data, but is very fast (nearly linear with the input size). NOTE: This class is not used today but is a fast way of building automata so is kept for future uses of the library
-
-
Field Summary
Fields Modifier and Type Field Description static Comparator<CharSequence>LEXICOGRAPHIC_ORDERLexicographic order of input sequences.
-
Constructor Summary
Constructors Constructor Description StringUnionOperations()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(CharSequence current)Add another character sequence to this automaton.static Statebuild(CharSequence[] input)Build a minimal, deterministic automaton from a sorted list of strings.org.apache.pinot.segment.local.utils.nativefst.automaton.StringUnionOperations.StateWithTransitionLabelscomplete()Finalize the automaton and return the root state.
-
-
-
Field Detail
-
LEXICOGRAPHIC_ORDER
public static final Comparator<CharSequence> LEXICOGRAPHIC_ORDER
Lexicographic order of input sequences.
-
-
Method Detail
-
build
public static State build(CharSequence[] input)
Build a minimal, deterministic automaton from a sorted list of strings.
-
add
public void add(CharSequence current)
Add another character sequence to this automaton. The sequence must be lexicographically larger or equal compared to any previous sequences added to this automaton (the input must be sorted).
-
complete
public org.apache.pinot.segment.local.utils.nativefst.automaton.StringUnionOperations.StateWithTransitionLabels complete()
Finalize the automaton and return the root state. No more strings can be added to the builder after this call.- Returns:
- Root automaton state.
-
-