| Modifier and Type | Field and Description |
|---|---|
protected Edge[] |
arcs
Keeps dependent->head information
|
protected boolean |
emptyFlag
This is the additional information for the case of parsing with tree constraint
For more information see:
Joakim Nivre and Daniel Fernández-González.
|
protected long[] |
leftDepLabels |
protected int[] |
leftMostArcs |
protected int[] |
leftValency
left modifiers
|
int |
maxSentenceSize |
protected long[] |
rightDepLabels |
protected int[] |
rightMostArcs |
protected int[] |
rightValency |
int |
rootIndex |
protected ArrayDeque<Integer> |
stack |
| Constructor and Description |
|---|
State(int size) |
State(int sentenceSize,
boolean rootFirst) |
| Modifier and Type | Method and Description |
|---|---|
void |
addArc(int dependent,
int head,
int dependency) |
boolean |
bufferEmpty() |
int |
bufferHead() |
int |
bufferSize() |
State |
clone() |
int |
getBufferItem(int position) |
int |
getDependent(int index) |
int |
getHead(int index) |
ArrayDeque<Integer> |
getStack() |
boolean |
hasHead(int dependent) |
void |
incrementBufferHead() |
boolean |
isEmptyFlag() |
boolean |
isTerminalState() |
long |
leftDependentLabels(int position) |
int |
leftMostModifier(int index) |
int |
leftValency(int head) |
int |
pop() |
void |
push(int index) |
long |
rightDependentLabels(int position) |
int |
rightMostModifier(int index) |
int |
rightValency(int head) |
void |
setBufferHead(int bufferHead) |
void |
setEmptyFlag(boolean emptyFlag) |
void |
setMaxSentenceSize(int maxSentenceSize) |
boolean |
stackEmpty() |
int |
stackSize() |
int |
stackTop()
View top element of stack
|
int |
valence(int head) |
public int rootIndex
public int maxSentenceSize
protected boolean emptyFlag
protected Edge[] arcs
protected int[] leftMostArcs
protected int[] rightMostArcs
protected int[] leftValency
protected int[] rightValency
protected long[] rightDepLabels
protected long[] leftDepLabels
protected ArrayDeque<Integer> stack
public State(int size)
public State(int sentenceSize,
boolean rootFirst)
sentenceSize - 句子长度(不包含ROOT)rootFirst - 是否将ROOT作为index=0的词语,否则作为最后一个词语public ArrayDeque<Integer> getStack()
public int pop()
public void push(int index)
public void addArc(int dependent,
int head,
int dependency)
public long rightDependentLabels(int position)
public long leftDependentLabels(int position)
public boolean isEmptyFlag()
public void setEmptyFlag(boolean emptyFlag)
public int bufferHead()
public int stackTop()
public int getBufferItem(int position)
public boolean isTerminalState()
public boolean hasHead(int dependent)
public boolean bufferEmpty()
public boolean stackEmpty()
public int bufferSize()
public int stackSize()
public int rightMostModifier(int index)
public int leftMostModifier(int index)
public int valence(int head)
head - public int rightValency(int head)
head - public int leftValency(int head)
head - public int getHead(int index)
public int getDependent(int index)
public void setMaxSentenceSize(int maxSentenceSize)
public void incrementBufferHead()
public void setBufferHead(int bufferHead)
Copyright © 2014–2021 码农场. All rights reserved.