while (reader.hasNext()) {
Sentence sent = (Sentence) reader.next();
// int[] heads = (int[]) instance.getTarget();
String depClass = null;
Target targets = (Target)sent.getTarget();
JointParsingState state = new JointParsingState(sent);
while (!state.isFinalState()) {
// 左右焦点词在句子中的位置
int[] lr = state.getFocusIndices();
ArrayList<String> features = state.getFeatures();
JointParsingState.Action action = getAction(lr[0], lr[1],
targets);
switch (action) {
case LEFT:
depClass = targets.getDepClass(lr[1]);
break;
case RIGHT:
depClass = targets.getDepClass(lr[0]);
break;
default:
}
state.next(action,depClass);
if (action == JointParsingState.Action.LEFT)
targets.setHeads(lr[1],-1);
if (action == JointParsingState.Action.RIGHT)
targets.setHeads(lr[0],-1);
String label = "";