def process_titles(df):
    """
    Extracts and categorizes the title from each name entry.

    :param df: Dataframe
    :return: Dataframe with an additional column for a person's title
    """
    titles = {
        "Mr": "Mr",
        "Mme": "Mrs",
        "Ms": "Mrs",
        "Mrs": "Mrs",
        "Master": "Master",
        "Mlle": "Miss",
        "Miss": "Miss",
        "Capt": "Officer",
        "Col": "Officer",
        "Major": "Officer",
        "Dr": "Officer",
        "Rev": "Officer",
        "Jonkheer": "Royalty",
        "Don": "Royalty",
        "Sir": "Royalty",
        "Countess": "Royalty",
        "Dona": "Royalty",
        "Lady": "Royalty"
    }
    extracted_titles = df["Name"].str.extract(r' ([A-Za-z]+)\.', expand=False)
    df["Title"] = extracted_titles.map(titles)
    return df