

def _add_stage(self, rules, lhs, root_label, trace):
    '\n        Helper function for __init__: add a new stage to the parser.\n        '
    if (rules != []):
        if (not lhs):
            raise ValueError('Expected stage marker (eg NP:)')
        parser = RegexpChunkParser(rules, chunk_label=lhs, root_label=root_label, trace=trace)
        self._stages.append(parser)

dataset/ETHPy150Open nltk/nltk/nltk/chunk/regexp.py RegexpParser._add_stage/original