int count = 0;
while (reader.hasNext()) {
Sentence instance = (Sentence) reader.next();
int[] heads = (int[]) instance.getTarget();
ParsingState state = new ParsingState(instance,factory);
while (!state.isFinalState()) {
// 左右焦点词在句子中的位置
int[] lr = state.getFocusIndices();
HashSparseVector features = state.getFeatures();
ParsingState.Action action = getAction(lr[0], lr[1],
heads);
state.next(action);
if (action == ParsingState.Action.LEFT)
heads[lr[1]] = -1;
if (action == ParsingState.Action.RIGHT)
heads[lr[0]] = -1;