def _singularize(string):
    """Hacky singularization function."""
    if string.endswith('ies'):
        return string[:-3] + 'y'
    if string.endswith('s'):
        return string[:-1]
    return string
