def filter_content(soup, content_filter):

    """
    Filter page content and return a list of words visible on the web page.

    NOTE: The assignment specifies 'content' but doesn't explicitly state if this refers to visible
    content or all source content. I have assumed visible content for this exercise. This can be altered
    by specifying an alternative filter callback.

    :param soup: object
        BeautifulSoup object

    :param content_filter: function
        filter callback

    :return: list
        List of words found in page
    """

    page_text = soup.findAll(text=True)

    visible_text = filter(content_filter, page_text)

    word_list = []

    for row in visible_text:
        if row.strip():
            words = row.strip().split(' ')

            word_list += [w.strip().replace(',', '').replace('.', '').lower() for w in words]

    return word_list