docs: def convert_tree(self, ptb_tree, representation='basic',
                       include_punct=True, include_erased=False,
                       add_lemmas=False, universal=True):
          """Arguments are as in StanfordDependencies.convert_trees but with
          the addition of add_lemmas. If add_lemmas=True, we will run the
          Stanford CoreNLP lemmatizer and fill in the lemma field."""
          self._raise_on_bad_input(ptb_tree)
          self._raise_on_bad_representation(representation)
          tree = self.treeReader(ptb_tree)
          if tree is None:
              raise ValueError("Invalid Penn Treebank tree: %r" % ptb_tree)
          deps = self._get_deps(tree, include_punct, representation,
                                universal=universal)
  
          tagged_yield = self._listify(tree.taggedYield())
          indices_to_words = dict(enumerate(tagged_yield, 1))
          sentence = Sentence()
          covered_indices = set()
  
          def add_token(index, form, head, deprel, extra):
              tag = indices_to_words[index].tag()
              if add_lemmas:
                  lemma = self.stem(form, tag)
              else:
                  lemma = None
              token = Token(index=index, form=form, lemma=lemma, cpos=tag,
                            pos=tag, feats=None, head=head, deprel=deprel,
                            phead=None, pdeprel=None, extra=extra)
              sentence.append(token)
  
          # add token for each dependency
          for dep in deps:
              index = dep.dep().index()
              head = dep.gov().index()
              deprel = dep.reln().toString()
              form = indices_to_words[index].value()
  
              dep_is_copy = dep.dep().copyCount()
              gov_is_copy = dep.gov().copyCount()
              if dep_is_copy or gov_is_copy:
                  extra = {}
                  if dep_is_copy:
                      extra['dep_is_copy'] = dep_is_copy
                  if gov_is_copy:
                      extra['gov_is_copy'] = gov_is_copy
              else:
                  extra = None
              add_token(index, form, head, deprel, extra)
              covered_indices.add(index)
          if include_erased:
              # see if there are any tokens that were erased
              # and add them as well
              all_indices = set(indices_to_words.keys())
              for index in all_indices - covered_indices:
                  form = indices_to_words[index].value()
                  if not include_punct and not self.puncFilter(form):
                      continue
                  add_token(index, form, head=0, deprel='erased', extra=None)
              # erased generally disrupt the ordering of the sentence
              sentence.sort()
  
          if representation == 'basic':
              sentence.renumber()
          return sentence