feat(input,voice): instant first-word-after-focus PC layout fix and speech disfluency post-processing (INPUT-04, INPUT-19, AI-03, AI-05)
This commit is contained in:
parent
dbed97c348
commit
7a86afa7b0
22 changed files with 359 additions and 39 deletions
34
packages/core/__tests__/dictation-cleaner.test.ts
Normal file
34
packages/core/__tests__/dictation-cleaner.test.ts
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { describe, expect, it } from 'vitest'
|
||||
import { cleanDictatedText } from '../src/dictation-cleaner'
|
||||
|
||||
describe('cleanDictatedText (받아쓰기 추임새·말바꾸기·중복·동음이의어 결정적 정리)', () => {
|
||||
it('말하다가 즉시 고쳐 말한 자기 수정(검색 아니 검색이 아니라 타이핑을)과 추임새·중복을 정리하고 원래 반말 어조를 유지한다', () => {
|
||||
const raw =
|
||||
'예를 들자면은 pc라고 한글로 검색 아니 검색이 아니라 타이핑을 했을 때 pc라고 타이핑하면은 스시가 영어로 변경되지 않아'
|
||||
expect(cleanDictatedText(raw)).toBe(
|
||||
'예를 들어 PC라고 한글로 타이핑하면 PC가 영어로 변경되지 않아'
|
||||
)
|
||||
})
|
||||
|
||||
it('단독 추임새(어, 음, 그 쓸데없는)는 제거하되 인용된 어라든가·아라든가와 지시관형사 그는 보존한다', () => {
|
||||
const raw =
|
||||
'그 후처리 효과 근데 후처리 같은 것들도 보면은 어 어라든가 아니면 아라든가 그 쓸데없는 의미없는 다른 것들이라든지 어 중복된 거라든지 이런 것들 다 정리해 주는 것들은 없거든'
|
||||
expect(cleanDictatedText(raw)).toBe(
|
||||
'그 후처리 효과 근데 후처리 같은 것들도 보면 어라든가 아니면 아라든가 불필요한 다른 것들이라든지 중복된 거라든지 이런 것들 다 정리해 주는 것들은 없거든'
|
||||
)
|
||||
})
|
||||
|
||||
it('연속 동일 어절 말더듬은 한 번으로 줄이되 의도적 부사 반복(조금 조금, 천천히 천천히)은 유지한다', () => {
|
||||
expect(cleanDictatedText('어 지금 내가 내가 받아쓰기 하는 것도 있잖아')).toBe(
|
||||
'지금 내가 받아쓰기 하는 것도 있잖아'
|
||||
)
|
||||
expect(cleanDictatedText('조금 조금 천천히 천천히 진행하자')).toBe(
|
||||
'조금 조금 천천히 천천히 진행하자'
|
||||
)
|
||||
})
|
||||
|
||||
it('감탄사 한 글자만 말한 경우 빈 문자열로 만들지 않고 원문을 보존한다', () => {
|
||||
expect(cleanDictatedText('어')).toBe('어')
|
||||
expect(cleanDictatedText('음')).toBe('음')
|
||||
})
|
||||
})
|
||||
|
|
@ -711,4 +711,17 @@ describe('Araso 급 한/영 자동 전환 · 합성어 · 잔류 Shift · URL
|
|||
})
|
||||
expect(rebaseTypoReplacementPlan(base!, 'ㅡㅁ가둥', '전혀다른문장', 18)).toBeNull()
|
||||
})
|
||||
|
||||
it('PC·OS·PR·PM·PO 등 2글자 호환 자모 약어(Shift 포함)와 한글 접두+자모 약어 합성어(내ㅔㅊ, 회사ㅔㅊ에서, 한글로ㅔㅊ라고)를 즉시 복원한다', () => {
|
||||
expect(applyAll('ㅔㅊ')).toBe('PC')
|
||||
expect(applyAll('ㅖㅊ')).toBe('PC')
|
||||
expect(applyAll('ㅔㅊ ')).toBe('PC ')
|
||||
expect(applyAll('ㅔㅊ에서 ')).toBe('PC에서 ')
|
||||
expect(applyAll('ㅔㅊ라고 ')).toBe('PC라고 ')
|
||||
expect(applyAll('내ㅔㅊ ')).toBe('내PC ')
|
||||
expect(applyAll('회사ㅔㅊ에서 ')).toBe('회사PC에서 ')
|
||||
expect(applyAll('한글로ㅔㅊ라고 ')).toBe('한글로PC라고 ')
|
||||
expect(applyAll('윈도우ㅐㄴ ')).toBe('윈도우OS ')
|
||||
expect(applyAll('새ㅁㅔㅑ를 ')).toBe('새API를 ')
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue