Files
calx/grammar/number.gbnf
YANG JIANKUAN e42e2202b1 feat: 双人抢答模式 + 识别优化 + PC/Pad 布局重设计
- 识别:按题动态 grammar(前缀锁定因数)、只输出中文数字、发音兼容别名(n/l 不分、四十↔十四混淆重录)
- 新增双人抢答:键盘/蓝牙手柄绑定抢答、A 秒硬截止扣分、实时计分与冠军结算,支持顺序/随机出题
- 全局口诀范围设置(几开头~几开头,localStorage 持久化)
- 修复退出比赛残留定时器弹结果卡的 bug(epoch 代际守卫);计时条改 rAF 逐帧驱动
- 新增 eval.js 端到端识别回归评测(135 例 100%)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 19:24:28 +08:00

12 lines
687 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 约束 whisper 只输出「乘法口诀答案」:可选(两因数[得]) + 一个中文数字
# 只允许中文数字:阿拉伯数字会把「十四/七十四」压扁成 14/74丢掉「十」的信息
# alias 是发音兼容别名n/l 不分、口语、同音),前端 DIG 表映射回数字
root ::= prefix? product
prefix ::= fd fd "得"?
fd ::= "一" | "二" | "三" | "四" | "五" | "六" | "七" | "八" | "九"
product ::= tens | teen | unit | "十"
unit ::= "零" | "一" | "二" | "三" | "四" | "五" | "六" | "七" | "八" | "九" | alias
alias ::= "牛" | "流" | "柳" | "溜" | "两" | "酒"
teen ::= "十" unit
tens ::= unit "十" unit?