

def __init__(self, tag_pattern, descr):
    "\n        Construct a new ``ChunkRule``.\n\n        :type tag_pattern: str\n        :param tag_pattern: This rule's tag pattern.  When\n            applied to a ``ChunkString``, this rule will\n            chunk any substring that matches this tag pattern and that\n            is not already part of a chunk.\n        :type descr: str\n        :param descr: A short description of the purpose and/or effect\n            of this rule.\n        "
    self._pattern = tag_pattern
    regexp = re.compile(('(?P<chunk>%s)%s' % (tag_pattern2re_pattern(tag_pattern), ChunkString.IN_CHINK_PATTERN)))
    RegexpChunkRule.__init__(self, regexp, '{\\g<chunk>}', descr)

dataset/ETHPy150Open nltk/nltk/nltk/chunk/regexp.py ChunkRule.__init__/original