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: Construct a new ``RegexpChunkParser``.
  
  :type rules: list(RegexpChunkRule)
  :param rules: The sequence of rules that should be used to
      generate the chunking for a tagged text.
  :type chunk_label: str
  :param chunk_label: The node value that should be used for
      chunk subtrees.  This is typically a short string
      describing the type of information contained by the chunk,
      such as ``"NP"`` for base noun phrases.
  :type root_label: str
  :param root_label: The node value that should be used for the
      top node of the chunk structure.
  :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.
docstr_tok: ["Construct","a","new","``","RegexpChunkParser","``",".",":","type","rules",":","list","(","RegexpChunkRule",")",":","param","rules",":","The","sequence","of","rules","that","should","be","used","to","generate","the","chunking","for","a","tagged","text",".",":","type","chunk_label",":","str",":","param","chunk_label",":","The","node","value","that","should","be","used","for","chunk","subtrees",".","This","is","typically","a","short","string","describing","the","type","of","information","contained","by","the","chunk",",","such","as","``","``","NP","''","``","for","base","noun","phrases",".",":","type","root_label",":","str",":","param","root_label",":","The","node","value","that","should","be","used","for","the","top","node","of","the","chunk","structure",".",":","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","."]
code: def __init__(self, rules, chunk_label="NP", root_label="S", trace=0):
      """
      Construct a new ``RegexpChunkParser``.
  
      :type rules: list(RegexpChunkRule)
      :param rules: The sequence of rules that should be used to
          generate the chunking for a tagged text.
      :type chunk_label: str
      :param chunk_label: The node value that should be used for
          chunk subtrees.  This is typically a short string
          describing the type of information contained by the chunk,
          such as ``"NP"`` for base noun phrases.
      :type root_label: str
      :param root_label: The node value that should be used for the
          top node of the chunk structure.
      :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.
      """
      self._rules = rules
      self._trace = trace
      self._chunk_label = chunk_label
      self._root_label = root_label
  
imports: import re
  import regex
  from nltk.chunk.api import ChunkParserI
  from nltk.tree import Tree
label_desc: Use image node_id 1 to create a new RegexpChunkParser object from inherited base classes: ChunkParserI with example: obj = RegexpChunkParser(rules, chunk_label, root_label, trace)