Skip to content

Commit 4969bf6

Browse files
po4tionokinawaa
andauthored
fix: ㄴ/ㄹ 덧나는 현상에 부가 조건을 추가합니다. (#351)
* fix: ㄴ/ㄹ에서 이 조건 추가 * fix: ㄴ/ㄹ이 덧나는 조건에 부가 조건을 추가합니다. * Create honest-goats-swim.md --------- Co-authored-by: 박찬혁 <[email protected]>
1 parent f533e6f commit 4969bf6

File tree

5 files changed

+36
-1
lines changed

5 files changed

+36
-1
lines changed

.changeset/honest-goats-swim.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"es-hangul": patch
3+
---
4+
5+
fix: ㄴ/ㄹ 덧나는 현상에 부가 조건을 추가합니다.

src/pronunciation/romanize/romanize.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ describe('romanize', () => {
1212
it('ㄴ, ㄹ’이 덧나는 경우', () => {
1313
expect(romanize('학여울')).toBe('hangnyeoul');
1414
expect(romanize('알약')).toBe('allyak');
15+
expect(romanize('호랑이')).toBe('horangi');
16+
expect(romanize('빨간색이에요')).toBe('ppalgansaegieyo');
1517
});
1618

1719
it('구개음화가 되는 경우', () => {

src/pronunciation/standardizePronunciation/rules/transformNLAssimilation.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,24 @@ describe('transformNLAssimilation', () => {
3939
});
4040
});
4141

42+
it('ㄴ/ㄹ이 되기 위한 조건이지만 다음 음절이 받침이 없는 "이"로 이어지는 경우', () => {
43+
const current = defined(disassembleCompleteCharacter('랑'));
44+
const next = defined(disassembleCompleteCharacter('이'));
45+
46+
expect(transformNLAssimilation(current, next)).toEqual({
47+
current: {
48+
choseong: 'ㄹ',
49+
jungseong: 'ㅏ',
50+
jongseong: 'ㅇ',
51+
},
52+
next: {
53+
choseong: 'ㅇ',
54+
jungseong: 'ㅣ',
55+
jongseong: '',
56+
},
57+
});
58+
});
59+
4260
it('ㄴ/ㄹ이 되기 위한 조건이지만 현재 음절의 중성의 ∙(아래아)가 하나가 아닐 경우에는 덧나지 않고 연음규칙이 적용된다', () => {
4361
const current = defined(disassembleCompleteCharacter('양'));
4462
const next = defined(disassembleCompleteCharacter('이'));

src/pronunciation/standardizePronunciation/rules/transformNLAssimilation.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
ㄴㄹ이_덧나는_후속음절_모음,
55
ㄴㄹ이_덧나서_받침_ㄴ_변환,
66
ㄴㄹ이_덧나서_받침_ㄹ_변환,
7+
음가가_없는_자음,
78
} from '../constants';
89
import type { ReturnSyllables, Syllable } from './rules.types';
910

@@ -22,7 +23,9 @@ export function transformNLAssimilation(currentSyllable: Syllable, nextSyllable:
2223
const ㄴㄹ이덧나는조건 =
2324
current.jongseong && next.choseong === 'ㅇ' && arrayIncludes(ㄴㄹ이_덧나는_후속음절_모음, next.jungseong);
2425

25-
if (!ㄴㄹ이덧나는조건) {
26+
const is이 = next.choseong === 음가가_없는_자음 && next.jungseong === 'ㅣ' && !next.jongseong;
27+
28+
if (!ㄴㄹ이덧나는조건 || is이) {
2629
return {
2730
current,
2831
next,

src/pronunciation/standardizePronunciation/standardizePronunciation.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ describe('standardizePronunciation', () => {
7878
expect(standardizePronunciation('불여우')).toBe('불려우');
7979
});
8080

81+
it('ㄴ/ㄹ이 되기 위한 조건이지만 다음 음절이 받침이 없는 "이"로 이어지는 경우', () => {
82+
expect(standardizePronunciation('호랑이')).toBe('호랑이');
83+
expect(standardizePronunciation('개구쟁이')).toBe('개구쟁이');
84+
expect(standardizePronunciation('공이')).toBe('공이');
85+
expect(standardizePronunciation('손잡이', { hardConversion: false })).toBe('손자비');
86+
});
87+
8188
it('ㄴ/ㄹ이 되기 위한 조건이지만 현재 음절의 중성의 ∙(아래아)가 하나가 아닐 경우에는 덧나지 않고 연음규칙이 적용된다', () => {
8289
expect(standardizePronunciation('고양이')).toBe('고양이');
8390
expect(standardizePronunciation('윤여정')).toBe('윤녀정');

0 commit comments

Comments
 (0)