class_docstr: A graphical tool for exploring the regular expression based chunk
  parser ``nltk.chunk.RegexpChunkParser``.
  
  See ``HELP`` for instructional text.
class_docstr_tok: ["A","graphical","tool","for","exploring","the","regular","expression","based","chunk","parser","``","nltk.chunk.RegexpChunkParser","``",".","See","``","HELP","``","for","instructional","text","."]
docstr: :param devset_name: The name of the development set; used for
      display & for save files.  If either the name 'treebank'
      or the name 'conll2000' is used, and devset is None, then
      devset will be set automatically.
  :param devset: A list of chunked sentences
  :param grammar: The initial grammar to display.
  :param tagset: Dictionary from tags to string descriptions, used
      for the help page.  Defaults to ``self.TAGSET``.
docstr_tok: [":","param","devset_name",":","The","name","of","the","development","set",";","used","for","display","&","for","save","files",".","If","either","the","name","'treebank'","or","the","name","'conll2000","'","is","used",",","and","devset","is","None",",","then","devset","will","be","set","automatically",".",":","param","devset",":","A","list","of","chunked","sentences",":","param","grammar",":","The","initial","grammar","to","display",".",":","param","tagset",":","Dictionary","from","tags","to","string","descriptions",",","used","for","the","help","page",".","Defaults","to","``","self.TAGSET","``","."]
code: def __init__(
      self,
      devset_name="conll2000",
      devset=None,
      grammar="",
      chunk_label="NP",
      tagset=None,
  ):
      """
      :param devset_name: The name of the development set; used for
          display & for save files.  If either the name 'treebank'
          or the name 'conll2000' is used, and devset is None, then
          devset will be set automatically.
      :param devset: A list of chunked sentences
      :param grammar: The initial grammar to display.
      :param tagset: Dictionary from tags to string descriptions, used
          for the help page.  Defaults to ``self.TAGSET``.
      """
      self._chunk_label = chunk_label
  
      if tagset is None:
          tagset = self.TAGSET
      self.tagset = tagset
  
      # Named development sets:
      if devset is None:
          if devset_name == "conll2000":
              devset = conll2000.chunked_sents("train.txt")  # [:100]
          elif devset == "treebank":
              devset = treebank_chunk.chunked_sents()  # [:100]
          else:
              raise ValueError(
                  "Unknown development set %s" % devset_name
              )
  
      self.chunker = None
      """The chunker built from the grammar string"""
  
      self.grammar = grammar
      """The unparsed grammar string"""
  
      self.normalized_grammar = None
      """A normalized version of ``self.grammar``."""
  
      self.grammar_changed = 0
      """The last time() that the grammar was changed."""
  
      self.devset = devset
      """The development set -- a list of chunked sentences."""
  
      self.devset_name = devset_name
      """The name of the development set (for save files)."""
  
      self.devset_index = -1
      """The index into the development set of the first instance
             that's currently being viewed."""
  
      self._last_keypress = 0
      """The time() when a key was most recently pressed"""
  
      self._history = []
      """A list of (grammar, precision, recall, fscore) tuples for
             grammars that the user has already tried."""
  
      self._history_index = 0
      """When the user is scrolling through previous grammars, this
             is used to keep track of which grammar they're looking at."""
  
      self._eval_grammar = None
      """The grammar that is being currently evaluated by the eval
             demon."""
  
      self._eval_normalized_grammar = None
      """A normalized copy of ``_eval_grammar``."""
  
      self._eval_index = 0
      """The index of the next sentence in the development set that
             should be looked at by the eval demon."""
  
      self._eval_score = ChunkScore(chunk_label=chunk_label)
      """The ``ChunkScore`` object that's used to keep track of the score
          of the current grammar on the development set."""
  
      # Set up the main window.
      top = self.top = Tk()
      top.geometry("+50+50")
      top.title("Regexp Chunk Parser App")
      top.bind("<Control-q>", self.destroy)
  
      # Variable that restricts how much of the devset we look at.
      self._devset_size = IntVar(top)
      self._devset_size.set(100)
  
      # Set up all the tkinter widgets
      self._init_fonts(top)
      self._init_widgets(top)
      self._init_bindings(top)
      self._init_menubar(top)
      self.grammarbox.focus()
  
      # If a grammar was given, then display it.
      if grammar:
          self.grammarbox.insert("end", grammar + "\n")
          self.grammarbox.mark_set("insert", "1.0")
  
      # Display the first item in the development set
      self.show_devset(0)
      self.update()
  
imports: import random
  import re
  import textwrap
  import time
  from tkinter import Button, Canvas, Checkbutton, Frame, IntVar, Label, Menu, Scrollbar, Text, Tk
  from tkinter.filedialog import askopenfilename, asksaveasfilename
  from tkinter.font import Font
  from nltk.chunk import ChunkScore, RegexpChunkParser
  from nltk.chunk.regexp import RegexpChunkRule
  from nltk.corpus import conll2000, treebank_chunk
  from nltk.draw.util import ShowText
  from nltk.tree import Tree
  from nltk.util import in_idle
label_desc: Use image node_id 2 to create a new RegexpChunkApp object  with example: obj = RegexpChunkApp(devset_name, devset, grammar, chunk_label, tagset)