There are three RegexpChunkRule
subclasses that are not supported by RegexpChunkRule.fromstring()
or RegexpParser
, and therefore must be created manually if you want to use them. These rules are as follows:
ExpandLeftRule
: Add unchunked (chink) words to the left of a chunkExpandRightRule
: Add unchunked (chink) words to the right of a chunkUnChunkRule
: Unchunk any matching chunk
ExpandLeftRule
and ExpandRightRule
both take two patterns along with a description as arguments. For ExpandLeftRule
, the first pattern is the chink we want to add to the beginning of the chunk, while the right pattern will match the beginning of the chunk we want to expand. With ExpandRightRule
, the left pattern should match the end of the chunk we want to expand, and the right pattern matches the chink we want to add to the end of the chunk. The idea is similar to the MergeRule
class, but in this case, we're merging chink words instead of other...