* Deprojectivize German parses

This commit is contained in:
Matthew Honnibal 2016-05-05 15:01:10 +02:00
parent 9bbd6cf031
commit 472f576b82
2 changed files with 4 additions and 1 deletions

View File

@ -18,6 +18,7 @@ from libc.string cimport memcpy
from cymem.cymem cimport Pool
from .stateclass cimport StateClass
from ._state cimport StateC, is_space_token
from .nonproj import PseudoProjectivity
DEF NON_MONOTONIC = True
@ -385,6 +386,8 @@ cdef class ArcEager(TransitionSystem):
def finalize_doc(self, doc):
doc.is_parsed = True
if doc.vocab.lang == 'de':
PseudoProjectivity.projectivize(doc)
cdef int set_valid(self, int* output, const StateC* st) nogil:
cdef bint[N_MOVES] is_valid

View File

@ -114,7 +114,7 @@ class PseudoProjectivity:
@classmethod
def deprojectivize(cls, Doc tokens):
def deprojectivize(cls, tokens):
# reattach arcs with decorated labels (following HEAD scheme)
# for each decorated arc X||Y, search top-down, left-to-right,
# breadth-first until hitting a Y then make this the new head