class_docstr: A string-based encoding of a particular chunking of a text.
  Internally, the ``ChunkString`` class uses a single string to
  encode the chunking of the input text.  This string contains a
  sequence of angle-bracket delimited tags, with chunking indicated
  by braces.  An example of this encoding is::
  
      {<DT><JJ><NN>}<VBN><IN>{<DT><NN>}<.>{<DT><NN>}<VBD><.>
  
  ``ChunkString`` are created from tagged texts (i.e., lists of
  ``tokens`` whose type is ``TaggedType``).  Initially, nothing is
  chunked.
  
  The chunking of a ``ChunkString`` can be modified with the ``xform()``
  method, which uses a regular expression to transform the string
  representation.  These transformations should only add and remove
  braces; they should *not* modify the sequence of angle-bracket
  delimited tags.
  
  :type _str: str
  :ivar _str: The internal string representation of the text's
      encoding.  This string representation contains a sequence of
      angle-bracket delimited tags, with chunking indicated by
      braces.  An example of this encoding is::
  
          {<DT><JJ><NN>}<VBN><IN>{<DT><NN>}<.>{<DT><NN>}<VBD><.>
  
  :type _pieces: list(tagged tokens and chunks)
  :ivar _pieces: The tagged tokens and chunks encoded by this ``ChunkString``.
  :ivar _debug: The debug level.  See the constructor docs.
  
  :cvar IN_CHUNK_PATTERN: A zero-width regexp pattern string that
      will only match positions that are in chunks.
  :cvar IN_STRIP_PATTERN: A zero-width regexp pattern string that
      will only match positions that are in strips.
class_docstr_tok: ["A","string-based","encoding","of","a","particular","chunking","of","a","text",".","Internally",",","the","``","ChunkString","``","class","uses","a","single","string","to","encode","the","chunking","of","the","input","text",".","This","string","contains","a","sequence","of","angle-bracket","delimited","tags",",","with","chunking","indicated","by","braces",".","An","example","of","this","encoding","is",":",":","{","<","DT",">","<","JJ",">","<","NN",">","}","<","VBN",">","<","IN",">","{","<","DT",">","<","NN",">","}","<",".",">","{","<","DT",">","<","NN",">","}","<","VBD",">","<",".",">","``","ChunkString","``","are","created","from","tagged","texts","(","i.e.",",","lists","of","``","tokens","``","whose","type","is","``","TaggedType","``",")",".","Initially",",","nothing","is","chunked",".","The","chunking","of","a","``","ChunkString","``","can","be","modified","with","the","``","xform","(",")","``","method",",","which","uses","a","regular","expression","to","transform","the","string","representation",".","These","transformations","should","only","add","and","remove","braces",";","they","should","*","not","*","modify","the","sequence","of","angle-bracket","delimited","tags",".",":","type","_str",":","str",":","ivar","_str",":","The","internal","string","representation","of","the","text's","encoding",".","This","string","representation","contains","a","sequence","of","angle-bracket","delimited","tags",",","with","chunking","indicated","by","braces",".","An","example","of","this","encoding","is",":",":","{","<","DT",">","<","JJ",">","<","NN",">","}","<","VBN",">","<","IN",">","{","<","DT",">","<","NN",">","}","<",".",">","{","<","DT",">","<","NN",">","}","<","VBD",">","<",".",">",":","type","_pieces",":","list","(","tagged","tokens","and","chunks",")",":","ivar","_pieces",":","The","tagged","tokens","and","chunks","encoded","by","this","``","ChunkString","``",".",":","ivar","_debug",":","The","debug","level",".","See","the","constructor","docs",".",":","cvar","IN_CHUNK_PATTERN",":","A","zero-width","regexp","pattern","string","that","will","only","match","positions","that","are","in","chunks",".",":","cvar","IN_STRIP_PATTERN",":","A","zero-width","regexp","pattern","string","that","will","only","match","positions","that","are","in","strips","."]
docstr: Check to make sure that ``s`` still corresponds to some chunked
  version of ``_pieces``.
  
  :type verify_tags: bool
  :param verify_tags: Whether the individual tags should be
      checked.  If this is false, ``_verify`` will check to make
      sure that ``_str`` encodes a chunked version of *some*
      list of tokens.  If this is true, then ``_verify`` will
      check to make sure that the tags in ``_str`` match those in
      ``_pieces``.
  
  :raise ValueError: if the internal string representation of
      this ``ChunkString`` is invalid or not consistent with _pieces.
docstr_tok: ["Check","to","make","sure","that","``","s","``","still","corresponds","to","some","chunked","version","of","``","_pieces","``",".",":","type","verify_tags",":","bool",":","param","verify_tags",":","Whether","the","individual","tags","should","be","checked",".","If","this","is","false",",","``","_verify","``","will","check","to","make","sure","that","``","_str","``","encodes","a","chunked","version","of","*","some","*","list","of","tokens",".","If","this","is","true",",","then","``","_verify","``","will","check","to","make","sure","that","the","tags","in","``","_str","``","match","those","in","``","_pieces","``",".",":","raise","ValueError",":","if","the","internal","string","representation","of","this","``","ChunkString","``","is","invalid","or","not","consistent","with","_pieces","."]
code: def _verify(self, s, verify_tags):
      """
      Check to make sure that ``s`` still corresponds to some chunked
      version of ``_pieces``.
  
      :type verify_tags: bool
      :param verify_tags: Whether the individual tags should be
          checked.  If this is false, ``_verify`` will check to make
          sure that ``_str`` encodes a chunked version of *some*
          list of tokens.  If this is true, then ``_verify`` will
          check to make sure that the tags in ``_str`` match those in
          ``_pieces``.
  
      :raise ValueError: if the internal string representation of
          this ``ChunkString`` is invalid or not consistent with _pieces.
      """
      # Check overall form
      if not ChunkString._VALID.match(s):
          raise ValueError(
              "Transformation generated invalid "
              "chunkstring:\n  %s" % s
          )
  
      # Check that parens are balanced.  If the string is long, we
      # have to do this in pieces, to avoid a maximum recursion
      # depth limit for regular expressions.
      brackets = ChunkString._BRACKETS.sub("", s)
      for i in range(1 + len(brackets) // 5000):
          substr = brackets[i * 5000 : i * 5000 + 5000]
          if not ChunkString._BALANCED_BRACKETS.match(substr):
              raise ValueError(
                  "Transformation generated invalid "
                  "chunkstring:\n  %s" % s
              )
  
      if verify_tags <= 0:
          return
  
      tags1 = (re.split(r"[\{\}<>]+", s))[1:-1]
      tags2 = [self._tag(piece) for piece in self._pieces]
      if tags1 != tags2:
          raise ValueError(
              "Transformation generated invalid "
              "chunkstring: tag changed"
          )
  
imports: import re
  import regex
  from nltk.chunk.api import ChunkParserI
  from nltk.tree import Tree
label_desc: Use image node_id 3 for calling the ChunkString obj's underlying member method code with example usage: obj._verify(s, verify_tags) without return types