                  if labels[idx] == headlabel:
                      return idx
                  next_queue.extend(spans.get(idx,[]))
              queue = next_queue
          return heads[tokenid]
  
  
      def _make_span_index(self, heads):
          # stores the direct dependents for each token
          # for searching top-down through a tree
 
</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             for idx in queue:
                if labels[idx] == headlabel:
                    return idx
                next_queue.extend(spans.get(idx,[]))
 </s> add             for qtoken in queue:
                for child in qtoken.children:
                    if child == token:
                        continue
                    if child.dep_ == headlabel:
                        return child
                    next_queue.append(child) </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     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):
        return token.head
                  if labels[idx] == headlabel:
                      return idx
                  next_queue.extend(spans.get(idx,[]))
              queue = next_queue
        return token.head
  
  
      def _make_span_index(self, heads):
          # stores the direct dependents for each token
          # for searching top-down through a tree
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