import re


def _clean_word_name(word):
    """Cleans the text for a word name, returns None if no match

    Prevents us from adding entries that are just prefixes of suffixes, e.g.
    -phobia.
    """
    p = re.compile('(^[\w]+[\w-]*[\w]+)')
    match = p.search(word)
    if match is None:
        #Make sure we aren't excluding one letter words
        p = re.compile('(^[\w]$)')
        match = p.search(word)
        if match is None:
            return None
        else:
            return match.group(0)
    else:
        return match.group(0)