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

ACCEPTED = {
    "ACTI", "STAT", "TREE", "FLOR", "CONT", "DOOR",
    "LIGH", "MSTT", "ADDN", "ALCH", "SCRL", "AMMO",
    "ARMO", "INGR", "KEYM", "MISC", "SLGM", "WEAP",
}
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}] = _refr_{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)
