From e8c8aa08ce44cc3dba2b221199b73c20f31dbdc0 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 16 Oct 2016 17:04:16 +0200 Subject: [PATCH] Make action_name optional in StepwiseState --- spacy/syntax/parser.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacy/syntax/parser.pyx b/spacy/syntax/parser.pyx index 88015b7b1..4507ef5b1 100644 --- a/spacy/syntax/parser.pyx +++ b/spacy/syntax/parser.pyx @@ -284,7 +284,9 @@ cdef class StepwiseState: cdef Transition action = self.parser.moves.c[self.eg.guess] return self.parser.moves.move_name(action.move, action.label) - def transition(self, action_name): + def transition(self, action_name=None): + if action_name is None: + action_name = self.predict() moves = {'S': 0, 'D': 1, 'L': 2, 'R': 3} if action_name == '_': action_name = self.predict()