                  smallest_np_arc = tokenid
          return smallest_np_arc
  
  
      def _lift(self, tokenid, heads):
          # reattaches a word to it's grandfather
          head = heads[tokenid]
          ghead = heads[head]
          # attach to ghead if head isn't attached to root else attach to root
          heads[tokenid] = ghead if head != ghead else tokenid
 
</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     def _make_span_index(self, heads):
        # stores the direct dependents for each token
        # for searching top-down through a tree
        spans = {}
        for tokenid, head in enumerate(heads):
            if tokenid == head: # root
                continue
            if head not in spans:
                spans[head] = []
            spans[head].append(tokenid)
        return spans


    def _filter_labels(self, labeled_trees, cutoff):
 </s> add     @classmethod
    def _filter_labels(cls, gold_tuples, cutoff, freqs): </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         for heads,labels in labeled_trees:
            proj_heads,deco_labels = self.projectivize(heads,labels)
            # set the label to ROOT for each root dependent
            deco_labels = [ 'ROOT' if head == i else deco_labels[i] for i,head in enumerate(proj_heads) ]
            preprocessed.append((proj_heads,deco_labels))
 </s> add         freqs = Counter()
        for raw_text, sents in gold_tuples:
            prepro_sents = []
            for (ids, words, tags, heads, labels, iob), ctnts in sents:
                proj_heads,deco_labels = cls.projectivize(heads,labels)
                # set the label to ROOT for each root dependent
                deco_labels = [ 'ROOT' if head == i else deco_labels[i] for i,head in enumerate(proj_heads) ]
                # count label frequencies
                if label_freq_cutoff > 0:
                    freqs.update( label for label in deco_labels if cls.is_decorated(label) )
                prepro_sents.append(((ids,words,tags,proj_heads,deco_labels,iob), ctnts))
            preprocessed.append((raw_text, prepro_sents))
    @classmethod
    def _lift(cls, tokenid, heads):
                  smallest_np_arc = tokenid
          return smallest_np_arc
  
  
    @classmethod
    def _lift(cls, tokenid, heads):
          # reattaches a word to it's grandfather
          head = heads[tokenid]
          ghead = heads[head]
          # attach to ghead if head isn't attached to root else attach to root
          heads[tokenid] = ghead if head != ghead else tokenid
keep keep keep keep replace 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