trrex: efficient keyword mining with regular expressions#

The package includes a function that represents a collection of keywords (strings) as a regular expression. This regular expression can be used for multiple purposes, such as keyword replacement, keyword extraction, fuzzy matching, and other similar tasks.

In [1]: import re

In [2]: import trrex as tx

In [3]: pattern = tx.make(["baby", "bat", "bad"])

In [4]: re.findall(pattern, "The baby was scared by the bad bat.")
Out[4]: ['baby', 'bad', 'bat']

User Guide#