(actual: Map<string, number>, expected: Map<string, number>, label: string)
| 22 | ] |
| 23 | |
| 24 | function assertMapEqual(actual: Map<string, number>, expected: Map<string, number>, label: string): void { |
| 25 | assert.equal(actual.size, expected.size, `${label}: size mismatch`) |
| 26 | for (const [key, value] of expected) { |
| 27 | assert.equal(actual.get(key), value, `${label}: value mismatch for "${key}"`) |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | describe('batchSegmentChineseWithStats 与旧两遍分词等价', () => { |
| 32 | it('meaningful 模式:词频/总数/去重数/词性统计均一致', () => { |