
# 检查每个知识点的"首次输出前是否有至少1次输入"
# 以及连续中互动问题

print("=" * 60)
print("输入→输出顺序检查")
print("=" * 60)

# 首次输入行号 vs 首次输出行号
first_input = {
    'seventy': 29,
    'eighty': 20,
    'help': 43,
    'use': 45,
    'We can use': None,  # NPC没有说过完整句型
    'That helps a lot': 49,
}

first_output = {
    'seventy': 79,
    'eighty': 21,
    'help': 53,
    'use': 55,
    'We can use': 76,
    'That helps a lot': 68,
}

for kp in first_input:
    inp = first_input[kp]
    out = first_output[kp]
    if inp is None:
        print(f"⚠️ {kp}: NPC从未输入过完整句型，User行{out}就输出了")
    elif out < inp:
        print(f"❌ {kp}: 输出(行{out})在输入(行{inp})之前！")
    else:
        print(f"✅ {kp}: 输入(行{inp}) → 输出(行{out}) 顺序正确")

# 检查连续互动（相邻两行都是互动）
print("\n" + "=" * 60)
print("连续互动检查")
print("=" * 60)

all_types = [
    (21, '互动'), (22, 'TL'),  # TL紧跟互动
    (53, '互动'), (54, 'TL'), (55, '互动'),  # 互动-TL-互动
    (63, '互动'), (64, 'TL'),
    (68, '互动'), (69, 'TL'),
    (76, '互动'), (77, 'TL'), (78, 'TL'), (79, '互动'),
    (98, '互动'), (99, 'TL'),
    (105, '互动'), (106, 'TL'), (107, 'TL'), (108, '互动'),
    (128, '互动'), (129, 'TL'),
    (137, '核心互动'),
    (141, '互动'), (142, 'TL'),
    (146, '互动'), (147, 'TL'),
    (171, '互动'), (172, 'TL'),
]

# 简化：逐一检查互动行之间是否有TL隔开
interact_lines = [line for line, t in all_types if t in ('互动', '核心互动')]
for i in range(len(interact_lines)-1):
    if interact_lines[i+1] - interact_lines[i] <= 2:
        # 检查中间是否只有1行TL
        gap = interact_lines[i+1] - interact_lines[i]
        if gap == 1:
            print(f"⚠️ 行{interact_lines[i]}和行{interact_lines[i+1]}: 连续互动，中间无TL隔开")
        elif gap == 2:
            print(f"ℹ️ 行{interact_lines[i]}和行{interact_lines[i+1]}: 仅隔1行TL")

# 检查help输出是否过多
print("\n" + "=" * 60)
print("help输出过多分析（6次，标准2-3次）")
print("=" * 60)

help_outputs = [
    (53, "Can you help Bingo?"),
    (63, "I can help to make it!"),
    (68, "Wow! That helps a lot!"),  # 这里help是句型的一部分
    (108, "That helps a lot!"),  # 同上
    (128, "Let me help you!"),
    (171, "That helps a lot, Bingo!"),  # 同上
]

print("其中3次是句型'That helps a lot'的组成部分：")
print("  行68, 行108, 行171")
print("纯help动词输出：行53, 行63, 行128 = 3次")
print("如果句型中的help不重复计数，则help单词输出3次 ✅")
print("但如果教研统计会合并计数，则6次 ⚠️ 偏多")

