':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``.'

def __init__(self, devset_name='conll2000', devset=None, grammar='', chunk_label='NP', tagset=None):

    self._chunk_label = chunk_label
    if (tagset is None):
        tagset = self.TAGSET
    self.tagset = tagset
    if (devset is None):
        if (devset_name == 'conll2000'):
            devset = conll2000.chunked_sents('train.txt')
        elif (devset == 'treebank'):
            devset = treebank_chunk.chunked_sents()
        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\n                                            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\n                                            grammars    that    the    user    has    already    tried.'
    self._history_index = 0
    "When    the    user    is    scrolling    through    previous    grammars,    this\n                                            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\n                                            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\n                                            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\n                                of    the    current    grammar    on    the    development    set."
    top = self.top = Tk()
    top.geometry('+50+50')
    top.title('Regexp    Chunk    Parser    App')
    top.bind('<Control-q>', self.destroy)
    self._devset_size = IntVar(top)
    self._devset_size.set(100)
    self._init_fonts(top)
    self._init_widgets(top)
    self._init_bindings(top)
    self._init_menubar(top)
    self.grammarbox.focus()
    if grammar:
        self.grammarbox.insert('end', (grammar + '\n'))
        self.grammarbox.mark_set('insert', '1.0')
    self.show_devset(0)
    self.update()
