trrex: Efficient keyword extraction with regex
This package contains a function for efficiently representing a set of keywords as regex. This regex can be used to replace keywords in sentences or extract keywords from sentences.
In : import re In : import trrex as tx In : pattern = tx.make(["baby", "bat", "bad"]) In : re.findall(pattern, "The baby was scared by the bad bat.") Out: ['baby', 'bad', 'bat']
Help & Reference