Class BiSegGraph
java.lang.Object
org.apache.lucene.analysis.cn.smart.hhmm.BiSegGraph
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 Summary
FieldsModifier and TypeFieldDescriptionprivate static BigramDictionary
private Map
<Integer, ArrayList<SegTokenPair>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSegTokenPair
(SegTokenPair tokenPair) Add aSegTokenPair
private void
generateBiSegGraph
(SegGraph segGraph) Find the shortest path with the Viterbi algorithm.int
Get the number ofSegTokenPair
entries in the table.getToList
(int to) Return aList
of all token pairs at this offset (index of the second token)boolean
isToExist
(int to) Returns true if their is a list of token pairs at this offset (index of the second token)toString()
-
Field Details
-
tokenPairListTable
-
segTokenList
-
bigramDict
-
-
Constructor Details
-
BiSegGraph
-
-
Method Details
-
generateBiSegGraph
-
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
Return aList
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
Add aSegTokenPair
- Parameters:
tokenPair
-SegTokenPair
-
getToCount
public int getToCount()Get the number ofSegTokenPair
entries in the table.- Returns:
- number of
SegTokenPair
entries
-
getShortPath
Find the shortest path with the Viterbi algorithm.- Returns:
List
-
toString
-