@staticmethod
    def fromstring(s):
        # Split off the comment (but don't split on '\#')
        m = re.match(r'(?P<rule>(\\.|[^#])*)(?P<comment>#.*)?', s)
        rule = m.group('rule').strip()
        comment = (m.group('comment') or '')[1:].strip()

        # Pattern bodies: chunk, chink, split, merge
        try:
            if not rule:
                raise ValueError('Empty chunk pattern')
            if rule[0] == '{' and rule[-1] == '}':
                return ChunkRule(rule[1:-1], comment)
            elif rule[0] == '}' and rule[-1] == '{':
                return ChinkRule(rule[1:-1], comment)
            elif '}{' in rule:
                left, right = rule.split('}{')
                return SplitRule(left, right, comment)
            elif '{}' in rule:
                left, right = rule.split('{}')
                return MergeRule(left, right, comment)
            elif re.match('[^{}]*{[^{}]*}[^{}]*', rule):
                left, chunk, right = re.split('[{}]', rule)
                return ChunkRuleWithContext(left, chunk, right, comment)
            else:
                raise ValueError('Illegal chunk pattern: %s' % rule)
        except (ValueError, re.error):
            raise ValueError('Illegal chunk pattern: %s' % rule)
Hook for overriding on subclassed commands. Do any preprocessing
dataset/ETHPy150Open nltk/nltk/nltk/chunk/regexp.py/RegexpChunkRule.fromstring--crossover with--dataset/ETHPy150Open evennia/evennia/evennia/commands/default/building.py/CmdCpAttr.get_attr