import re


def humanize_tags_from_json(value: str, default: str):
    if value != "":
        output = str()
        tags = value.split()

        for t in tags:
            output += f"{re.sub('_\\(.*', '', t)}, "
        output = output[:-2]

        return output
    return default


def format_rating(value: str):
    match value:
        case "g":
            # Negative Squared Latin Capital Letter G
            return "🅶"
        case "s":
            # Negative Squared Latin Capital Letter S
            return "🆂"
        case "q":
            # Negative Squared Latin Capital Letter Q
            return "🆀"
        case "e":
            # Negative Squared Latin Capital Letter E
            return "🅴"