// @ts-nocheck export function inferTimetableQuery(text) { const s = String(text || '').trim(); if (!s) return ''; const loadMatch = s.match(/(?:请|帮我|麻烦)?(?:加载|打开|载入|导入)\s*[`"'「]?([^`"'」\s,,。!?]+?)[`"'」]?(?:的)?(?:运营图|时刻表|运行图)/i); if (loadMatch && loadMatch[1]) return loadMatch[1].trim(); const bareMatch = s.match(/([^,,。!?\s]+?)(?:的)?(?:运营图|时刻表|运行图)/i); if (bareMatch && bareMatch[1] && !/^(加载|打开|载入|导入|请|帮我)/.test(bareMatch[1])) { return bareMatch[1].trim(); } return ''; } export function normalizeTimetableQuery(raw) { let q = String(raw || '').trim(); if (!q) return ''; const inferred = inferTimetableQuery(q); if (inferred) return inferred; q = q.replace(/^(?:请|帮我|麻烦)?(?:加载|打开|载入|导入)\s*/i, '').trim(); q = q.replace(/的?(?:运营图|时刻表|运行图)$/i, '').trim(); return q; }