How to use the wordfreq.TOKEN_RE.search function in wordfreq

To help you get started, we’ve selected a few wordfreq examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LuminosoInsight / wordfreq / wordfreq_builder / wordfreq_builder / tokenizers.py View on Github external
def lowercase_text_filter(token):
    """
    If this looks like a token that we want to count, return it, lowercased.
    If not, filter it out by returning None.
    """
    if TOKEN_RE.search(token):
        return token.lower()
    else:
        return None