class_docstr: Reads constituency parses from the WSJ part of the Penn Tree Bank from the LDC.
  This ``DatasetReader`` is designed for use with a span labelling model, so
  it enumerates all possible spans in the sentence and returns them, along with gold
  labels for the relevant spans present in a gold tree, if provided.
  
  Parameters
  ----------
  token_indexers : ``Dict[str, TokenIndexer]``, optional (default=``{"tokens": SingleIdTokenIndexer()}``)
      We use this to define the input representation for the text.  See :class:`TokenIndexer`.
      Note that the `output` tags will always correspond to single token IDs based on how they
      are pre-tokenised in the data file.
  use_pos_tags : ``bool``, optional, (default = ``True``)
      Whether or not the instance should contain gold POS tags
      as a field.
  lazy : ``bool``, optional, (default = ``False``)
      Whether or not instances can be consumed lazily.
class_docstr_tok: ["Reads","constituency","parses","from","the","WSJ","part","of","the","Penn","Tree","Bank","from","the","LDC",".","This","``","DatasetReader","``","is","designed","for","use","with","a","span","labelling","model",",","so","it","enumerates","all","possible","spans","in","the","sentence","and","returns","them",",","along","with","gold","labels","for","the","relevant","spans","present","in","a","gold","tree",",","if","provided",".","Parameters","--","--","--","--","--","token_indexers",":","``","Dict","[","str",",","TokenIndexer","]","``",",","optional","(","default=","``","{","``","tokens","''",":","SingleIdTokenIndexer","(",")","}","``",")","We","use","this","to","define","the","input","representation","for","the","text",".","See",":","class",":","`","TokenIndexer","`",".","Note","that","the","`","output","`","tags","will","always","correspond","to","single","token","IDs","based","on","how","they","are","pre-tokenised","in","the","data","file",".","use_pos_tags",":","``","bool","``",",","optional",",","(","default","=","``","True","``",")","Whether","or","not","the","instance","should","contain","gold","POS","tags","as","a","field",".","lazy",":","``","bool","``",",","optional",",","(","default","=","``","False","``",")","Whether","or","not","instances","can","be","consumed","lazily","."]
docstr: Removes all functional tags from constituency labels in an NLTK tree.
  We also strip off anything after a =, - or | character, because these
  are functional tags which we don't want to use.
  
  This modification is done in-place.
docstr_tok: ["Removes","all","functional","tags","from","constituency","labels","in","an","NLTK","tree",".","We","also","strip","off","anything","after","a","=",",","-","or","|","character",",","because","these","are","functional","tags","which","we","do","n't","want","to","use",".","This","modification","is","done","in-place","."]
code: def _strip_functional_tags(self, tree):
      """
      Removes all functional tags from constituency labels in an NLTK tree.
      We also strip off anything after a =, - or | character, because these
      are functional tags which we don't want to use.
  
      This modification is done in-place.
      """
      clean_label = (
          tree.label().split("=")[0].split("-")[0].split("|")[0]
      )
      tree.set_label(clean_label)
      for child in tree:
          if not isinstance(child[0], unicode):
              self._strip_functional_tags(child)
  
file_path: magnitude/pymagnitude/third_party/allennlp/data/dataset_readers/penn_tree_bank.py
imports: from __future__ import absolute_import
  import logging
  import os
  from nltk.corpus.reader.bracket_parse import BracketParseCorpusReader
  from nltk.tree import Tree
  from allennlp.common.file_utils import cached_path
  from allennlp.data.dataset_readers.dataset_reader import DatasetReader
  from allennlp.data.fields import TextField, SpanField, SequenceLabelField, ListField, MetadataField, Field
  from allennlp.data.instance import Instance
  from allennlp.data.token_indexers import TokenIndexer, SingleIdTokenIndexer
  from allennlp.data.tokenizers import Token
  from allennlp.data.dataset_readers.dataset_utils.span_utils import enumerate_spans
  from allennlp.common.checks import ConfigurationError
label_desc: Use image node_id 4 for calling the PennTreeBankConstituencySpanDatasetReader obj's underlying member method code with example usage: obj._strip_functional_tags(tree) without return types