def _looper(x, function, **kwargs):
    """
        Wrapper function to apply the function passed as input to the list of words x 
        and return a regular expression with all the different ways in which
        all the words of the list can appear written in text, 
        given their shared morphology.
        """
    pattern_list = []
    for a in x:
        pattern = function(a, **kwargs)
        pattern_list.append(pattern)
    return '({0})'.format('|'.join(pattern_list))
