#!/usr/bin/env python3
"""
Final U28-U36 word allocation - track all used words to prevent duplicates
"""

# The complete allocation plan
allocation = {
    "U30": {
        "title": "马戏巡游",
        "story": "马戏团来镇→Bingo逃课→解救动物→被发现→点着花车闯祸",
        "func_words": "quickly(adv)",
        "lessons": [
            ("奇怪缺席", [("naughty","adj","淘气的"), ("skip","v","蹦跳走"), ("quickly","adv","快速地"), ("exciting","adj","令人兴奋的")], "Bingo淘气逃课，兴奋蹦跳快速溜走"),
            ("花车巡游", [("circus","n","马戏团"), ("band","n","乐队"), ("loud","adj","大声的"), ("clown","n","小丑")], "马戏团花车喧闹登场的感官冲击"),
            ("笼中朋友", [("cage","n","笼子"), ("lion","n","狮子"), ("parrot","n","鹦鹉"), ("frightened","adj","害怕的")], "发现笼中动物受惊，解救动机涌现"),
            ("暗中营救", [("brave","adj","勇敢的"), ("careful","adj","仔细的"), ("climb","v","攀登"), ("net","n","网")], "鼓起勇气小心攀爬围网潜入"),
            ("闯祸时刻", [("fire","n","火"), ("mistake","n","错误"), ("drop","v","掉落"), ("hurry","v","匆忙")], "慌忙中灯笼掉落引发火灾"),
        ]
    },
    "U31": {
        "title": "家与家人",
        "story": "父母归来→大家庭团聚→Bingo格格不入→决定离开",
        "func_words": "everyone(pron), off(adv)",
        "lessons": [
            ("家人归来", [("parent","n","父/母"), ("drive","n","驱车出行"), ("surprised","adj","惊讶的"), ("everyone","pron","每个人")], "父母驱车归来，每个人都惊喜万分"),
            ("热闹屋檐", [("aunt","n","阿姨"), ("uncle","n","叔叔"), ("grandparent","n","祖父母"), ("stairs","n","楼梯")], "亲戚们涌上楼梯齐聚一堂"),
            ("格格不入", [("laugh","v","笑"), ("share","v","分享"), ("quiet","adj","安静的"), ("busy","adj","忙碌的")], "大家忙碌分享欢笑，Bingo安静旁观"),
            ("血缘之思", [("granddaughter","n","外孙女"), ("grandson","n","外孙子"), ("think","v","认为"), ("age","n","年龄")], "看孙辈与祖父母亲密，想到自己没有年龄"),
            ("悄然离开", [("wish","v","希望"), ("dream","n","梦"), ("off","adv","离开"), ("carry","v","携带")], "梦到使命，希望带着回忆悄悄离开"),
        ]
    },
    "U33": {
        "title": "森林派对",
        "story": "Bingo办Party邀请朋友→盛宴欢笑→朋友离去→空荡孤独",
        "func_words": "sometimes(adv), nothing(pron)",
        "lessons": [
            ("发出邀请", [("party","n","聚会"), ("invite","v","邀请"), ("send","v","发送"), ("message","n","消息")], "Bingo发消息邀请朋友来聚会"),
            ("森林盛宴", [("picnic","n","野餐"), ("pancake","n","薄煎饼"), ("salad","n","沙拉"), ("cup","n","杯子")], "森林里铺开野餐毯摆满美食"),
            ("欢声笑语", [("dance","n","舞蹈"), ("laugh","n","笑"), ("film","v","拍摄"), ("wonderful","adj","精彩的")], "跳舞欢笑拍照，气氛精彩绝伦"),
            ("曲终人散", [("time","n","时间"), ("wave","n","波浪"), ("sometimes","adv","有时"), ("glass","n","玻璃杯")], "时间到了，朋友们有时放下杯子挥手远去"),
            ("空荡回响", [("boring","adj","无趣的"), ("nothing","pron","没什么"), ("bowl","n","碗"), ("plate","n","盘子")], "空碗空盘什么都没了，好无聊——孤独降临"),
        ]
    },
    "U34": {
        "title": "孤独空谷",
        "story": "生态球衰变→花草枯萎→动物躲藏→情绪崩溃→封闭自己",
        "func_words": "badly(adv), never(adv), opposite(prep)",
        "lessons": [
            ("花草凋零", [("plant","v","种植"), ("ground","n","地"), ("dry","v","使变干"), ("fall","v","降落")], "种下的植物从干裂地面掉落——衰败征兆"),
            ("动物失踪", [("feed","v","喂养"), ("kitten","n","小猫"), ("puppy","n","小狗"), ("afraid","adj","害怕")], "去喂小猫小狗却找不到，它们在害怕什么？"),
            ("无力挽回", [("change","v","变化"), ("lose","v","丢失"), ("difficult","adj","困难的"), ("badly","adv","严重地")], "一切严重变化，失控难以挽回"),
            ("呼唤无应", [("mountain","n","高山"), ("shout","v","呼喊"), ("opposite","prep","在对面"), ("never","adv","决不")], "对着对面高山呼喊，回声再也不回应"),
            ("关门谢客", [("cry","v","哭泣"), ("terrible","adj","糟糕的"), ("weak","adj","虚弱的"), ("asleep","adj","睡着的")], "哭到精疲力竭，一切糟透了，虚弱地睡去"),
        ]
    },
    "U35": {
        "title": "永不离弃",
        "story": "发现异常→召集伙伴→返回生态球→找到Bingo→解开心结",
        "func_words": "inside(adv), someone(pron), something(pron)",
        "lessons": [
            ("发现异常", [("call","v","打电话"), ("idea","n","想法"), ("must","adj","必须"), ("matter","n","问题")], "打电话给伙伴：出问题了，有个想法，必须行动"),
            ("集结出发", [("bring","v","带来"), ("map","n","地图"), ("ticket","n","票"), ("trip","n","旅行")], "带上地图买好车票，出发旅行去找Bingo"),
            ("寻找Bingo", [("inside","adv","在里面"), ("move","v","移动"), ("turn","v","转"), ("someone","pron","某人")], "在里面移动转弯搜寻，感觉有人在"),
            ("解开心结", [("need","v","需要"), ("mean","v","意味着"), ("should","v","应该"), ("something","pron","某物")], "你需要明白这意味着某种东西——冬眠是自然的"),
            ("不再孤单", [("strong","adj","强壮的"), ("sure","adj","确定的"), ("safe","adj","安全的"), ("wait","v","等待")], "你很强壮也很安全，春天会来，等着吧"),
        ]
    },
    "U36": {
        "title": "冬假快乐",
        "story": "第一场雪→冬季运动→享受冬天→接纳情绪→成为完整的男孩",
        "func_words": "outside(adv), round(adv)",
        "lessons": [
            ("初雪降临", [("weather","n","天气"), ("temperature","n","温度"), ("coat","n","外套"), ("sweater","n","毛衣")], "天气变冷温度骤降，穿上外套毛衣——冬天来了"),
            ("冰面滑行", [("ice skating","n","滑冰"), ("ice skates","n","冰鞋"), ("score","v","得分"), ("win","v","赢")], "穿冰鞋滑冰比赛得分赢了——冰上运动欢乐"),
            ("雪地欢闹", [("scarf","n","围巾"), ("blanket","n","毯子"), ("outside","adv","在外面"), ("kick","n","踢")], "围着围巾裹着毯子到外面踢雪球"),
            ("温暖环绕", [("round","adv","环绕"), ("sweet","adj","甜的"), ("present","n","礼物"), ("light","n","光")], "大家环绕在温暖灯光中交换甜蜜礼物"),
            ("完整的我", [("better","adj","较好的"), ("grow","v","成长"), ("free","adj","自由的"), ("lovely","adj","可爱的")], "成长让一切变得更好，自由可爱——完整的Bingo"),
        ]
    },
    "U28": {
        "title": "乡村奥德赛",
        "story": "带Bingo认识社区——农场、咖啡馆、田野、村庄、电梯等",
        "func_words": "around(prep), beside(prep)",
        "lessons": [
            ("出门探索", [("village","n","村庄"), ("countryside","n","乡村"), ("field","n","田地"), ("tractor","n","拖拉机")], "走出家门来到乡村：田地里拖拉机轰鸣"),
            ("农场一日", [("farm","n","农场"), ("farmer","n","农夫"), ("build","v","建造"), ("fence","n","围栏")], "——fence不在词库！换"),
        ]
    }
}

# 检查fence
import subprocess
result = subprocess.run(['grep', '-P', '^fence\t', '/tmp/wordbank_all.tsv'], capture_output=True, text=True)
print(f"fence in wordbank: '{result.stdout.strip()}'")

# Let me check what building/construction words are available
result = subprocess.run(['grep', '-P', '(建筑|建造|修)', '/tmp/wordbank_all.tsv'], capture_output=True, text=True)
print(f"\n建筑相关:\n{result.stdout}")
