class_docstr: A regular expression based chunk parser.  ``RegexpChunkParser`` uses a
  sequence of "rules" to find chunks of a single type within a
  text.  The chunking of the text is encoded using a ``ChunkString``,
  and each rule acts by modifying the chunking in the
  ``ChunkString``.  The rules are all implemented using regular
  expression matching and substitution.
  
  The ``RegexpChunkRule`` class and its subclasses (``ChunkRule``,
  ``StripRule``, ``UnChunkRule``, ``MergeRule``, and ``SplitRule``)
  define the rules that are used by ``RegexpChunkParser``.  Each rule
  defines an ``apply()`` method, which modifies the chunking encoded
  by a given ``ChunkString``.
  
  :type _rules: list(RegexpChunkRule)
  :ivar _rules: The list of rules that should be applied to a text.
  :type _trace: int
  :ivar _trace: The default level of tracing.
class_docstr_tok: ["A","regular","expression","based","chunk","parser",".","``","RegexpChunkParser","``","uses","a","sequence","of","``","rules","''","to","find","chunks","of","a","single","type","within","a","text",".","The","chunking","of","the","text","is","encoded","using","a","``","ChunkString","``",",","and","each","rule","acts","by","modifying","the","chunking","in","the","``","ChunkString","``",".","The","rules","are","all","implemented","using","regular","expression","matching","and","substitution",".","The","``","RegexpChunkRule","``","class","and","its","subclasses","(","``","ChunkRule","``",",","``","StripRule","``",",","``","UnChunkRule","``",",","``","MergeRule","``",",","and","``","SplitRule","``",")","define","the","rules","that","are","used","by","``","RegexpChunkParser","``",".","Each","rule","defines","an","``","apply","(",")","``","method",",","which","modifies","the","chunking","encoded","by","a","given","``","ChunkString","``",".",":","type","_rules",":","list","(","RegexpChunkRule",")",":","ivar","_rules",":","The","list","of","rules","that","should","be","applied","to","a","text",".",":","type","_trace",":","int",":","ivar","_trace",":","The","default","level","of","tracing","."]
docstr: :type chunk_struct: Tree
  :param chunk_struct: the chunk structure to be (further) chunked
  :type trace: int
  :param trace: The level of tracing that should be used when
      parsing a text.  ``0`` will generate no tracing output;
      ``1`` will generate normal tracing output; and ``2`` or
      higher will generate verbose tracing output.  This value
      overrides the trace level value that was given to the
      constructor.
  :rtype: Tree
  :return: a chunk structure that encodes the chunks in a given
      tagged sentence.  A chunk is a non-overlapping linguistic
      group, such as a noun phrase.  The set of chunks
      identified in the chunk structure depends on the rules
      used to define this ``RegexpChunkParser``.
docstr_tok: [":","type","chunk_struct",":","Tree",":","param","chunk_struct",":","the","chunk","structure","to","be","(","further",")","chunked",":","type","trace",":","int",":","param","trace",":","The","level","of","tracing","that","should","be","used","when","parsing","a","text",".","``","0","``","will","generate","no","tracing","output",";","``","1","``","will","generate","normal","tracing","output",";","and","``","2","``","or","higher","will","generate","verbose","tracing","output",".","This","value","overrides","the","trace","level","value","that","was","given","to","the","constructor",".",":","rtype",":","Tree",":","return",":","a","chunk","structure","that","encodes","the","chunks","in","a","given","tagged","sentence",".","A","chunk","is","a","non-overlapping","linguistic","group",",","such","as","a","noun","phrase",".","The","set","of","chunks","identified","in","the","chunk","structure","depends","on","the","rules","used","to","define","this","``","RegexpChunkParser","``","."]
code: def parse(self, chunk_struct, trace=None):
      """
      :type chunk_struct: Tree
      :param chunk_struct: the chunk structure to be (further) chunked
      :type trace: int
      :param trace: The level of tracing that should be used when
          parsing a text.  ``0`` will generate no tracing output;
          ``1`` will generate normal tracing output; and ``2`` or
          higher will generate verbose tracing output.  This value
          overrides the trace level value that was given to the
          constructor.
      :rtype: Tree
      :return: a chunk structure that encodes the chunks in a given
          tagged sentence.  A chunk is a non-overlapping linguistic
          group, such as a noun phrase.  The set of chunks
          identified in the chunk structure depends on the rules
          used to define this ``RegexpChunkParser``.
      """
      if len(chunk_struct) == 0:
          print("Warning: parsing empty text")
          return Tree(self._root_label, [])
  
      try:
          chunk_struct.label()
      except AttributeError:
          chunk_struct = Tree(self._root_label, chunk_struct)
  
      # Use the default trace value?
      if trace is None:
          trace = self._trace
  
      chunkstr = ChunkString(chunk_struct)
  
      # Apply the sequence of rules to the chunkstring.
      if trace:
          verbose = trace > 1
          self._trace_apply(chunkstr, verbose)
      else:
          self._notrace_apply(chunkstr)
  
      # Use the chunkstring to create a chunk structure.
      return chunkstr.to_chunkstruct(self._chunk_label)
  
imports: import re
  import regex
  from nltk.chunk.api import ChunkParserI
  from nltk.tree import Tree
label_desc: Use image node_id 4 for calling the RegexpChunkParser obj's underlying member method code with example usage: obj.parse(chunk_struct, trace) and returns: chunkstr, Tree