def _truncatewords(val, length, end='...'):
    """Truncate a sentence"""
    words = val.split()
    if len(words) <= length:
        return ' '.join(words)
    return ' '.join(words[:length]) + end
