-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 영문 알파벳을 qwerty 자판에 매칭되는 한글로 변환하는 함수 추가 #68
Conversation
Someone is attempting to deploy a commit to the Toss Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 32731ae 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 |
src/convertAlphabetToHangul.ts
Outdated
* @param 한글로 변환하고자 하는 영문 | ||
* @returns 한글 자모로 분해된 문자열 | ||
*/ | ||
export function convertAlphabetToHangul(engKeyboardText: string): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alphabet
이라는 워딩이 영어를 뜻한다는 것을 대부분 경우에 알겠지만, es-hangul에서는 오해의 소지가 존재할 것 같아요.
#64 PR에서 새롭게 추가된 것들을 포함하여, es-hangul 소스 코드 내에서 hangulAlphabet이라는 워딩을 꽤 사용하고 있는데,
영어 알파벳인 경우는 englishAlphabet으로 더 명시적으로 드러내주는게 오해의 소지가 없지 않을까도 싶네요.
제가 괜한 걱정을 하는 것 같기도해서, 작성자분의 생각도 궁금해요!
나무위키 라서 신빙성이 떨어질 수는 있지만 다음과 같은 문단이 있어요! 저는 알파벳이란, 영어에서만 사용되는 단어인줄 알았는데 전세계에서 통용되는 단어였더라고요
하나의 글자가 하나의 자음 또는 모음을 나타내는 문자 체계. 흔히 알파벳 하면 A,B,C,D,E,F,G,H...를 떠올리는데, 이는 라틴 문자이고 '알파벳'은 전 세계 문자 체계 전체의 분류에서 나온 개념이다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
위키피디아 - 국문 에서 알파벳을 검색할 때 음소문자
로 넘겨주고 있으며 위키피디아 - 영문 에서 알파벳을 영문 알파벳으로 국한하지 않는 것 같아요.
추가적으로 캠브릿지 영어 사전 의 예문에서도 English alphabet 이라는 표현을 사용하는 것으로 보아 okinawaa님께서 제안해주신 englishAlphabet이라고 명시적으로 드러내주는 것이 더 좋을 것 같습니다!
캠브릿지 영어 사전 alphabet
뜻: a set of letters used for writing a language
예문: The English alphabet starts with A and ends with Z.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
주로 사용하는 한글 자판과 영문 자판에는 두벌식과 쿼티라는 이름이 있습니다.
문자보다 자판 이름을 써서 convertQwertyToDubeolsik
은 어떨까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 좋습니다!
okinawaa님께서 제안주신 englishAlphabet과 hangulAlphabet을구분하자는 의견과 더불어 honnip님의 제안인 두벌식과 쿼티 자판이름을 사용하는 것이 해당 함수에 대한 설명으로 더 좋은 것 같습니다!
src/convertAlphabetToHangul.spec.ts
Outdated
it('한글 글자는 한글 자/모로 바꾼다.', () => { | ||
expect(convertAlphabetToHangul('vm론트')).toBe('ㅍㅡㄹㅗㄴㅌㅡ'); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
한글 글자인 론트
가, ㄹㅗㄴㅌㅡ
로 쪼개지는것을 유저가 쉽게 파악할 수 없는 동작방식이라고 생각하는데, 쪼개져야 하는 이유가 궁금해요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#64 한글을 한 음절로 합치는 assemble
함수가 만들어지기 전에 해당 코드 작업을 해서 그랬던 것 같습니다.
okinawaa님의 의견에 동의하며 convertAlphabetToHangul
함수는 온전한 한글 음절 (문장)을 리턴하는 함수가 되는 것이 좋을 것 같습니다!
src/convertAlphabetToHangul.spec.ts
Outdated
|
||
describe('convertAlphabetToHangul', () => { | ||
it('알파벳을 한글 타자로 바꾼다.', () => { | ||
expect(convertAlphabetToHangul('abc')).toBe('ㅁㅠㅊ'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
abc를 타자로 친다면, 뮻
이 나올것으로 개발자는 기대할 것이라고 생각하는데 분해된 값이 나와도 괜찮을까요?
convertAlphabetToHangul
를 사용하는 실제 상황을 한번 생각해봤어요.
아래 영상과 같은 검색 시스템에서 한국인 유저가 영어인 상태로 타이핑을 했을때, 한글로 변환해서 데이터 처리를 하는 상황이 꽤 있을 것 같은데 어떻게 생각하시나요!?
Screen.Recording.2024-04-21.at.11.46.24.PM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@okinawaa 님! 남겨주신 리뷰 감사합니다! 리뷰에 대해서 다시 생각해본 제 의견 아래에 추가적으로 남깁니다.
쪼개져야할 이유가 없을 것 같습니다! 해당 함수의 관심사에서 벗어나는 일이니
function 쿼티를_한글로_변환하는_함수(target: string): string {
return assembleHangul(...convertAlphabetToHangul(target).split(""))
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overview
close #60
#60 에서 제안드린 영어 알파벳 자판을 한글 자판으로 바꾸는 함수(
convertQwertyToHangulAlphabet
)와 영어 알파벳을 온전한 한글 음절로 함성하는 함수(convertQwertyToHangul
), QWERTY 영어 알파벳과 한글 음소를 매핑한 상수 변수 (QWERTY_KEYBOARD_MAP
)를 추가합니다.convertQwertyToHangulAlphabet
영어 알파벳을 한글 음소로 바꾸는 역할을 수행합니다.
convertQwertyToHangul
영어 알파벳을 한글로 합성하는 역할을 수행합니다.
QWERTY_KEYBOARD_MAP
PR Checklist