# Path: linguistica/util.py
# NULL = 'NULL'


from itertools import (combinations, groupby)
from linguistica.util import NULL
        for stem in sigs_to_stems[sig]:
            if stem not in stems_to_sigs:
                stems_to_sigs[stem] = set()
            stems_to_sigs[stem].add(sig)

    return stems_to_sigs


def check_affix(word, affix, suffixing):
    if suffixing:
        is_affix = lambda word_, affix_: word_.endswith(affix_)  # noqa
    else:
        is_affix = lambda word_, affix_: word_.startswith(affix_)  # noqa

    if affix == NULL:
        affix = ""
    if is_affix(word, affix):
        return True
    else:
        return False


def make_words_to_sigtransforms(words_to_sigs, suffixing):
    words_to_sigtransforms = dict()

    for word in words_to_sigs.keys():
        sigs = words_to_sigs[word]
        sigtransforms = set()

        for sig in sigs:

# Path: linguistica/util.py
# NULL = 'NULL'


# Path: linguistica/signature.py
from itertools import (combinations, groupby)
from linguistica.util import NULL

        for stem in sigs_to_stems[sig]:
            if stem not in stems_to_sigs:
                stems_to_sigs[stem] = set()
            stems_to_sigs[stem].add(sig)

    return stems_to_sigs


def check_affix(word, affix, suffixing):
    if suffixing:
        is_affix = lambda word_, affix_: word_.endswith(affix_)  # noqa
    else:
        is_affix = lambda word_, affix_: word_.startswith(affix_)  # noqa

    if affix == NULL:
        affix = ""
    if is_affix(word, affix):
        return True
    else:
        return False


def make_words_to_sigtransforms(words_to_sigs, suffixing):
    words_to_sigtransforms = dict()

    for word in words_to_sigs.keys():
        sigs = words_to_sigs[word]
        sigtransforms = set()

        for sig in sigs:

            for affix in sig: