Package com.yahoo.fsa
Class FSA.State
java.lang.Object
com.yahoo.fsa.FSA.State
- Enclosing class:
- FSA
Thread local state object used to traverse a Finite-State Automaton.
-
Method Summary
Modifier and TypeMethodDescriptiondata()
void
delta
(byte symbol) void
delta
(char chr) void
Jumps ahead by stringvoid
Jumps ahead by a word - if this is not the first word, it must be preceeded by space.int
hash()
boolean
boolean
isFinal()
boolean
boolean
isValid()
boolean
peekDelta
(byte symbol) Returns whether the given symbol would take us to a valid state, without changing the statevoid
start()
boolean
tryDelta
(byte symbol) boolean
Jumps ahead by string if that puts us into a valid state, does nothing otherwiseboolean
tryDeltaWord
(String string) Tries to jump ahead by one word.
-
Method Details
-
start
public void start() -
delta
public void delta(byte symbol) -
peekDelta
public boolean peekDelta(byte symbol) Returns whether the given symbol would take us to a valid state, without changing the state -
tryDelta
public boolean tryDelta(byte symbol) -
delta
public void delta(char chr) -
delta
Jumps ahead by string -
tryDelta
Jumps ahead by string if that puts us into a valid state, does nothing otherwise- Returns:
- whether we jumped to a valid state (true) or di nothing (false)
-
deltaWord
Jumps ahead by a word - if this is not the first word, it must be preceeded by space. -
tryDeltaWord
Tries to jump ahead by one word. If the given string is not the next complete valid word, nothing is done. -
isFinal
public boolean isFinal() -
isStartState
public boolean isStartState() -
isValid
public boolean isValid() -
data
-
dataString
-
hash
public int hash() -
lookup
-
hasPerfectHash
public boolean hasPerfectHash()
-