Class BiSegGraph

java.lang.Object
org.apache.lucene.analysis.cn.smart.hhmm.BiSegGraph

class BiSegGraph extends Object
Graph representing possible token pairs (bigrams) at each start offset in the sentence.

For each start offset, a list of possible token pairs is stored.

  • Field Details

  • Constructor Details

    • BiSegGraph

      public BiSegGraph(SegGraph segGraph)
  • Method Details

    • generateBiSegGraph

      private void generateBiSegGraph(SegGraph segGraph)
    • isToExist

      public boolean isToExist(int to)
      Returns true if their is a list of token pairs at this offset (index of the second token)
      Parameters:
      to - index of the second token in the token pair
      Returns:
      true if a token pair exists
    • getToList

      public List<SegTokenPair> getToList(int to)
      Return a List of all token pairs at this offset (index of the second token)
      Parameters:
      to - index of the second token in the token pair
      Returns:
      List of token pairs.
    • addSegTokenPair

      public void addSegTokenPair(SegTokenPair tokenPair)
      Parameters:
      tokenPair - SegTokenPair
    • getToCount

      public int getToCount()
      Get the number of SegTokenPair entries in the table.
      Returns:
      number of SegTokenPair entries
    • getShortPath

      public List<SegToken> getShortPath()
      Find the shortest path with the Viterbi algorithm.
      Returns:
      List
    • toString

      public String toString()
      Overrides:
      toString in class Object