From b0618def8d5e03d24e732432d858a34f1301b314 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 5 Oct 2017 21:54:12 -0500 Subject: [PATCH] Add support for 2-token state option --- spacy/syntax/_state.pxd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spacy/syntax/_state.pxd b/spacy/syntax/_state.pxd index f4fa49286..50146401e 100644 --- a/spacy/syntax/_state.pxd +++ b/spacy/syntax/_state.pxd @@ -93,6 +93,9 @@ cdef cppclass StateC: free(this.shifted - PADDING) void set_context_tokens(int* ids, int n) nogil: + if n == 2: + ids[0] = this.B(0) + ids[1] = this.S(0) if n == 8: ids[0] = this.B(0) ids[1] = this.B(1)