private int DoMove(int predictedMove, int i, ref Buffer buffer) { string lbl = ""; // Data.Index2Label[predictedMove]; switch (predictedMove) { case LEFT: { buffer.AddArc(i, buffer.Stack.Pop(), lbl); return(i); } case RIGHT: { int child = buffer.Stack.Pop(); buffer.AddArc(buffer.Stack[0], child, lbl); return(i); } case SHIFT: { buffer.Stack.Push(i); return(i + 1); } } throw new Exception("Invalid move: " + predictedMove); }