public final class FSATraversal extends Object
Constructor and Description |
---|
FSATraversal(FSA fsa)
Traversals of the given FSA.
|
Modifier and Type | Method and Description |
---|---|
MatchResult |
match(byte[] sequence) |
MatchResult |
match(byte[] sequence,
int node) |
MatchResult |
match(byte[] sequence,
int start,
int length,
int node)
Finds a matching path in the dictionary for a given sequence of labels
from
sequence and starting at node node . |
MatchResult |
match(MatchResult result,
byte[] sequence,
int start,
int length,
int node)
Same as
match(byte[], int, int, int) , but allows passing
a reusable MatchResult object so that no intermediate garbage is
produced. |
int |
perfectHash(byte[] sequence) |
int |
perfectHash(byte[] sequence,
int start,
int length,
int node)
Calculate perfect hash for a given input sequence of bytes.
|
public FSATraversal(FSA fsa)
public int perfectHash(byte[] sequence, int start, int length, int node)
FSA
is built with FSAFlags.NUMBERS
and corresponds to the sequential
order of input sequences used at automaton construction time.start
- Start index in the sequence array.length
- Length of the byte sequence, must be at least 1.MatchResult
.public int perfectHash(byte[] sequence)
perfectHash(byte[], int, int, int)
public MatchResult match(MatchResult result, byte[] sequence, int start, int length, int node)
match(byte[], int, int, int)
, but allows passing
a reusable MatchResult
object so that no intermediate garbage is
produced.result
, but with reset internal
type and other fields.public MatchResult match(byte[] sequence, int start, int length, int node)
sequence
and starting at node node
.sequence
- An array of labels to follow in the FSA.start
- Starting index in sequence
.length
- How many symbols to consider from sequence
?node
- Start node identifier in the FSA.match(byte [], int)
public MatchResult match(byte[] sequence, int node)
match(byte[], int, int, int)
public MatchResult match(byte[] sequence)
match(byte[], int, int, int)
Copyright © 2017. All rights reserved.