

def __init__(self, grammar, root_label='S', loop=1, trace=0):
    '\n        Create a new chunk parser, from the given start state\n        and set of chunk patterns.\n\n        :param grammar: The grammar, or a list of RegexpChunkParser objects\n        :type grammar: str or list(RegexpChunkParser)\n        :param root_label: The top node of the tree being created\n        :type root_label: str or Nonterminal\n        :param loop: The number of times to run through the patterns\n        :type loop: int\n        :type trace: int\n        :param trace: The level of tracing that should be used when\n            parsing a text.  ``0`` will generate no tracing output;\n            ``1`` will generate normal tracing output; and ``2`` or\n            higher will generate verbose tracing output.\n        '
    self._trace = self
    self._stages = []
    self._grammar = grammar
    self._loop = loop
    if isinstance(grammar, string_types):
        self._read_grammar(grammar, root_label, trace)
    else:
        type_err = 'Expected string or list of RegexpChunkParsers for the grammar.'
        try:
            grammar = list(grammar)
        except:
            raise TypeError(type_err)
        for elt in grammar:
            if (not isinstance(elt, RegexpChunkParser)):
                raise TypeError(type_err)
        self._stages = grammar

dataset/ETHPy150Open nltk/nltk/nltk/chunk/regexp.py RegexpParser.__init__/VarMisuse@30/303 `trace`->`self`