修复匹配的问题
This commit is contained in:
@@ -189,7 +189,7 @@ test('versioned sanitized gold corpus replays deterministically', async () => {
|
||||
const corpus = JSON.parse(await readFile(
|
||||
new URL('../../samples/business-parser-gold-corpus.json', import.meta.url), 'utf8'
|
||||
));
|
||||
assert.equal(corpus.version, 'ltjt-program-parser-v1.0.13');
|
||||
assert.equal(corpus.version, 'ltjt-program-parser-v1.0.14');
|
||||
assert.ok(corpus.cases.length >= 28);
|
||||
for (const candidate of corpus.cases) {
|
||||
const parse = () => parseProgramInput({
|
||||
@@ -410,6 +410,18 @@ test('independent headcount distributions keep occupied and non-occupied childre
|
||||
}
|
||||
});
|
||||
|
||||
test('named references retain original fullwidth spelling and internal whitespace in keyword', async () => {
|
||||
const parsed = await parseProgramInput({
|
||||
rawText: '独立团单个下单\n发团日期:09-19\n预订客户:测试客户(人名币)\n产品搜索:单订房 (测试市场)\n预估人数:1\n用房数量:1大床房',
|
||||
receivedAt: '2026-09-18T21:16:59+08:00'
|
||||
});
|
||||
assert.equal(parsed.status, 'agent_parse_passed', JSON.stringify(parsed));
|
||||
const data = (parsed.operation as any).data;
|
||||
assert.deepEqual(data.product, { name: '单订房 (测试市场)', keyword: '单订房 (测试市场)' });
|
||||
assert.deepEqual(data.customer, { name: '测试客户(人民币)', keyword: '测试客户(人名币)' });
|
||||
assert.deepEqual(data.room_counts, { DBL: 1 });
|
||||
});
|
||||
|
||||
test('registered customer typo is normalized only in name while keyword preserves source', async () => {
|
||||
const result = await parseProgramInput({ rawText: routeCases[0].input, receivedAt });
|
||||
const customer = ((result.operation as any).data.customer);
|
||||
|
||||
Reference in New Issue
Block a user