Package org.apache.lucene.analysis.morph
Class ViterbiNBest.Lattice<U extends MorphData>
java.lang.Object
org.apache.lucene.analysis.morph.ViterbiNBest.Lattice<U>
- Enclosing class:
ViterbiNBest<T extends Token,U extends MorphData>
Yet another lattice data structure for keeping n-best path.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate EnumMap<TokenType, Dictionary<? extends U>> private char[]private int[]private intprivate TokenType[]private int[]private int[]private int[]private int[]private int[]private int[]private int[]private int[]private int[]private int[]private int[]private int[]private int[]private intprivate intprivate intprivate int[]private boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate int(package private) intbestCost()(package private) IntArrayList(package private) voidcalcLeftCost(ConnectionCosts costs) (package private) voidcalcRightCost(ConnectionCosts costs) private intconnectionCost(ConnectionCosts costs, int left, int right) private intcost(int node) (package private) voidgetNodeDicType(int node) intgetNodeLeft(int node) intgetNodeRight(int node) intgetNodeWordID(int node) int(package private) voidmarkSameSpanNode(int refNode, int value) (package private) void(package private) IntArrayListnBestNodeList(int N) private intpositionCount(Viterbi.WrappedPositionArray<ViterbiNBest.PositionNBest> positions, int beg, int end) (package private) intprobeDelta(int start, int end) private voidreserve(int n) (package private) voidsetup(char[] fragment, EnumMap<TokenType, Dictionary<? extends U>> dictionaryMap, Viterbi.WrappedPositionArray<ViterbiNBest.PositionNBest> positions, int prevOffset, int endOffset, boolean useEOS) private voidsetupNodePool(int n) private voidsetupRoot(int baseOffset, int lastOffset)
-
Field Details
-
fragment
private char[] fragment -
dictionaryMap
-
useEOS
private boolean useEOS -
rootCapacity
private int rootCapacity -
rootSize
private int rootSize -
rootBase
private int rootBase -
lRoot
private int[] lRoot -
rRoot
private int[] rRoot -
capacity
private int capacity -
nodeCount
private int nodeCount -
nodeDicType
-
nodeWordID
private int[] nodeWordID -
nodeMark
private int[] nodeMark -
nodeLeftID
private int[] nodeLeftID -
nodeRightID
private int[] nodeRightID -
nodeWordCost
private int[] nodeWordCost -
nodeLeftCost
private int[] nodeLeftCost -
nodeRightCost
private int[] nodeRightCost -
nodeLeftNode
private int[] nodeLeftNode -
nodeRightNode
private int[] nodeRightNode -
nodeLeft
private int[] nodeLeft -
nodeRight
private int[] nodeRight -
nodeLeftChain
private int[] nodeLeftChain -
nodeRightChain
private int[] nodeRightChain
-
-
Constructor Details
-
Lattice
protected Lattice()
-
-
Method Details
-
getNodeLeft
public int getNodeLeft(int node) -
getNodeRight
public int getNodeRight(int node) -
getNodeDicType
-
getNodeWordID
public int getNodeWordID(int node) -
getRootBase
public int getRootBase() -
setupRoot
private void setupRoot(int baseOffset, int lastOffset) -
reserve
private void reserve(int n) -
setupNodePool
private void setupNodePool(int n) -
addNode
-
positionCount
private int positionCount(Viterbi.WrappedPositionArray<ViterbiNBest.PositionNBest> positions, int beg, int end) -
setup
void setup(char[] fragment, EnumMap<TokenType, Dictionary<? extends U>> dictionaryMap, Viterbi.WrappedPositionArray<ViterbiNBest.PositionNBest> positions, int prevOffset, int endOffset, boolean useEOS) -
markUnreachable
void markUnreachable() -
connectionCost
-
calcLeftCost
-
calcRightCost
-
markSameSpanNode
void markSameSpanNode(int refNode, int value) -
bestPathNodeList
IntArrayList bestPathNodeList() -
cost
private int cost(int node) -
nBestNodeList
-
bestCost
int bestCost() -
probeDelta
int probeDelta(int start, int end) -
debugPrint
void debugPrint()
-