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","."]
code: def save_grammar(self, filename=None):
      if not filename:
          ftypes = [("Chunk Gramamr", ".chunk"), ("All files", "*")]
          filename = asksaveasfilename(
              filetypes=ftypes, defaultextension=".chunk"
          )
          if not filename:
              return
      if (
          self._history
          and self.normalized_grammar
          == self.normalize_grammar(self._history[-1][0])
      ):
          precision, recall, fscore = (
              "%.2f%%" % (100 * v) for v in self._history[-1][1:]
          )
      elif self.chunker is None:
          precision = recall = fscore = "Grammar not well formed"
      else:
          precision = recall = fscore = "Not finished evaluation yet"
  
      with open(filename, "w") as outfile:
          outfile.write(
              self.SAVE_GRAMMAR_TEMPLATE
              % dict(
                  date=time.ctime(),
                  devset=self.devset_name,
                  precision=precision,
                  recall=recall,
                  fscore=fscore,
                  grammar=self.grammar.strip(),
              )
          )
  
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 29 for calling the RegexpChunkApp obj's underlying member method code with example usage: obj.save_grammar(filename) without return types