Skip to content

Conversation

@po4tion
Copy link
Collaborator

@po4tion po4tion commented Apr 26, 2025

Overview

#263 의 이슈를 해결하는 PR입니다.

[해결건]

  1. '힘듦'의 발음은 '힘듬'인데 '힘뜸'으로 변환한다.
  2. '힘듦이 있다'는 에러를 반환한다.
  3. '전역'은 '저녁'인데 '전녁'으로 변환한다.

[미해결건]

  1. '전 역'은 '전녁'인데 '전 역'으로 변환한다.

제보해주신 4건의 오류 중 3건은 수정 완료했습니다.
다만, 미해결된 1건은 자바스크립트 코드만으로는 해결이 어렵다고 판단했습니다.

이유는, 함수의 파라미터로 '전 역'과 같은 입력이 들어왔을 때 기대하는 출력은 '전녁'처럼 실제 발음 변화를 반영하는 것이지만, 한국어의 발음 변동(연음, 경음화, 유음화, 비음화, 음운 첨가 등)은 매우 복잡하여 단순 규칙만으로는 완전한 처리가 불가능하기 때문입니다.

특히, 입력 문자열이 띄어쓰기를 포함하고 있을 경우, 단순히 단어 단위로 나누는 것만으로는 음운 연결 여부를 정확히 판별할 수 없습니다. '전 역'과 같은 입력의 경우에는 음운 연결 여부가 굉장히 중요합니다.

현재 es-hangul은 별도의 AI 분석이나 외부 사전 API 없이, 순수 타입스크립트 코드만으로 처리하는 방향으로 개발하고 있기 때문에, 이 문제는 한계가 있을 수밖에 없다고 판단했습니다.

테스트 결과

image

PR Checklist

  • I read and included theses actions below
  1. I have read the Contributing Guide
  2. I have written documents and tests, if needed.

@po4tion po4tion added the bug Something isn't working label Apr 26, 2025
@po4tion po4tion self-assigned this Apr 26, 2025
@changeset-bot
Copy link

changeset-bot bot commented Apr 26, 2025

🦋 Changeset detected

Latest commit: 8b1b2ee

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Apr 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
es-hangul Ready Ready Preview Comment Sep 27, 2025 4:22am

@po4tion po4tion changed the title fix: '자음군 단순화' 규칙을 적용하여 standardizePronunciation 오류 해결 fix: '자음군 단순화' 음운규칙을 적용하여 standardizePronunciation 오류 해결 Apr 26, 2025
ㅂㅅ: 'ㅂ',
} as const;

export const 단일어_예외사항_단어모음: Record<string, string> = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요 상수가 추가된 맥락을 문서에 정리할 수 있을까요?
이러한 예외사항은 타입스크립트로 판별이 불가능해서 예외로 뺐고, 추가가 필요하면 기여를 해달라고 하면 될 것 같습니다!
이미 PR Description에 잘 작성해주신 내용을 잘 녹여내면 될 것 같아요,.

Copy link
Collaborator Author

@po4tion po4tion May 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

fix: 단일어 예외사항 상수가 추가된 맥락을 문서에 작성합니다
docs: 표준발음법 영문 문서 추가

예외사항을 문서에 정리해봤습니다. 혹시 문서에 적힌 어투나 개선되어야 할 표현이 있다면 말씀 부탁드립니다!

ㅂㅅ: 'ㅂ',
} as const;

export const 단일어_예외사항_단어모음: Record<string, string> = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수도권: '수도꿘'

도 비슷하게 여기에 추가되면 좋을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다음과 같은 방법을 제안해봅니다.

배경

  1. '수도권'은 된소리되기 규칙에 따라 '수도꿘'으로 발음되지만, 이는 말하기의 편의성이나 관습적인 사용이 누적되어 굳어진 특이한 사례입니다.
  2. 반면, '전역'처럼 파생어, 합성어인지 구분하지 못해 잘못된 발음이 발생하는 경우는 그 사유가 '수도권'과 다릅니다.

제안 방향

const 파생어_합성어_예외사항 = {
  전역: '저녁'
};

const 관습적_예외사항 = {
  수도권: '수도꿘'
};

위에 선언한 상수들처럼 예외 사유에 따라 단어군을 분류해 정리할 것을 제안합니다.

목적

  1. 예외처리 상수에 여러 사유가 뒤섞여 있으면 예외 단어가 확장될수록 관리와 히스토리 트래킹이 어려워질 것 같다고 판단했습니다.
  2. 예외 사유별로 명확히 분류하여 향후 유지보수성과 확장성을 높이는 것을 목표로 합니다.

ㄴ/ㄹ이 덧나는 조건에 자음군 단수화 조건 추가
Copy link
Member

@okinawaa okinawaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

감사합니다!

@okinawaa okinawaa merged commit d329225 into toss:main Sep 27, 2025
2 of 10 checks passed
@github-actions github-actions bot mentioned this pull request Sep 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants