Package com.yahoo.fsa

Class FSA.State

java.lang.Object
com.yahoo.fsa.FSA.State
Enclosing class:
FSA

public static class FSA.State extends Object
Thread local state object used to traverse a Finite-State Automaton.
  • 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

      public void delta(String string)
      Jumps ahead by string
    • tryDelta

      public boolean tryDelta(String string)
      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

      public void deltaWord(String string)
      Jumps ahead by a word - if this is not the first word, it must be preceeded by space.
    • tryDeltaWord

      public boolean tryDeltaWord(String string)
      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

      public ByteBuffer data()
    • dataString

      public String dataString()
    • hash

      public int hash()
    • lookup

      public ByteBuffer lookup(String str)
    • hasPerfectHash

      public boolean hasPerfectHash()