def group(self, index, chunked=False):
if index < <NUM_LIT:0> or index > len(self.pattern.groups):<EOL><INDENT>raise IndexError("<STR_LIT>")<EOL><DEDENT>if index > <NUM_LIT:0> and index <= len(self.pattern.groups):<EOL><INDENT>g = self.pattern.groups[index-<NUM_LIT:1>]<EOL><DEDENT>if index == <NUM_LIT:0>:<EOL><INDENT>g = self.pattern.sequence<EOL><DEDENT>if chunked is True:<EOL><INDENT>return Group(self, self.constituents(constraint=[self.pattern.sequence.index(x) for x in g]))<EOL><DEDENT>return Group(self, [w for w in self.words if self.constraint(w) in g])<EOL>
Returns a list of Word objects that match the given group.
            With chunked=True, returns a list of Word + Chunk objects - see Match.constituents().
            A group consists of consecutive constraints wrapped in { }, e.g.,
            search("{JJ JJ} NN", Sentence(parse("big black cat"))).group(1) => big black.