  from collections import Counter
  
  def ancestors(tokenid, heads):
      # returns all words going from the word up the path to the root
      # the path to root cannot be longer than the number of words in the sentence
      # this function ends after at most len(heads) steps 
      # because it would otherwise loop indefinitely on cycles
      head = tokenid
 
</s> remove     def _lift(self, tokenid, heads):
 </s> add     @classmethod
    def _lift(cls, tokenid, heads): </s> remove     def _find_new_head(self, rootid, tokenid, headlabel, heads, labels, spans=None):
 </s> add     @classmethod
    def _find_new_head(cls, token, headlabel): </s> remove         if not spans:
            spans = self._make_span_index(heads)
        queue = spans.get(rootid,[])
        queue.remove(tokenid) # don't search in the subtree of the nonproj arc
 </s> add         queue = [token.head] </s> remove         smallest_np_arc = self._get_smallest_nonproj_arc(proj_heads)
 </s> add         smallest_np_arc = cls._get_smallest_nonproj_arc(proj_heads) </s> remove                 # If this head is still to the right of us, we can skip to it
                # No token that's between this token and this head could be our
                # child.
                if (ptr.head < 0) and ((ptr + ptr.head) > self.c):
                    ptr += ptr.head
                elif ptr + ptr.head == self.c:
 </s> add                 if ptr + ptr.head == self.c:
from ..tokens.doc cimport Doc
from spacy.attrs import DEP, HEAD


  from collections import Counter
  
from ..tokens.doc cimport Doc
from spacy.attrs import DEP, HEAD


  def ancestors(tokenid, heads):
      # returns all words going from the word up the path to the root
      # the path to root cannot be longer than the number of words in the sentence
      # this function ends after at most len(heads) steps 
      # because it would otherwise loop indefinitely on cycles
      head = tokenid
keep add keep keep keep keep keep keep
 integrated pseudo-projective parsing into parser

- nonproj.pyx holds a class PseudoProjectivity which currently holds
  all functionality to implement Nivre & Nilsson 2005's pseudo-projective
  parsing using the HEAD decoration scheme
- changed lefts/rights in Token to account for possible non-projective
  structures 
spacy/syntax/nonproj.pyx