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 int
private EnumMap
<TokenType, Dictionary<? extends U>> private char[]
private int[]
private int
private 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 int
private int
private int
private int[]
private boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate int
(package private) int
bestCost()
(package private) IntArrayList
(package private) void
calcLeftCost
(ConnectionCosts costs) (package private) void
calcRightCost
(ConnectionCosts costs) private int
connectionCost
(ConnectionCosts costs, int left, int right) private int
cost
(int node) (package private) void
getNodeDicType
(int node) int
getNodeLeft
(int node) int
getNodeRight
(int node) int
getNodeWordID
(int node) int
(package private) void
markSameSpanNode
(int refNode, int value) (package private) void
(package private) IntArrayList
nBestNodeList
(int N) private int
positionCount
(Viterbi.WrappedPositionArray<ViterbiNBest.PositionNBest> positions, int beg, int end) (package private) int
probeDelta
(int start, int end) private void
reserve
(int n) (package private) void
setup
(char[] fragment, EnumMap<TokenType, Dictionary<? extends U>> dictionaryMap, Viterbi.WrappedPositionArray<ViterbiNBest.PositionNBest> positions, int prevOffset, int endOffset, boolean useEOS) private void
setupNodePool
(int n) private void
setupRoot
(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()
-