with open("record_types.txt", "r") as f:
    data = f.read()

ACCEPTED = {
    "ACHR", "ACTI", "TACT", "ALCH", "AMMO", "ANIO",
    "ARMO", "PARW", "PBAR", "PBEA", "PCON", "PFLA",
    "PGRE", "PHZD", "PMIS", "CELL", "CONT", "CSTY",
    "DOOR", "EYES", "FURN", "GLOB", "HDPT", "MSTT",
    "IDLM", "SLGM", "NAVM", "PERK", "SHOU", "RELA",
    "CLFM", "INFO", "KEYM", "LAND", "LIGH", "LSCR",
    "MISC", "NPC_", "RACE", "REFR", "REGN", "STAT",
    "TES4", "TREE", "WEAP", "WRLD",
}
NONE = "none"
GROUPING = 3
PREFIX = "RT_"
line = []
out = ""
for i, l in enumerate(data.split("\n")):
    word = l.strip()
    if word in ACCEPTED:
        line += [f"[{PREFIX}{word}] = _{word.lower()}"]
    else:
        line += [f"[{PREFIX}{word}] = _{NONE}"]

    if (i + 1) % GROUPING == 0:
        out += ", ".join(line) + ",\n"
        line = []

if line:
    out += ", ".join(line) + ",\n"

print(out)
