import re


def fix_leftover_headers(summary_content):
    """
    Function removes leftover prefixes from the summary text, such as: Chapter 1, Chapter V, Analysis, etc.

    :param summary_content: summary text
    """
    # remove 'chapter' text
    summary_content = [sent for sent in summary_content if not re.match(r"^[- ]*Chapter[ ]?([0-9]{1,3}|[XVIL]{1,6})[ :.-]*$", sent)]

    # remove 'analysis' text
    summary_content = [sent for sent in summary_content if not sent == "Analysis"]

    # remove floating punctuations
    summary_content = [sent for sent in summary_content if not sent == "-" or not sent == "."]

    return summary_content