From 49f9d1c085b6fdde738f1870f60f4c2f76575044 Mon Sep 17 00:00:00 2001 From: Wolfgang Seeker Date: Thu, 3 Mar 2016 19:42:09 +0100 Subject: [PATCH] change test_nonproj.py to not use zip inside numpy.asarray --- spacy/tests/parser/test_nonproj.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/tests/parser/test_nonproj.py b/spacy/tests/parser/test_nonproj.py index 71b20bf74..c41035713 100644 --- a/spacy/tests/parser/test_nonproj.py +++ b/spacy/tests/parser/test_nonproj.py @@ -59,7 +59,8 @@ def deprojectivize(proj_heads, deco_labels, EN): sent = EN.tokenizer.tokens_from_list(['whatever'] * slen) rel_proj_heads = [ head-i for i,head in enumerate(proj_heads) ] labelids = [ EN.vocab.strings[label] for label in deco_labels ] - parse = numpy.asarray(zip(rel_proj_heads,labelids), dtype=numpy.int32) + pairs = zip(rel_proj_heads,labelids) + parse = numpy.asarray(pairs, dtype=numpy.int32) sent.from_array([HEAD,DEP],parse) PseudoProjectivity.deprojectivize(sent) parse = sent.to_array([HEAD,DEP])