feat: ship Wave 5-6 multi-surface hygiene, optimization, and bug fixes
This commit is contained in:
parent
01ef3293cf
commit
66b6b45ba9
399 changed files with 17828 additions and 11330 deletions
|
|
@ -6,9 +6,12 @@ import {
|
|||
applySpeakerLabels,
|
||||
buildTranscriptFromSegments,
|
||||
chunkTranscriptByLines,
|
||||
extractDistinctSpeakers,
|
||||
formatPyannoteSpeakerLabel,
|
||||
formatTranscriptLines,
|
||||
looksTruncatedRewrite,
|
||||
parseTranscriptLines,
|
||||
resolveSpeakerColorIndex,
|
||||
} from '../src/meeting-transcript'
|
||||
|
||||
const START = 1_790_000_000_000 // epoch ms
|
||||
|
|
@ -101,3 +104,36 @@ describe('chunkTranscriptByLines / looksTruncatedRewrite', () => {
|
|||
expect(looksTruncatedRewrite('시각 없는 아주 긴 문장입니다 정말로', '시각')).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('화자 라벨 정규화·색상 인덱스·목록 추출', () => {
|
||||
it('화자변환_pyannote원시ID입력_1기반표시라벨로바꾼다', () => {
|
||||
expect(formatPyannoteSpeakerLabel('SPEAKER_00')).toBe('화자 1')
|
||||
expect(formatPyannoteSpeakerLabel('SPEAKER_01')).toBe('화자 2')
|
||||
expect(formatPyannoteSpeakerLabel('SPEAKER_09', 'Speaker')).toBe('Speaker 10')
|
||||
expect(formatPyannoteSpeakerLabel('윤찬')).toBe('윤찬')
|
||||
})
|
||||
|
||||
it('색상인덱스_번호기반및이름기반화자_일관된팔레트인덱스를반환한다', () => {
|
||||
expect(resolveSpeakerColorIndex('화자 1', 5)).toBe(0)
|
||||
expect(resolveSpeakerColorIndex('Speaker 2', 5)).toBe(1)
|
||||
expect(resolveSpeakerColorIndex('SPEAKER_00', 5)).toBe(0)
|
||||
expect(resolveSpeakerColorIndex('SPEAKER_01', 5)).toBe(1)
|
||||
expect(resolveSpeakerColorIndex('화자 6', 5)).toBe(0)
|
||||
const customIdx = resolveSpeakerColorIndex('김민수', 5)
|
||||
expect(customIdx).toBeGreaterThanOrEqual(0)
|
||||
expect(customIdx).toBeLessThan(5)
|
||||
expect(resolveSpeakerColorIndex('김민수', 5)).toBe(customIdx)
|
||||
})
|
||||
|
||||
it('화자목록_전사세그먼트배열_첫등장순서로중복없이추출한다', () => {
|
||||
expect(
|
||||
extractDistinctSpeakers([
|
||||
{ speaker: null },
|
||||
{ speaker: '화자 2' },
|
||||
{ speaker: ' ' },
|
||||
{ speaker: '화자 1' },
|
||||
{ speaker: '화자 2' },
|
||||
]),
|
||||
).toEqual(['화자 2', '화자 1'])
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue