Class FSTTraversal
- java.lang.Object
-
- org.apache.pinot.segment.local.utils.nativefst.FSTTraversal
-
public final class FSTTraversal extends Object
This class implements some common matching and scanning operations on a generic FST.
-
-
Constructor Summary
Constructors Constructor Description FSTTraversal(FST fst)Traversals of the given FST.
-
Method Summary
Modifier and Type Method Description MatchResultmatch(byte[] sequence)MatchResultmatch(byte[] sequence, int node)MatchResultmatch(byte[] sequence, int start, int length, int node)Finds a matching path in the dictionary for a given sequence of labels fromsequenceand starting at nodenode.MatchResultmatch(MatchResult reuse, byte[] sequence, int start, int length, int node)Same asmatch(byte[], int, int, int), but allows passing a reusableMatchResultobject so that no intermediate garbage is produced.
-
-
-
Constructor Detail
-
FSTTraversal
public FSTTraversal(FST fst)
Traversals of the given FST.- Parameters:
fst- The target automaton for traversals.
-
-
Method Detail
-
match
public MatchResult match(MatchResult reuse, byte[] sequence, int start, int length, int node)
Same asmatch(byte[], int, int, int), but allows passing a reusableMatchResultobject so that no intermediate garbage is produced.- Parameters:
reuse- TheMatchResultto reuse.sequence- Input sequence to look for in the automaton.start- Start index in the sequence array.length- Length of the byte sequence, must be at least 1.node- The node to start traversal from, typically the root node.- Returns:
- The same object as
reuse, but with updated matchMatchResult._kindand other relevant fields.
-
match
public MatchResult match(byte[] sequence, int start, int length, int node)
Finds a matching path in the dictionary for a given sequence of labels fromsequenceand starting at nodenode.- Parameters:
sequence- Input sequence to look for in the automaton.start- Start index in the sequence array.length- Length of the byte sequence, must be at least 1.node- The node to start traversal from, typically the root node.- Returns:
MatchResultwith updated matchMatchResult._kind.
-
match
public MatchResult match(byte[] sequence, int node)
- Parameters:
sequence- Input sequence to look for in the automaton.node- The node to start traversal from, typically the root node.- Returns:
MatchResultwith updated matchMatchResult._kind.
-
match
public MatchResult match(byte[] sequence)
- Parameters:
sequence- Input sequence to look for in the automaton.- Returns:
MatchResultwith updated matchMatchResult._kind.
-
-