def resolve_alias(term: str) -> str:
    """
    Resolves search term aliases (e.g., 'loc' for 'locations').
    """
    if term in ("loc", "location"):
        return "locations"
    elif term == "kw":
        return "keywords"
    elif term == "setting":
        return "setting"
    elif term == "character":
        return "characters"
    else:
        return term