From 88170e6295306ce097a6a2bee45870d570c28585 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 31 Jan 2015 13:42:09 +1100 Subject: [PATCH] * Supply dep_strings as a tuple, for the changed API on Tokens --- spacy/syntax/parser.pyx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spacy/syntax/parser.pyx b/spacy/syntax/parser.pyx index f738316aa..db48112b1 100644 --- a/spacy/syntax/parser.pyx +++ b/spacy/syntax/parser.pyx @@ -81,9 +81,10 @@ cdef class GreedyParser: guess = self.moves.best_valid(scores, state) self.moves.transition(state, &guess) # Messily tell Tokens object the string names of the dependency labels - tokens._dep_strings = [None] * len(self.moves.label_ids) + dep_strings = [None] * len(self.moves.label_ids) for label, id_ in self.moves.label_ids.items(): - tokens._dep_strings[id_] = label + dep_strings[id_] = label + tokens._dep_strings = tuple(dep_strings) tokens.is_parsed = True return 0