* Supply dep_strings as a tuple, for the changed API on Tokens

This commit is contained in:
Matthew Honnibal 2015-01-31 13:42:09 +11:00
parent 0981d68022
commit 88170e6295
1 changed files with 3 additions and 2 deletions

View File

@ -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