Пример #1
0
def is_person_page(page):
    """Determines whether or not the given page object is a person page."""
    if "list" in page.title.lower():
        return False
    return len([c for c in page.categories
                if Keywords.check_match("people", c)
                and "list" not in c.lower()
                and "errors" not in c.lower()
                and "wikipedia" not in c.lower()]) > 0
Пример #2
0
def is_person_page(page):
    """Determines whether or not the given page object is a person page."""
    if "list" in page.title.lower(
    ):  # TODO This catches "list" as in "journalist", etc.
        return False
    return len([
        c for c in page.categories
        if Keywords.check_match("people", c) and "list" not in c.lower()
        and "errors" not in c.lower() and "wikipedia" not in c.lower()
    ]) > 0
Пример #3
0
def is_animal_page(page):
    """Determines whether or not the given page object is aa animal page."""
    if "list" in page.title.lower():
        return False
    if is_person_page(page):
        return False
    return len([
        c for c in page.categories
        if Keywords.check_match("animals", c) and "list" not in c.lower()
        and "errors" not in c.lower() and "wikipedia" not in c.lower()
    ]) > 0