From 0f38431ee611cb89c7e121fd02ab34f749a0c386 Mon Sep 17 00:00:00 2001 From: Song Hyo Jin Date: Sat, 29 Jun 2024 20:35:30 +0900 Subject: [PATCH 01/19] =?UTF-8?q?fix:=20=EC=BD=94=EB=93=9C=20=ED=9A=A8?= =?UTF-8?q?=EC=9C=A8=20=EA=B0=9C=EC=84=A0=20(#124)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 모든 글자의 자소를 나누지 않고 마지막 글자만 계산합니다. * fix: /\s/g to /\s+/g 일괄치환 효율 증가 bench: https://jsfiddle.net/crucify/g74b5d1h/ * fix: NFD 로 변환하여 자소계산 과정 생략하고 초성 ㄱ-ㅎ 만 남기게 수정 * fix: 자소계산을 생략하고 받침이 있는지만 검사합니다. * fix: 유니코드 상수화 가독성 향상 * fix: 기존함수 받침문제 테스트 추가 (이 브랜치에서 해결됨) * Create sixty-clouds-repeat.md --------- Co-authored-by: 박찬혁 --- .changeset/sixty-clouds-repeat.md | 5 ++++ src/chosungIncludes.ts | 4 +-- src/constants.ts | 10 +++++++ src/removeLastHangulCharacter.spec.ts | 1 + src/removeLastHangulCharacter.ts | 20 +++---------- src/utils.ts | 43 ++++++++++++++++++++------- 6 files changed, 55 insertions(+), 28 deletions(-) create mode 100644 .changeset/sixty-clouds-repeat.md diff --git a/.changeset/sixty-clouds-repeat.md b/.changeset/sixty-clouds-repeat.md new file mode 100644 index 00000000..0210dfec --- /dev/null +++ b/.changeset/sixty-clouds-repeat.md @@ -0,0 +1,5 @@ +--- +"es-hangul": patch +--- + +fix: 코드 효율 개선 diff --git a/src/chosungIncludes.ts b/src/chosungIncludes.ts index 254d1f30..3617a0c0 100644 --- a/src/chosungIncludes.ts +++ b/src/chosungIncludes.ts @@ -2,13 +2,13 @@ import { disassembleHangulToGroups } from './disassemble'; import { canBeChosung, getChosung } from './utils'; export function chosungIncludes(x: string, y: string) { - const trimmedY = y.replace(/\s/g, ''); + const trimmedY = y.replace(/\s+/g, ''); if (!isOnlyChosung(trimmedY)) { return false; } - const chosungX = getChosung(x).replace(/\s/g, ''); + const chosungX = getChosung(x).replace(/\s+/g, ''); const chosungY = trimmedY; return chosungX.includes(chosungY); diff --git a/src/constants.ts b/src/constants.ts index 217defe3..6579e3cc 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -3,6 +3,16 @@ export const COMPLETE_HANGUL_END_CHARCODE = '힣'.charCodeAt(0); export const NUMBER_OF_JONGSUNG = 28; export const NUMBER_OF_JUNGSUNG = 21; +const _JASO_HANGUL_NFD = [...'각힣'.normalize('NFD')].map(char => char.charCodeAt(0)); // NFC 에 정의되지 않은 문자는 포함하지 않음 +export const JASO_HANGUL_NFD = { + START_CHOSEONG: _JASO_HANGUL_NFD[0], // ㄱ + START_JUNGSEONG: _JASO_HANGUL_NFD[1], // ㅏ + START_JONGSEONG: _JASO_HANGUL_NFD[2], // ㄱ + END_CHOSEONG: _JASO_HANGUL_NFD[3], // ㅎ + END_JUNGSEONG: _JASO_HANGUL_NFD[4], // ㅣ + END_JONGSEONG: _JASO_HANGUL_NFD[5], // ㅎ +} + /** * ㄱ -> 'ㄱ' * ㄳ -> 'ㄱㅅ' 으로 나눈다. diff --git a/src/removeLastHangulCharacter.spec.ts b/src/removeLastHangulCharacter.spec.ts index 17ce98f7..0445bc43 100644 --- a/src/removeLastHangulCharacter.spec.ts +++ b/src/removeLastHangulCharacter.spec.ts @@ -3,6 +3,7 @@ import { removeLastHangulCharacter } from './removeLastHangulCharacter'; describe('removeLastHangulCharacter', () => { it('마지막 문자가 겹받침인 경우 홑받침으로 바꾼다.', () => { expect(removeLastHangulCharacter('안녕하세요 값')).toBe('안녕하세요 갑'); + expect(removeLastHangulCharacter('안녕하세요 값이')).toBe('안녕하세요 값ㅇ'); }); it('마지막 문자가 초성과 중성의 조합으로 끝날 경우 초성만 남긴다.', () => { expect(removeLastHangulCharacter('프론트엔드')).toBe('프론트엔ㄷ'); diff --git a/src/removeLastHangulCharacter.ts b/src/removeLastHangulCharacter.ts index 20c7ac15..59838522 100644 --- a/src/removeLastHangulCharacter.ts +++ b/src/removeLastHangulCharacter.ts @@ -20,25 +20,13 @@ import { excludeLastElement } from './_internal'; * removeLastHangulCharacter('신세계') // 신세ㄱ */ export function removeLastHangulCharacter(words: string) { - const disassembledGroups = disassembleHangulToGroups(words); - const lastCharacter = disassembledGroups[disassembledGroups.length - 1]; - + const lastCharacter = words[words.length - 1]; if (lastCharacter == null) { return ''; } - - const withoutLastCharacter = disassembledGroups - .filter(v => v !== lastCharacter) - .map(([first, middle, last]) => { - if (middle != null) { - return combineHangulCharacter(first, middle, last); - } - - return first; - }); - - const [[first, middle, last]] = excludeLastElement(lastCharacter); + const disassembleLastCharacter = disassembleHangulToGroups(lastCharacter); + const [[first, middle, last]] = excludeLastElement(disassembleLastCharacter[0]); const result = middle != null ? combineHangulCharacter(first, middle, last) : first; - return [...withoutLastCharacter, result].join(''); + return [words.substring(0, words.length - 1), result].join(''); } diff --git a/src/utils.ts b/src/utils.ts index 5213d9c8..eb336371 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,10 +1,22 @@ import { + COMPLETE_HANGUL_START_CHARCODE, + COMPLETE_HANGUL_END_CHARCODE, HANGUL_CHARACTERS_BY_FIRST_INDEX, HANGUL_CHARACTERS_BY_LAST_INDEX, HANGUL_CHARACTERS_BY_MIDDLE_INDEX, + NUMBER_OF_JONGSUNG, + JASO_HANGUL_NFD, } from './constants'; -import { disassembleHangul, disassembleHangulToGroups } from './disassemble'; -import { disassembleCompleteHangulCharacter } from './disassembleCompleteHangulCharacter'; +import { disassembleHangulToGroups } from './disassemble'; + +const EXTRACT_CHOSEONG_REGEX = new RegExp( + `[^\\u${JASO_HANGUL_NFD.START_CHOSEONG.toString(16)}-\\u${JASO_HANGUL_NFD.END_CHOSEONG.toString(16)}ㄱ-ㅎ\\s]+`, + 'ug' +); +const CHOOSE_NFD_CHOSEONG_REGEX = new RegExp( + `[\\u${JASO_HANGUL_NFD.START_CHOSEONG.toString(16)}-\\u${JASO_HANGUL_NFD.END_CHOSEONG.toString(16)}]`, + 'g' +); /** * @name hasBatchim @@ -26,9 +38,14 @@ export function hasBatchim(str: string) { if (lastChar == null) { return false; } + const charCode = lastChar.charCodeAt(0); + const isCompleteHangul = COMPLETE_HANGUL_START_CHARCODE <= charCode && charCode <= COMPLETE_HANGUL_END_CHARCODE; - const disassembled = disassembleCompleteHangulCharacter(lastChar); - return disassembled != null && disassembled.last !== ''; + if (!isCompleteHangul) { + return false; + } + + return (charCode - COMPLETE_HANGUL_START_CHARCODE) % NUMBER_OF_JONGSUNG > 0; } /** @@ -49,12 +66,18 @@ export function hasBatchim(str: string) { export function hasSingleBatchim(str: string) { const lastChar = str[str.length - 1]; - if (lastChar == null || hasBatchim(lastChar) === false) { + if (lastChar == null) { return false; } + const charCode = lastChar.charCodeAt(0); + const isCompleteHangul = COMPLETE_HANGUL_START_CHARCODE <= charCode && charCode <= COMPLETE_HANGUL_END_CHARCODE; - const disassembled = disassembleHangul(lastChar); - return disassembled.length === 3; + if (!isCompleteHangul) { + return false; + } + + const batchimCode = (charCode - COMPLETE_HANGUL_START_CHARCODE) % NUMBER_OF_JONGSUNG; + return HANGUL_CHARACTERS_BY_LAST_INDEX[batchimCode].length === 1; } /** @@ -73,9 +96,9 @@ export function hasSingleBatchim(str: string) { * getChosung('띄어 쓰기') // 'ㄸㅇ ㅆㄱ' */ export function getChosung(word: string) { - return disassembleHangulToGroups(word).reduce((chosung, [consonant]) => { - return `${chosung}${consonant}`; - }, ''); + return word.normalize('NFD') + .replace(EXTRACT_CHOSEONG_REGEX, '') // NFD ㄱ-ㅎ, NFC ㄱ-ㅎ 외 문자 삭제 + .replace(CHOOSE_NFD_CHOSEONG_REGEX, $0 => HANGUL_CHARACTERS_BY_FIRST_INDEX[$0.charCodeAt(0) - 0x1100]); // NFD to NFC } /** From b0b254198064778b1deed99ff9343178f333de6a Mon Sep 17 00:00:00 2001 From: Dongkyu Kim Date: Sat, 29 Jun 2024 21:02:56 +0900 Subject: [PATCH 02/19] =?UTF-8?q?test:=20internal=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=BD=94=EB=93=9C=EB=A5=BC=20=EC=9E=91=EC=84=B1?= =?UTF-8?q?=ED=95=A9=EB=8B=88=EB=8B=A4=20(#137)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: internal 테스트 코드를 작성합니다 * test: vitest에서 제공해주는 toThrowError로 변경 --------- Co-authored-by: 박찬혁 --- src/_internal/index.spec.ts | 61 +++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 src/_internal/index.spec.ts diff --git a/src/_internal/index.spec.ts b/src/_internal/index.spec.ts new file mode 100644 index 00000000..6c6bc393 --- /dev/null +++ b/src/_internal/index.spec.ts @@ -0,0 +1,61 @@ +import assert, { excludeLastElement, isBlank, joinString } from './index'; + +describe('excludeLastElement', () => { + it('마지막 요소를 제외한 모든 요소와 마지막 요소를 반환한다', () => { + const result = excludeLastElement(['apple', 'banana', 'cherry']); + + expect(result).toEqual([['apple', 'banana'], 'cherry']); + }); + + it('입력 배열이 비어 있으면 빈 배열과 빈 문자열을 반환한다', () => { + const result = excludeLastElement([]); + + expect(result).toEqual([[], '']); + }); + + it('배열에 단 하나의 요소만 있는 경우, 빈배열과 그 요소를 반환한다', () => { + const result = excludeLastElement(['apple']); + + expect(result).toEqual([[], 'apple']); + }); +}); + +describe('joinString', () => { + it('여러 문자열을 하나의 문자열로 연결한다', () => { + const result = joinString('Hello', ' ', 'World'); + + expect(result).toBe('Hello World'); + }); + + it('인자가 주어지지 않았을 때 빈 문자열을 반환한다', () => { + const result = joinString(); + + expect(result).toBe(''); + }); +}); + +describe('isBlank', () => { + it('문자가 공백이면 true를 반환한다', () => { + expect(isBlank(' ')).toBe(true); + }); + + it('문자가 공백이 아니면 false를 반환한다', () => { + expect(isBlank('a')).toBe(false); + }); +}); + +describe('assert', () => { + it('조건이 참이면 에러를 던지지 않는다', () => { + expect(() => assert(true)).not.toThrowError(); + }); + + it('조건이 거짓이면 에러를 던진다', () => { + expect(() => assert(false)).toThrowError('Invalid condition'); + }); + + it('조건이 거짓이고 에러 메시지가 제공된 경우 사용자 정의 에러 메시지를 던져야 한다', () => { + const customMessage = 'Custom error message'; + + expect(() => assert(false, customMessage)).toThrowError(customMessage); + }); +}); From dadd51671fb93be213699dea6bee5467a7ea1bba Mon Sep 17 00:00:00 2001 From: Jaemin Kim Date: Sat, 29 Jun 2024 21:04:16 +0900 Subject: [PATCH 03/19] =?UTF-8?q?docs:=20josa=EC=97=90=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=EB=90=9C=20=EB=AC=B8=EC=84=9C=EC=97=90=20=EC=9E=98?= =?UTF-8?q?=EB=AA=BB=EB=90=9C=20=EB=B6=80=EB=B6=84=EC=9D=84=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=ED=95=A9=EB=8B=88=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - '이에/에' 삭제 Co-authored-by: 박찬혁 --- docs/src/pages/docs/api/josa.ko.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/src/pages/docs/api/josa.ko.md b/docs/src/pages/docs/api/josa.ko.md index 91adb784..bb094723 100644 --- a/docs/src/pages/docs/api/josa.ko.md +++ b/docs/src/pages/docs/api/josa.ko.md @@ -18,7 +18,6 @@ function josa( | '으로/로' | '와/과' | '이나/나' - | '이에/에' | '이란/란' | '아/야' | '이랑/랑' From b0e97d549a61c65e878b16641193fafe1985988f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 29 Jun 2024 21:04:39 +0900 Subject: [PATCH 04/19] chore: version packages (#143) Co-authored-by: github-actions[bot] --- .changeset/sixty-clouds-repeat.md | 5 ----- CHANGELOG.md | 6 ++++++ docs/CHANGELOG.md | 7 +++++++ docs/package.json | 2 +- package.json | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) delete mode 100644 .changeset/sixty-clouds-repeat.md diff --git a/.changeset/sixty-clouds-repeat.md b/.changeset/sixty-clouds-repeat.md deleted file mode 100644 index 0210dfec..00000000 --- a/.changeset/sixty-clouds-repeat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"es-hangul": patch ---- - -fix: 코드 효율 개선 diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d921fbd..f72a9d96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # es-hangul +## 1.3.7 + +### Patch Changes + +- [#124](https://github.com/toss/es-hangul/pull/124) [`0f38431`](https://github.com/toss/es-hangul/commit/0f38431ee611cb89c7e121fd02ab34f749a0c386) Thanks [@crucifyer](https://github.com/crucifyer)! - fix: 코드 효율 개선 + ## 1.3.6 ### Patch Changes diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e2fbde80..05099de5 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,12 @@ # docs +## 0.1.3 + +### Patch Changes + +- Updated dependencies [[`0f38431`](https://github.com/toss/es-hangul/commit/0f38431ee611cb89c7e121fd02ab34f749a0c386)]: + - es-hangul@1.3.7 + ## 0.1.2 ### Patch Changes diff --git a/docs/package.json b/docs/package.json index 2b0bc353..352979c6 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "docs", - "version": "0.1.2", + "version": "0.1.3", "private": true, "packageManager": "yarn@4.1.1", "scripts": { diff --git a/package.json b/package.json index 3888a6dd..74a38053 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "es-hangul", - "version": "1.3.6", + "version": "1.3.7", "keywords": [ "한글", "한국어", From f0195b29f20bdbe5c4fbf0a5764046cba3d70d41 Mon Sep 17 00:00:00 2001 From: seunghee Date: Sat, 29 Jun 2024 22:18:12 +0900 Subject: [PATCH 05/19] =?UTF-8?q?feat:=20=ED=95=9C=EA=B8=80=20=EB=AC=B8?= =?UTF-8?q?=EC=9E=90=EC=97=B4=EC=97=90=20=EB=8C=80=ED=95=9C=20=EA=B2=80?= =?UTF-8?q?=EC=A6=9D,=20assert,=20parsing=20=ED=95=A8=EC=88=98=EB=A5=BC=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=ED=95=A9=EB=8B=88=EB=8B=A4.=20(#136)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 한글 문자열인지 boolean 반환 함수 * feat: 한글 문자열인지 assert 함수 * feat: stringify * test: isHangulString, assertHangulString 테스트 코드 * feat: parse 함수 * test: parse 함수 테스트 * refactor: naming 통일 --- src/_internal/hangul.spec.ts | 72 +++++++++++++++++++++++++++++++++++- src/_internal/hangul.ts | 34 +++++++++++++++++ 2 files changed, 105 insertions(+), 1 deletion(-) diff --git a/src/_internal/hangul.spec.ts b/src/_internal/hangul.spec.ts index 7cf63bbe..e5307cf0 100644 --- a/src/_internal/hangul.spec.ts +++ b/src/_internal/hangul.spec.ts @@ -1,4 +1,13 @@ -import { binaryAssembleHangulCharacters, binaryAssembleHangul, isHangulAlphabet, isHangulCharacter } from './hangul'; +import { + binaryAssembleHangulCharacters, + binaryAssembleHangul, + isHangulAlphabet, + isHangulCharacter, + isHangul, + assertHangul, + parseHangul, + safeParseHangul, +} from './hangul'; describe('isHangul*', () => { it('isHangulCharacter는 완성된 한글 문자를 받으면 true를 반환한다.', () => { @@ -16,6 +25,51 @@ describe('isHangul*', () => { expect(isHangulAlphabet('ㅏ')).toBe(true); expect(isHangulAlphabet('a')).toBe(false); }); + + it('isHangul은 한글 문자열을 받으면 true를 반환한다.', () => { + expect(isHangul('값')).toBe(true); + expect(isHangul('ㄱ')).toBe(true); + expect(isHangul('ㅏ')).toBe(true); + expect(isHangul('저는 고양이를 좋아합니다')).toBe(true); + expect(isHangul('a')).toBe(false); + expect(isHangul(111)).toBe(false); + expect(isHangul([111, 111])).toBe(false); + expect(isHangul({ a: 111 })).toBe(false); + }); +}); + +describe('parse', () => { + it('parseHangul은 한글 문자열을 받으면 그대로 반환한다.', () => { + expect(parseHangul('값')).toBe('값'); + expect(parseHangul('ㄱ')).toBe('ㄱ'); + expect(parseHangul('ㅏ')).toBe('ㅏ'); + expect(parseHangul('저는 고양이를 좋아합니다')).toBe('저는 고양이를 좋아합니다'); + }); + + it('parseHangul은 한글 문자열이 아닌 값을 받으면 에러를 발생시킨다.', () => { + expect(() => parseHangul(111)).toThrowError('111 is not a valid hangul string'); + expect(() => parseHangul([111, 111])).toThrowError('[111,111] is not a valid hangul string'); + expect(() => parseHangul({ a: 111 })).toThrowError('{"a":111} is not a valid hangul string'); + }); + + it('safeParseHangul은 한글 문자열을 받으면 성공 객체를 반환한다.', () => { + expect(safeParseHangul('값')).toEqual({ success: true, data: '값' }); + expect(safeParseHangul('ㄱ')).toEqual({ success: true, data: 'ㄱ' }); + expect(safeParseHangul('ㅏ')).toEqual({ success: true, data: 'ㅏ' }); + expect(safeParseHangul('저는 고양이를 좋아합니다')).toEqual({ success: true, data: '저는 고양이를 좋아합니다' }); + }); + + it('safeParseHangul은 한글 문자열이 아닌 값을 받으면 실패 객체를 반환한다.', () => { + expect(safeParseHangul(111)).toEqual({ success: false, error: Error('111 is not a valid hangul string') }); + expect(safeParseHangul([111, 111])).toEqual({ + success: false, + error: Error('[111,111] is not a valid hangul string'), + }); + expect(safeParseHangul({ a: 111 })).toEqual({ + success: false, + error: Error('{"a":111} is not a valid hangul string'), + }); + }); }); describe('binaryAssembleHangulCharacters', () => { @@ -107,4 +161,20 @@ describe('binaryAssembleHangul', () => { expect(binaryAssembleHangul('저는 고양이를 좋아하', 'ㅏ')).toEqual('저는 고양이를 좋아하ㅏ'); expect(binaryAssembleHangul('저는 고양이를 좋아합니다', 'ㅜ')).toEqual('저는 고양이를 좋아합니다ㅜ'); }); + + describe('assertHangul', () => { + it('한글 문자열을 받으면 에러를 발생시키지 않는다.', () => { + expect(() => assertHangul('ㄱ')).not.toThrow(); + expect(() => assertHangul('고양이')).not.toThrow(); + expect(() => assertHangul('저는 고양이를 좋아합니다')).not.toThrow(); + expect(() => assertHangul('저는 고양이를 좋아합니ㄷ')).not.toThrow(); + }); + + it("한글 문자열이 아닌 값을 받으면 '___ is not a valid hangul string' 에러를 발생시킨다.", () => { + expect(() => assertHangul('aaaaaa')).toThrowError('"aaaaaa" is not a valid hangul string'); + expect(() => assertHangul(111)).toThrowError('111 is not a valid hangul string'); + expect(() => assertHangul([111, 111])).toThrowError('[111,111] is not a valid hangul string'); + expect(() => assertHangul({ a: 111 })).toThrowError('{"a":111} is not a valid hangul string'); + }); + }); }); diff --git a/src/_internal/hangul.ts b/src/_internal/hangul.ts index 6a1479ca..1a746f5b 100644 --- a/src/_internal/hangul.ts +++ b/src/_internal/hangul.ts @@ -12,6 +12,40 @@ export function isHangulAlphabet(character: string) { return /^[ㄱ-ㅣ]$/.test(character); } +export function isHangul(actual: unknown): actual is string { + return typeof actual === 'string' && /^[가-힣ㄱ-ㅣ\s]+$/.test(actual); +} + +export function assertHangul(actual: unknown, message?: string): asserts actual is string { + assert(isHangul(actual), message || `${JSON.stringify(actual)} is not a valid hangul string`); +} + +export function parseHangul(actual: unknown): string { + assertHangul(actual); + return actual; +} + +type SafeParseSuccess = { + success: true; + data: string; + error?: never; +}; + +type SafeParseError = { + success: false; + error: unknown; + data?: never; +}; + +export function safeParseHangul(actual: unknown): SafeParseSuccess | SafeParseError { + try { + const parsedHangul = parseHangul(actual); + return { success: true, data: parsedHangul }; + } catch (error) { + return { success: false, error }; + } +} + /** * @name binaryAssembleHangulAlphabets * @description From b0e1184204be0cb9f3c13937888c83c8a94e7ca6 Mon Sep 17 00:00:00 2001 From: taehyun <126179088+KNU-K@users.noreply.github.com> Date: Sat, 29 Jun 2024 22:52:33 +0900 Subject: [PATCH 06/19] =?UTF-8?q?feat=20:=20=EB=AC=B8=EC=9E=A5=EC=9D=98=20?= =?UTF-8?q?=EA=B0=81=20=EB=8B=A8=EC=96=B4=20=EC=A4=91=20=EC=B2=AB=20?= =?UTF-8?q?=EB=AC=B8=EC=9E=90=EB=A7=8C=20=EB=BD=91=EB=8A=94=20=ED=95=A8?= =?UTF-8?q?=EC=88=98=EC=B6=94=EA=B0=80=20(=20#128=20=EC=9D=B4=EC=8A=88?= =?UTF-8?q?=EC=97=90=20=EB=8C=80=ED=95=9C=20)=20(#133)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat : 문장의 각 단어 중 첫 문자만 뽑는 함수추가 * test 및 함수 추가 * add : 한글 문장인지 여부 판별 함수 추가 * fix : 한글 문장인지 여부 판별 기저 및 오류 추가 / arg 이름 변경 test 추가 * fix: src/_internal/hangul.ts Co-authored-by: 박찬혁 * fix : rename function getFirstHangulLetters -> getHangulAcronym * fix : rename function export function isHangulOnly로 변경 * fix : lint error * fix : index에 추가 * chore : doc 추가 * fix : 문서화 한글 영어 바뀐거 바로 변경 * fix : isHangul로 대체 #136 으로 * chore : doc수정 * Update docs/src/pages/docs/api/getHangulAcronym.en.mdx Co-authored-by: 박찬혁 * fix : Update hangul.ts 안쓰는 메소드 삭제 * Update getHangulAcronym.ko.mdx * Update getHangulAcronym.en.mdx * Update src/getHangulAcronym.ts Co-authored-by: 박찬혁 * Update src/getHangulAcronym.ts Co-authored-by: 박찬혁 * Update getHangulAcronym.ts * Update getHangulAcronym.spec.ts * Create fair-brooms-drive.md --------- Co-authored-by: 박찬혁 --- .changeset/fair-brooms-drive.md | 5 +++++ .../src/pages/docs/api/getHangulAcronym.en.mdx | 16 ++++++++++++++++ .../src/pages/docs/api/getHangulAcronym.ko.mdx | 16 ++++++++++++++++ src/getHangulAcronym.spec.ts | 18 ++++++++++++++++++ src/getHangulAcronym.ts | 12 ++++++++++++ src/index.ts | 1 + 6 files changed, 68 insertions(+) create mode 100644 .changeset/fair-brooms-drive.md create mode 100644 docs/src/pages/docs/api/getHangulAcronym.en.mdx create mode 100644 docs/src/pages/docs/api/getHangulAcronym.ko.mdx create mode 100644 src/getHangulAcronym.spec.ts create mode 100644 src/getHangulAcronym.ts diff --git a/.changeset/fair-brooms-drive.md b/.changeset/fair-brooms-drive.md new file mode 100644 index 00000000..9a73e4eb --- /dev/null +++ b/.changeset/fair-brooms-drive.md @@ -0,0 +1,5 @@ +--- +"es-hangul": patch +--- + +feat : 문장의 각 단어 중 첫 문자만 뽑는 extractHangul 함수를 추가합니다. diff --git a/docs/src/pages/docs/api/getHangulAcronym.en.mdx b/docs/src/pages/docs/api/getHangulAcronym.en.mdx new file mode 100644 index 00000000..730ea88c --- /dev/null +++ b/docs/src/pages/docs/api/getHangulAcronym.en.mdx @@ -0,0 +1,16 @@ +# getHangulAcronym + +It receives the Korean sentence and returns the first letter of that Korean sentence. +(We don't deal with non-Korean sentences; we don't deal with additional Korean + English sentences.) + +```typescript +function getHangulAcronym( + // String consisting of plural nouns (e.g. '버스 충전', '치킨과 맥주') + text: string +): boolean; +``` + +```typescript +getHangulAcronym('치킨과 맥주').join(''); //치맥 +getHangulAcronym('버스 충전 카드').join(''); //버충카 +``` diff --git a/docs/src/pages/docs/api/getHangulAcronym.ko.mdx b/docs/src/pages/docs/api/getHangulAcronym.ko.mdx new file mode 100644 index 00000000..8d655e54 --- /dev/null +++ b/docs/src/pages/docs/api/getHangulAcronym.ko.mdx @@ -0,0 +1,16 @@ +# getHangulAcronym + +한글 문장을 입력받아서, 해당 한글 문장의 첫글자를 리턴해줍니다. +(한글 문장이 아닌, 문장은 취급하지않습니다. 추가로 한글 문장 + 영어 문장의 경우에도 취급하지않습니다.) + +```typescript +function getHangulAcronym( + // 복수 명사로 이루어진 문자열 (e.g. '버스 충전', '치킨과 맥주') + text: string +): boolean; +``` + +```typescript +getHangulAcronym('치킨과 맥주').join(''); //치맥 +getHangulAcronym('버스 충전 카드').join(''); //버충카 +``` diff --git a/src/getHangulAcronym.spec.ts b/src/getHangulAcronym.spec.ts new file mode 100644 index 00000000..649d2432 --- /dev/null +++ b/src/getHangulAcronym.spec.ts @@ -0,0 +1,18 @@ +import { getHangulAcronym } from './getHangulAcronym'; + +describe('getHangulAcronym', () => { + it('한글 문장 단어중 첫 문자만 뽑은 리스트를 반환', () => { + expect(getHangulAcronym('치킨과 맥주')).toHaveLength(2); + expect(getHangulAcronym('치킨과 맥주').join('')).toBe('치맥'); + + expect(getHangulAcronym('버스 충전 카드')).toHaveLength(3); + expect(getHangulAcronym('버스 충전 카드').join('')).toBe('버충카'); + }); + it('한글이 아닌 문장 넣었을 때', () => { + expect(() => getHangulAcronym('test test')).toThrowError('"test test" is not a valid hangul string'); + }); + + it('한글과 영어가 섞인 문장을 넣었을 때', () => { + expect(() => getHangulAcronym('고기와 Cheese')).toThrowError('"고기와 Cheese" is not a valid hangul string'); + }); +}); diff --git a/src/getHangulAcronym.ts b/src/getHangulAcronym.ts new file mode 100644 index 00000000..5e5c5a37 --- /dev/null +++ b/src/getHangulAcronym.ts @@ -0,0 +1,12 @@ +import { parseHangul } from './_internal/hangul'; + +/** + * + * @param getHangulAcronym + * @description + * 한글 문장을 입력받아서, 해당 한글 문장의 초성을을 리턴해줍니다. + * 한글 문장이 아닌, 문장은 취급하지않습니다. 추가로 한글 문장 + 영어 문장의 경우에도 취급하지않습니다. + */ +export function getHangulAcronym(hangul: string) { +return parseHangul(hangul).split(' ').map(word => word.charAt(0)); +} diff --git a/src/index.ts b/src/index.ts index be7f02a3..84f29536 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,3 +8,4 @@ export * from './hangulIncludes'; export * from './josa'; export * from './removeLastHangulCharacter'; export * from './utils'; +export * from './getHangulAcronym'; From b25fcc53fba7f0fe17a8544c4180ff82f4290fc0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 29 Jun 2024 23:08:38 +0900 Subject: [PATCH 07/19] chore: version packages (#145) Co-authored-by: github-actions[bot] --- .changeset/fair-brooms-drive.md | 5 ----- CHANGELOG.md | 6 ++++++ docs/CHANGELOG.md | 7 +++++++ docs/package.json | 2 +- package.json | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) delete mode 100644 .changeset/fair-brooms-drive.md diff --git a/.changeset/fair-brooms-drive.md b/.changeset/fair-brooms-drive.md deleted file mode 100644 index 9a73e4eb..00000000 --- a/.changeset/fair-brooms-drive.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"es-hangul": patch ---- - -feat : 문장의 각 단어 중 첫 문자만 뽑는 extractHangul 함수를 추가합니다. diff --git a/CHANGELOG.md b/CHANGELOG.md index f72a9d96..aeeffb51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # es-hangul +## 1.3.8 + +### Patch Changes + +- [#133](https://github.com/toss/es-hangul/pull/133) [`b0e1184`](https://github.com/toss/es-hangul/commit/b0e1184204be0cb9f3c13937888c83c8a94e7ca6) Thanks [@KNU-K](https://github.com/KNU-K)! - feat : 문장의 각 단어 중 첫 문자만 뽑는 extractHangul 함수를 추가합니다. + ## 1.3.7 ### Patch Changes diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 05099de5..d637752a 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,12 @@ # docs +## 0.1.4 + +### Patch Changes + +- Updated dependencies [[`b0e1184`](https://github.com/toss/es-hangul/commit/b0e1184204be0cb9f3c13937888c83c8a94e7ca6)]: + - es-hangul@1.3.8 + ## 0.1.3 ### Patch Changes diff --git a/docs/package.json b/docs/package.json index 352979c6..77a52e96 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "docs", - "version": "0.1.3", + "version": "0.1.4", "private": true, "packageManager": "yarn@4.1.1", "scripts": { diff --git a/package.json b/package.json index 74a38053..def9b1b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "es-hangul", - "version": "1.3.7", + "version": "1.3.8", "keywords": [ "한글", "한국어", From acd6edb1d8aadced517f6b57a49c01152ff19d0a Mon Sep 17 00:00:00 2001 From: SeongMin Kim <86355699+Collection50@users.noreply.github.com> Date: Sat, 29 Jun 2024 23:16:59 +0900 Subject: [PATCH 08/19] =?UTF-8?q?feat:=20=EB=AC=B8=EC=9E=90=EC=97=B4?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=ED=95=9C=EA=B8=80=EB=A7=8C=20=EB=B0=98?= =?UTF-8?q?=ED=99=98=ED=95=98=EB=8A=94=20extractHangul=EC=9D=84=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=ED=95=A9=EB=8B=88=EB=8B=A4.=20(#130)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: parseHangul * fix: parseHangul의 이름을 extractHangul로 수정 및 테스트 코드 보완 * test: 일관된 테스트 코드 작성이 될 수 있도록 describe 설명 수정 * test: 테스트 코드 수정 * docs: extractHangul의 문서 작성 * test: 테스트 문구 수정 * fix: index.ts에 export 추가 * Create fresh-students-sit.md --------- Co-authored-by: 박찬혁 --- .changeset/fresh-students-sit.md | 5 ++++ docs/src/pages/docs/api/extractHangul.en.md | 23 ++++++++++++++++++ docs/src/pages/docs/api/extractHangul.ko.md | 23 ++++++++++++++++++ src/extractHangul.spec.ts | 27 +++++++++++++++++++++ src/extractHangul.ts | 18 ++++++++++++++ src/index.ts | 1 + 6 files changed, 97 insertions(+) create mode 100644 .changeset/fresh-students-sit.md create mode 100644 docs/src/pages/docs/api/extractHangul.en.md create mode 100644 docs/src/pages/docs/api/extractHangul.ko.md create mode 100644 src/extractHangul.spec.ts create mode 100644 src/extractHangul.ts diff --git a/.changeset/fresh-students-sit.md b/.changeset/fresh-students-sit.md new file mode 100644 index 00000000..03c76557 --- /dev/null +++ b/.changeset/fresh-students-sit.md @@ -0,0 +1,5 @@ +--- +"es-hangul": patch +--- + +feat: 문자열에서 한글만 반환하는 extractHangul을 구현합니다. diff --git a/docs/src/pages/docs/api/extractHangul.en.md b/docs/src/pages/docs/api/extractHangul.en.md new file mode 100644 index 00000000..c685c84a --- /dev/null +++ b/docs/src/pages/docs/api/extractHangul.en.md @@ -0,0 +1,23 @@ +--- +title: extractHangul +--- + +# extractHangul + +Extracts and returns only Korean characters from the string. + +For detailed examples, see below. + +```typescript +function extractHangul(str: string): string; +``` + +## Examples + +```tsx +extractHangul('안녕하세요1234abc'); // '안녕하세요' +extractHangul('abcde'); // '' +extractHangul('안녕하세요ㄱㄴ'); // '안녕하세요ㄱㄴ' +extractHangul('안녕하세요 만나서 반갑습니다'); // '안녕하세요 만나서 반갑습니다' +extractHangul('가나다!-29~라마바.,,사'); // '가나다라마바사' +``` diff --git a/docs/src/pages/docs/api/extractHangul.ko.md b/docs/src/pages/docs/api/extractHangul.ko.md new file mode 100644 index 00000000..dc089bdb --- /dev/null +++ b/docs/src/pages/docs/api/extractHangul.ko.md @@ -0,0 +1,23 @@ +--- +title: extractHangul +--- + +# extractHangul + +문자열에서 한글만 추출하여 반환합니다. + +자세한 예시는 아래 Example을 참고하세요. + +```typescript +function extractHangul(str: string): string; +``` + +## Examples + +```tsx +extractHangul('안녕하세요1234abc'); // '안녕하세요' +extractHangul('abcde'); // '' +extractHangul('안녕하세요ㄱㄴ'); // '안녕하세요ㄱㄴ' +extractHangul('안녕하세요 만나서 반갑습니다'); // '안녕하세요 만나서 반갑습니다' +extractHangul('가나다!-29~라마바.,,사'); // '가나다라마바사' +``` diff --git a/src/extractHangul.spec.ts b/src/extractHangul.spec.ts new file mode 100644 index 00000000..b3fd84dd --- /dev/null +++ b/src/extractHangul.spec.ts @@ -0,0 +1,27 @@ +import { extractHangul } from './extractHangul'; + +describe('extractHangul', () => { + it('숫자와 알파벳과 특수문자를 제외한 한글 반환', () => { + expect(extractHangul('안녕하세요1234abc!@#')).toBe('안녕하세요'); + }); + + it('한글이 없는 문자열', () => { + expect(extractHangul('1234abc')).toBe(''); + }); + + it('한글과 공백을 제외한 다른 문자는 제거', () => { + expect(extractHangul('한글과 영어가 섞인 문장입니다. Hello!')).toBe('한글과 영어가 섞인 문장입니다 '); + }); + + it('escape 문자열 유지', () => { + expect(extractHangul('한글과\n\t줄바꿈')).toBe('한글과\n\t줄바꿈'); + }); + + it('모음은 제거하지 않음', () => { + expect(extractHangul('ㅠㅠ')).toBe('ㅠㅠ'); + }); + + it('자음은 제거하지 않음', () => { + expect(extractHangul('ㄱㄴㄱㄴ')).toBe('ㄱㄴㄱㄴ'); + }); +}); diff --git a/src/extractHangul.ts b/src/extractHangul.ts new file mode 100644 index 00000000..d023a674 --- /dev/null +++ b/src/extractHangul.ts @@ -0,0 +1,18 @@ +/** + * @name extractHangul + * @description + * 문자열을 입력받고 한글만 추출해 반환합니다. + * + * @param {string} chars 모든 문자열 + * + * @example + * extractHangul('안녕하세요1234abc') // '안녕하세요' + * extractHangul('abcde') // '' + * extractHangul('안녕하세요ㄱㄴ') // '안녕하세요ㄱㄴ' + * extractHangul('안녕하세요 만나서 반갑습니다') // '안녕하세요 만나서 반갑습니다' + * extractHangul('가나다!-29~라마바.,,사') // '가나다라마바사' + */ + +export function extractHangul(str: string): string { + return str.replace(/[^ㄱ-ㅎㅏ-ㅣ가-힣\s]+/g, ''); +} diff --git a/src/index.ts b/src/index.ts index 84f29536..7bff5341 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,4 +8,5 @@ export * from './hangulIncludes'; export * from './josa'; export * from './removeLastHangulCharacter'; export * from './utils'; +export * from './extractHangul'; export * from './getHangulAcronym'; From d09822f74360e3567ead1eb8eadd7c8105c16338 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 29 Jun 2024 23:17:48 +0900 Subject: [PATCH 09/19] chore: version packages (#146) Co-authored-by: github-actions[bot] --- .changeset/fresh-students-sit.md | 5 ----- CHANGELOG.md | 6 ++++++ docs/CHANGELOG.md | 7 +++++++ docs/package.json | 2 +- package.json | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) delete mode 100644 .changeset/fresh-students-sit.md diff --git a/.changeset/fresh-students-sit.md b/.changeset/fresh-students-sit.md deleted file mode 100644 index 03c76557..00000000 --- a/.changeset/fresh-students-sit.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"es-hangul": patch ---- - -feat: 문자열에서 한글만 반환하는 extractHangul을 구현합니다. diff --git a/CHANGELOG.md b/CHANGELOG.md index aeeffb51..8a857c4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # es-hangul +## 1.3.9 + +### Patch Changes + +- [#130](https://github.com/toss/es-hangul/pull/130) [`acd6edb`](https://github.com/toss/es-hangul/commit/acd6edb1d8aadced517f6b57a49c01152ff19d0a) Thanks [@Collection50](https://github.com/Collection50)! - feat: 문자열에서 한글만 반환하는 extractHangul을 구현합니다. + ## 1.3.8 ### Patch Changes diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index d637752a..67e69302 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,12 @@ # docs +## 0.1.5 + +### Patch Changes + +- Updated dependencies [[`acd6edb`](https://github.com/toss/es-hangul/commit/acd6edb1d8aadced517f6b57a49c01152ff19d0a)]: + - es-hangul@1.3.9 + ## 0.1.4 ### Patch Changes diff --git a/docs/package.json b/docs/package.json index 77a52e96..ad4bed6d 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "docs", - "version": "0.1.4", + "version": "0.1.5", "private": true, "packageManager": "yarn@4.1.1", "scripts": { diff --git a/package.json b/package.json index def9b1b4..247bfdc3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "es-hangul", - "version": "1.3.8", + "version": "1.3.9", "keywords": [ "한글", "한국어", From f3c7fe9f73138b932af817b8ac925d54c3283151 Mon Sep 17 00:00:00 2001 From: taehyun <126179088+KNU-K@users.noreply.github.com> Date: Sun, 30 Jun 2024 00:13:57 +0900 Subject: [PATCH 10/19] =?UTF-8?q?fix=20:=20getHangulacronym=ED=95=A8?= =?UTF-8?q?=EC=88=98=EB=A5=BC=20acronymizeHangul=20=EB=A9=94=EC=84=9C?= =?UTF-8?q?=EB=93=9C=EB=A1=9C=20=EB=8C=80=EC=B2=B4=ED=95=A9=EB=8B=88?= =?UTF-8?q?=EB=8B=A4.=20(#148)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update and rename getHangulAcronym.ts to acronymizeHangul.ts * Update and rename getHangulAcronym.spec.ts to acronymizeHangul.spec.ts * Update index.ts * Update and rename getHangulAcronym.en.mdx to acronymizeHangul.en.mdx * Update and rename getHangulAcronym.ko.mdx to acronymizeHangul.ko.mdx * Create odd-squids-sin.md --------- Co-authored-by: 박찬혁 --- .changeset/odd-squids-sin.md | 5 +++++ ...lAcronym.en.mdx => acronymizeHangul.en.mdx} | 10 +++++----- ...lAcronym.ko.mdx => acronymizeHangul.ko.mdx} | 10 +++++----- src/acronymizeHangul.spec.ts | 18 ++++++++++++++++++ ...getHangulAcronym.ts => acronymizeHangul.ts} | 2 +- src/getHangulAcronym.spec.ts | 18 ------------------ src/index.ts | 2 +- 7 files changed, 35 insertions(+), 30 deletions(-) create mode 100644 .changeset/odd-squids-sin.md rename docs/src/pages/docs/api/{getHangulAcronym.en.mdx => acronymizeHangul.en.mdx} (63%) rename docs/src/pages/docs/api/{getHangulAcronym.ko.mdx => acronymizeHangul.ko.mdx} (67%) create mode 100644 src/acronymizeHangul.spec.ts rename src/{getHangulAcronym.ts => acronymizeHangul.ts} (89%) delete mode 100644 src/getHangulAcronym.spec.ts diff --git a/.changeset/odd-squids-sin.md b/.changeset/odd-squids-sin.md new file mode 100644 index 00000000..433b216b --- /dev/null +++ b/.changeset/odd-squids-sin.md @@ -0,0 +1,5 @@ +--- +"es-hangul": patch +--- + +fix : getHangulacronym함수를 acronymizeHangul 메서드로 대체합니다 diff --git a/docs/src/pages/docs/api/getHangulAcronym.en.mdx b/docs/src/pages/docs/api/acronymizeHangul.en.mdx similarity index 63% rename from docs/src/pages/docs/api/getHangulAcronym.en.mdx rename to docs/src/pages/docs/api/acronymizeHangul.en.mdx index 730ea88c..57d026c9 100644 --- a/docs/src/pages/docs/api/getHangulAcronym.en.mdx +++ b/docs/src/pages/docs/api/acronymizeHangul.en.mdx @@ -1,16 +1,16 @@ -# getHangulAcronym +# acronymizeHangul It receives the Korean sentence and returns the first letter of that Korean sentence. (We don't deal with non-Korean sentences; we don't deal with additional Korean + English sentences.) ```typescript -function getHangulAcronym( +function acronymizeHangul( // String consisting of plural nouns (e.g. '버스 충전', '치킨과 맥주') - text: string + hangul: string ): boolean; ``` ```typescript -getHangulAcronym('치킨과 맥주').join(''); //치맥 -getHangulAcronym('버스 충전 카드').join(''); //버충카 +acronymizeHangul('치킨과 맥주').join(''); //치맥 +acronymizeHangul('버스 충전 카드').join(''); //버충카 ``` diff --git a/docs/src/pages/docs/api/getHangulAcronym.ko.mdx b/docs/src/pages/docs/api/acronymizeHangul.ko.mdx similarity index 67% rename from docs/src/pages/docs/api/getHangulAcronym.ko.mdx rename to docs/src/pages/docs/api/acronymizeHangul.ko.mdx index 8d655e54..908e5251 100644 --- a/docs/src/pages/docs/api/getHangulAcronym.ko.mdx +++ b/docs/src/pages/docs/api/acronymizeHangul.ko.mdx @@ -1,16 +1,16 @@ -# getHangulAcronym +# acronymizeHangul 한글 문장을 입력받아서, 해당 한글 문장의 첫글자를 리턴해줍니다. (한글 문장이 아닌, 문장은 취급하지않습니다. 추가로 한글 문장 + 영어 문장의 경우에도 취급하지않습니다.) ```typescript -function getHangulAcronym( +function acronymizeHangul( // 복수 명사로 이루어진 문자열 (e.g. '버스 충전', '치킨과 맥주') - text: string + hangul: string ): boolean; ``` ```typescript -getHangulAcronym('치킨과 맥주').join(''); //치맥 -getHangulAcronym('버스 충전 카드').join(''); //버충카 +acronymizeHangul('치킨과 맥주').join(''); //치맥 +acronymizeHangul('버스 충전 카드').join(''); //버충카 ``` diff --git a/src/acronymizeHangul.spec.ts b/src/acronymizeHangul.spec.ts new file mode 100644 index 00000000..a4d8b91e --- /dev/null +++ b/src/acronymizeHangul.spec.ts @@ -0,0 +1,18 @@ +import { acronymizeHangul } from './acronymizeHangul'; + +describe('acronymizeHangul', () => { + it('한글 문장 단어중 첫 문자만 뽑은 리스트를 반환', () => { + expect(acronymizeHangul('치킨과 맥주')).toHaveLength(2); + expect(acronymizeHangul('치킨과 맥주').join('')).toBe('치맥'); + + expect(acronymizeHangul('버스 충전 카드')).toHaveLength(3); + expect(acronymizeHangul('버스 충전 카드').join('')).toBe('버충카'); + }); + it('한글이 아닌 문장 넣었을 때', () => { + expect(() => acronymizeHangul('test test')).toThrowError('"test test" is not a valid hangul string'); + }); + + it('한글과 영어가 섞인 문장을 넣었을 때', () => { + expect(() => acronymizeHangul('고기와 Cheese')).toThrowError('"고기와 Cheese" is not a valid hangul string'); + }); +}); diff --git a/src/getHangulAcronym.ts b/src/acronymizeHangul.ts similarity index 89% rename from src/getHangulAcronym.ts rename to src/acronymizeHangul.ts index 5e5c5a37..9103ec40 100644 --- a/src/getHangulAcronym.ts +++ b/src/acronymizeHangul.ts @@ -7,6 +7,6 @@ import { parseHangul } from './_internal/hangul'; * 한글 문장을 입력받아서, 해당 한글 문장의 초성을을 리턴해줍니다. * 한글 문장이 아닌, 문장은 취급하지않습니다. 추가로 한글 문장 + 영어 문장의 경우에도 취급하지않습니다. */ -export function getHangulAcronym(hangul: string) { +export function acronymizeHangul(hangul: string) { return parseHangul(hangul).split(' ').map(word => word.charAt(0)); } diff --git a/src/getHangulAcronym.spec.ts b/src/getHangulAcronym.spec.ts deleted file mode 100644 index 649d2432..00000000 --- a/src/getHangulAcronym.spec.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { getHangulAcronym } from './getHangulAcronym'; - -describe('getHangulAcronym', () => { - it('한글 문장 단어중 첫 문자만 뽑은 리스트를 반환', () => { - expect(getHangulAcronym('치킨과 맥주')).toHaveLength(2); - expect(getHangulAcronym('치킨과 맥주').join('')).toBe('치맥'); - - expect(getHangulAcronym('버스 충전 카드')).toHaveLength(3); - expect(getHangulAcronym('버스 충전 카드').join('')).toBe('버충카'); - }); - it('한글이 아닌 문장 넣었을 때', () => { - expect(() => getHangulAcronym('test test')).toThrowError('"test test" is not a valid hangul string'); - }); - - it('한글과 영어가 섞인 문장을 넣었을 때', () => { - expect(() => getHangulAcronym('고기와 Cheese')).toThrowError('"고기와 Cheese" is not a valid hangul string'); - }); -}); diff --git a/src/index.ts b/src/index.ts index 7bff5341..ee3becfd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,4 +9,4 @@ export * from './josa'; export * from './removeLastHangulCharacter'; export * from './utils'; export * from './extractHangul'; -export * from './getHangulAcronym'; +export * from './acronymizeHangul'; From f782ec2cafac44f45cad6d72cf411a50d3a6fddc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 30 Jun 2024 00:15:21 +0900 Subject: [PATCH 11/19] chore: version packages (#150) Co-authored-by: github-actions[bot] --- .changeset/odd-squids-sin.md | 5 ----- CHANGELOG.md | 6 ++++++ docs/CHANGELOG.md | 7 +++++++ docs/package.json | 2 +- package.json | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) delete mode 100644 .changeset/odd-squids-sin.md diff --git a/.changeset/odd-squids-sin.md b/.changeset/odd-squids-sin.md deleted file mode 100644 index 433b216b..00000000 --- a/.changeset/odd-squids-sin.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"es-hangul": patch ---- - -fix : getHangulacronym함수를 acronymizeHangul 메서드로 대체합니다 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a857c4c..1e5583c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # es-hangul +## 1.3.10 + +### Patch Changes + +- [#148](https://github.com/toss/es-hangul/pull/148) [`f3c7fe9`](https://github.com/toss/es-hangul/commit/f3c7fe9f73138b932af817b8ac925d54c3283151) Thanks [@KNU-K](https://github.com/KNU-K)! - fix : getHangulacronym함수를 acronymizeHangul 메서드로 대체합니다 + ## 1.3.9 ### Patch Changes diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 67e69302..adc357a5 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,12 @@ # docs +## 0.1.6 + +### Patch Changes + +- Updated dependencies [[`f3c7fe9`](https://github.com/toss/es-hangul/commit/f3c7fe9f73138b932af817b8ac925d54c3283151)]: + - es-hangul@1.3.10 + ## 0.1.5 ### Patch Changes diff --git a/docs/package.json b/docs/package.json index ad4bed6d..2e1db525 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "docs", - "version": "0.1.5", + "version": "0.1.6", "private": true, "packageManager": "yarn@4.1.1", "scripts": { diff --git a/package.json b/package.json index 247bfdc3..cc3f0c6f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "es-hangul", - "version": "1.3.9", + "version": "1.3.10", "keywords": [ "한글", "한국어", From b1148973e6c2b640ce528fc8ba4b8e2e034b90de Mon Sep 17 00:00:00 2001 From: SeongMin Kim <86355699+Collection50@users.noreply.github.com> Date: Sun, 30 Jun 2024 10:57:36 +0900 Subject: [PATCH 12/19] =?UTF-8?q?fix:=20amountToHangul=EC=9D=B4=20?= =?UTF-8?q?=EC=86=8C=EC=88=98=EC=A0=90,=20=EC=88=AB=EC=9E=90=EB=8F=84=20?= =?UTF-8?q?=EB=8C=80=EC=9D=91=ED=95=A0=20=EC=88=98=20=EC=9E=88=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95=20(#144)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: amountToHangul이 소수점, 숫자도 대응할 수 있도록 수정 * docs: amountToHangul의 영어 문서 작성 * Create famous-cheetahs-sneeze.md * Update famous-cheetahs-sneeze.md --------- Co-authored-by: 박찬혁 --- .changeset/famous-cheetahs-sneeze.md | 5 ++ docs/src/pages/docs/api/amountToHangul.en.md | 12 ++-- docs/src/pages/docs/api/amountToHangul.ko.md | 14 ++-- src/amountToHangul.spec.ts | 19 ++++- src/amountToHangul.ts | 74 +++++++++++++++----- 5 files changed, 87 insertions(+), 37 deletions(-) create mode 100644 .changeset/famous-cheetahs-sneeze.md diff --git a/.changeset/famous-cheetahs-sneeze.md b/.changeset/famous-cheetahs-sneeze.md new file mode 100644 index 00000000..f20b5a83 --- /dev/null +++ b/.changeset/famous-cheetahs-sneeze.md @@ -0,0 +1,5 @@ +--- +"es-hangul": minor +--- + +fix: amountToHangul이 소수점, 숫자도 대응할 수 있도록 수정 diff --git a/docs/src/pages/docs/api/amountToHangul.en.md b/docs/src/pages/docs/api/amountToHangul.en.md index c82c4dc4..19e3abcc 100644 --- a/docs/src/pages/docs/api/amountToHangul.en.md +++ b/docs/src/pages/docs/api/amountToHangul.en.md @@ -9,16 +9,14 @@ Converts numeric amounts to the Korean reading of the [National Institute of Kor For detailed examples, see below. ```typescript -function amountToHangul( - // A string of numeric amounts - str: string -): string; +function amountToHangul(amount: string | number): string; ``` ## Examples ```tsx -amountToHangul('15,201,100'); // '일천오백이십만천백'; -amountToHangul('120,030원'); // '일십이만삼십' - Ignore non-numeric characters -amountToHangul('392.24'); // '삼백구십이' - Ignore decimals +amountToHangul('15,201,100'); // '일천오백이십만천백' +amountToHangul('120,030원'); // '일십이만삼십' +amountToHangul('12345.6789'); // '일만이천삼백사십오점육칠팔구' +amountToHangul(15_201_100); // '일천오백이십만천백'' ``` diff --git a/docs/src/pages/docs/api/amountToHangul.ko.md b/docs/src/pages/docs/api/amountToHangul.ko.md index 9818d26d..dbafc07e 100644 --- a/docs/src/pages/docs/api/amountToHangul.ko.md +++ b/docs/src/pages/docs/api/amountToHangul.ko.md @@ -4,21 +4,19 @@ title: amountToHangul # amountToHangul -숫자로 된 금액을 [국립국어원](https://ko.dict.naver.com/#/correct/korean/info?seq=602) 규칙의 한글 읽기로 변환합니다. +숫자나 문자를 [국립국어원](https://ko.dict.naver.com/#/correct/korean/info?seq=602) 규칙의 한글 읽기 문자열로 변환합니다. 자세한 예시는 아래 Example을 참고하세요. ```typescript -function amountToHangul( - // 숫자로 된 금액 문자열 - str: string -): string; +function amountToHangul(amount: string | number): string; ``` ## Examples ```tsx -amountToHangul('15,201,100'); // '일천오백이십만천백'; -amountToHangul('120,030원'); // '일십이만삼십' - 숫자 외 문자 무시 -amountToHangul('392.24'); // '삼백구십이' - 소수점 무시 +amountToHangul('15,201,100'); // '일천오백이십만천백' +amountToHangul('120,030원'); // '일십이만삼십' +amountToHangul('12345.6789'); // '일만이천삼백사십오점육칠팔구' +amountToHangul(15_201_100); // '일천오백이십만천백'' ``` diff --git a/src/amountToHangul.spec.ts b/src/amountToHangul.spec.ts index 3d2de30b..7be66a5e 100644 --- a/src/amountToHangul.spec.ts +++ b/src/amountToHangul.spec.ts @@ -1,11 +1,24 @@ import { amountToHangul } from './amountToHangul'; describe('amountToHangul', () => { - it('숫자로 된 금액을 한글로 표기', () => { + it('금액 문자열을 한글로 표기', () => { expect(amountToHangul('15,201,100')).toEqual('일천오백이십만천백'); - expect(amountToHangul('120,030원')).toEqual('일십이만삼십'); // 숫자 외 문자 무시 - expect(amountToHangul('392.24')).toEqual('삼백구십이'); // 소수점 무시 expect(amountToHangul('100000000')).toEqual('일억'); expect(amountToHangul('100000100')).toEqual('일억백'); }); + + it('숫자 외 문자를 무시하여 반환', () => { + expect(amountToHangul('120,030원')).toEqual('일십이만삼십'); + }); + + it('소수점이 있는 경우도 표기', () => { + expect(amountToHangul('392.24')).toEqual('삼백구십이점이사'); + expect(amountToHangul('12345.6789')).toEqual('일만이천삼백사십오점육칠팔구'); + }); + + it('금액 숫자를 한글로 표기', () => { + expect(amountToHangul(15_201_100)).toEqual('일천오백이십만천백'); + expect(amountToHangul(100000100)).toEqual('일억백'); + expect(amountToHangul(392.24)).toEqual('삼백구십이점이사'); + }); }); diff --git a/src/amountToHangul.ts b/src/amountToHangul.ts index 8708e817..c0afbd53 100644 --- a/src/amountToHangul.ts +++ b/src/amountToHangul.ts @@ -1,35 +1,71 @@ -export const HANGUL_DIGITS = ['', '만', '억', '조', '경', '해', '자', '양', '구', '간', '정', '재', '극', '항하사', '아승기', '나유타', '불가사의', '무량대수', '겁', '업']; +export const HANGUL_DIGITS = [ + '', + '만', + '억', + '조', + '경', + '해', + '자', + '양', + '구', + '간', + '정', + '재', + '극', + '항하사', + '아승기', + '나유타', + '불가사의', + '무량대수', + '겁', + '업', +]; export const HANGUL_DIGITS_MAX = HANGUL_DIGITS.length * 4; export const HANGUL_NUMBERS = ['', '일', '이', '삼', '사', '오', '육', '칠', '팔', '구']; export const HANGUL_CARDINAL = ['', '십', '백', '천']; -// https://ko.dict.naver.com/#/correct/korean/info?seq=602 -// https://github.com/crucifyer/koreanCardinalOrdinal -export function amountToHangul(str: string) { - str = str.replace(/\..*$/, '') // 소수점 지원 안함 - .replace(/[^\d]+/g, ''); // , 표기 등 오류내지 않음 - if(str.length > HANGUL_DIGITS_MAX) { - throw new Error('convert range exceeded : ' + str); +export function amountToHangul(amount: string | number) { + const [integerPart, decimalPart] = String(amount) + .replace(/[^\d.]+/g, '') + .split('.'); + + if (integerPart.length > HANGUL_DIGITS_MAX) { + throw new Error(`convert range exceeded : ${amount}`); } + const result = []; let pronunDigits = true; - for(let i = 0; i < str.length - 1; i ++) { - const d = str.length - i - 1; - if(str[i] > '1' || d % 4 === 0 || i === 0) { - const tnum = HANGUL_NUMBERS[parseInt(str[i])]; - if(tnum) { - result.push(tnum); + + for (let i = 0; i < integerPart.length - 1; i++) { + const digit = integerPart.length - i - 1; + + if (integerPart[i] > '1' || digit % 4 === 0 || i === 0) { + const hangulNumber = HANGUL_NUMBERS[Number(integerPart[i])]; + + if (hangulNumber) { + result.push(hangulNumber); pronunDigits = true; } } - if(pronunDigits && d % 4 === 0) { - result.push(HANGUL_DIGITS[d / 4]); + + if (pronunDigits && digit % 4 === 0) { + result.push(HANGUL_DIGITS[digit / 4]); pronunDigits = false; } - if(str[i] !== '0') { - result.push(HANGUL_CARDINAL[d % 4]); + + if (integerPart[i] !== '0') { + result.push(HANGUL_CARDINAL[digit % 4]); + } + } + result.push(HANGUL_NUMBERS[Number(integerPart[integerPart.length - 1])]); + + if (decimalPart) { + result.push('점'); + + for (let i = 0; i < decimalPart.length; i++) { + result.push(HANGUL_NUMBERS[Number(decimalPart[i])]); } } - result.push(HANGUL_NUMBERS[parseInt(str[str.length - 1])]); + return result.join(''); } From 0624b5af13f3827200711ff3584bef1f02ac66bb Mon Sep 17 00:00:00 2001 From: Dongkyu Kim Date: Sun, 30 Jun 2024 10:58:02 +0900 Subject: [PATCH 13/19] fix: packlint ESLint error (#149) --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 08a6927f..2fbc5a46 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,5 +8,5 @@ "strict": true, "skipLibCheck": true }, - "include": ["src", ".eslintrc.js"] + "include": ["src", ".eslintrc.js", "packlint.config.mjs"] } From ad05e4cb810f29e09706d482c9a2e114963790fe Mon Sep 17 00:00:00 2001 From: Dongkyu Kim Date: Sun, 30 Jun 2024 10:58:34 +0900 Subject: [PATCH 14/19] =?UTF-8?q?test:=20utils=20=EA=B8=B0=EB=8A=A5?= =?UTF-8?q?=EB=93=A4=EC=9D=98=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=BC=80?= =?UTF-8?q?=EC=9D=B4=EC=8A=A4=EB=A5=BC=20=EA=B0=9C=EC=84=A0=ED=95=A9?= =?UTF-8?q?=EB=8B=88=EB=8B=A4=20(#151)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: hasBatchim 함수의 테스트 케이스를 추가합니다 * test: hasSingleBatchim의 테스트 케이스를 추가합니다 --- src/utils.spec.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/utils.spec.ts b/src/utils.spec.ts index cacb0ce0..58dc04e4 100644 --- a/src/utils.spec.ts +++ b/src/utils.spec.ts @@ -34,6 +34,18 @@ describe('hasBatchim', () => { expect(hasBatchim('')).toBe(false); }); }); + + describe('완성된 한글이 아닌 경우', () => { + it('한글이 자음 또는 모음으로만 구성된 경우 false를 반환한다.', () => { + expect(hasBatchim('ㄱ')).toBe(false); + expect(hasBatchim('ㅏ')).toBe(false); + }); + + it('한글 외의 문자를 입력하면 false를 반환한다', () => { + expect(hasBatchim('cat')).toBe(false); + expect(hasBatchim('!')).toBe(false); + }); + }); }); describe('hasSingleBatchim', () => { @@ -54,6 +66,12 @@ describe('hasSingleBatchim', () => { expect(hasSingleBatchim('토')).toBe(false); expect(hasSingleBatchim('서')).toBe(false); }); + + it('한글 외의 문자를 입력하면 false를 반환한다.', () => { + expect(hasSingleBatchim('cat')).toBe(false); + expect(hasSingleBatchim('')).toBe(false); + expect(hasSingleBatchim('?')).toBe(false); + }); }); }); From e6512364d89b25423a605825e3a2dbf4206107bd Mon Sep 17 00:00:00 2001 From: Dongkyu Kim Date: Sun, 30 Jun 2024 10:59:13 +0900 Subject: [PATCH 15/19] =?UTF-8?q?fix:=20nextra=20theme=20asset=20=EA=B0=9C?= =?UTF-8?q?=EC=84=A0=20(#152)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/public/favicon-dark.png | Bin 0 -> 5451 bytes docs/public/favicon-dark.svg | 2 ++ docs/public/favicon.ico | Bin 25931 -> 0 bytes docs/public/favicon.svg | 2 ++ docs/public/next.svg | 1 - docs/public/vercel.svg | 1 - 6 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 docs/public/favicon-dark.png create mode 100644 docs/public/favicon-dark.svg delete mode 100644 docs/public/favicon.ico create mode 100644 docs/public/favicon.svg delete mode 100644 docs/public/next.svg delete mode 100644 docs/public/vercel.svg diff --git a/docs/public/favicon-dark.png b/docs/public/favicon-dark.png new file mode 100644 index 0000000000000000000000000000000000000000..07608185f0a3d1b2e7b818ce2732be7d35f58c86 GIT binary patch literal 5451 zcmb7IcU)7;vrniA1_(t6A|+H2A%Or=LJ37cKp=vEhTc0!6%hi4qM#rs2nZrYnokkzS=4@o@YpSO!Z|mtUZf)mjV=o@)?)66jfDV)=lkWDu z*1Uo4ZXQ1Jfr@;8X~>i5KWqda?_Vmuu8Mr7dIr2|o_FneWyF!p7MEsE;B*c-3 ze{GYSqW^H^_3t{{lac?}SCT;grTM>j|KOkzf587oXa4r|FD}_tB|0?X-(gdt5Z*yMnI!T>iP{xcYEODd}KYAYfzt3%_G;3ct^C_dXb|UL#onrat-v z=H_@3dMTb`(BUQ=C4kE5xzz8lY6tFsIHTw)IONS#CDkTkDcmD(B*k~f%Vevhy-5`O zf2!?zM)uw95@WxG^KL<&?hZxGh8&9ppB=8uN3dIfcpmH;mb*xA+%oqYDQ#xfA%vVB zMbw`ii3T4oCC`_&ai3E@`(>+Fb&{P(;m7e|=!QbX8?`8T)N*>j46+G=B9O)W!8<)y z=T8r284+K0v4QJVD~&x@XK~3-&xutSjQI}fHPMN_gR+^~JyYRC?)54EhFCt>GY(uy z4`>|HSLVtH-tO33&5j#&&%UZGK;Mo?j1JuH5N=y}9jbJ;-GwM)3O<+)@Sdvl-YRWk zh(Yzr+8Vz0ml?N93>?s4Z@D@fj7n9Pa^VX(-TS&#SXBJD^(6JEF_(Q-Aw^>4l}{_G z4~+`hA9s{iC*&*tKJhvEp7(lTHuSf7ZJMli7RxCaS{y{DhNxNl@T-YYnRO}Omej#P zRJ0!~sXx2mS+$f@Iqr~l-hJ2Rnk@Yh2k_eX`KPiA(WPDDH3ZBWha5?i6q!Ql@mg5HM6v!>S~YIYpi!y z2dqcU9R0LaQ)wVDXp%+HcjUp8Pn6PwBPsz}B0lujeAK$xA>}c#e4%=$SD}d*M%g6U z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XkWoTm9z>yZ|1@z05sO-Bdts_%gszlC;PB2Ur?p2GptPM+C~ zhxhha+aU!RtzvuRt0LyALc}W$tm2b9BseNZ@UF3?EGj4H!slT%2Q8h&!a6SptvxA^ zf~fBJq;}&6^WE_z=P4{>3S8`2(NSXxd}OFHms?WpHlN8}1WK(i&s#^)F0w+sm~_rD r(n$YXQcyd@`4Mh}z4!kDoDbzPR+_Fzeb)Quu2Ea#hI+B8Rrr4aMqku^ literal 0 HcmV?d00001 diff --git a/docs/public/favicon-dark.svg b/docs/public/favicon-dark.svg new file mode 100644 index 00000000..c5c553b4 --- /dev/null +++ b/docs/public/favicon-dark.svg @@ -0,0 +1,2 @@ + +es-hangul \ No newline at end of file diff --git a/docs/public/favicon.ico b/docs/public/favicon.ico deleted file mode 100644 index 718d6fea4835ec2d246af9800eddb7ffb276240c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25931 zcmeHv30#a{`}aL_*G&7qml|y<+KVaDM2m#dVr!KsA!#An?kSQM(q<_dDNCpjEux83 zLb9Z^XxbDl(w>%i@8hT6>)&Gu{h#Oeyszu?xtw#Zb1mO{pgX9699l+Qppw7jXaYf~-84xW z)w4x8?=youko|}Vr~(D$UXIbiXABHh`p1?nn8Po~fxRJv}|0e(BPs|G`(TT%kKVJAdg5*Z|x0leQq0 zkdUBvb#>9F()jo|T~kx@OM8$9wzs~t2l;K=woNssA3l6|sx2r3+kdfVW@e^8e*E}v zA1y5{bRi+3Z`uD3{F7LgFJDdvm;nJilkzDku>BwXH(8ItVCXk*-lSJnR?-2UN%hJ){&rlvg`CDTj z)Bzo!3v7Ou#83zEDEFcKt(f1E0~=rqeEbTnMvWR#{+9pg%7G8y>u1OVRUSoox-ovF z2Ydma(;=YuBY(eI|04{hXzZD6_f(v~H;C~y5=DhAC{MMS>2fm~1H_t2$56pc$NH8( z5bH|<)71dV-_oCHIrzrT`2s-5w_+2CM0$95I6X8p^r!gHp+j_gd;9O<1~CEQQGS8) zS9Q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4S}i zM9{fMPWo%4wYDG~BZ18BD+}h|GQKc-g^{++3MY>}W_uq7jGHx{mwE9fZiPCoxN$+7 zrODGGJrOkcPQUB(FD5aoS4g~7#6NR^ma7-!>mHuJfY5kTe6PpNNKC9GGRiu^L31uG z$7v`*JknQHsYB!Tm_W{a32TM099djW%5e+j0Ve_ct}IM>XLF1Ap+YvcrLV=|CKo6S zb+9Nl3_YdKP6%Cxy@6TxZ>;4&nTneadr z_ES90ydCev)LV!dN=#(*f}|ZORFdvkYBni^aLbUk>BajeWIOcmHP#8S)*2U~QKI%S zyrLmtPqb&TphJ;>yAxri#;{uyk`JJqODDw%(Z=2`1uc}br^V%>j!gS)D*q*f_-qf8&D;W1dJgQMlaH5er zN2U<%Smb7==vE}dDI8K7cKz!vs^73o9f>2sgiTzWcwY|BMYHH5%Vn7#kiw&eItCqa zIkR2~Q}>X=Ar8W|^Ms41Fm8o6IB2_j60eOeBB1Br!boW7JnoeX6Gs)?7rW0^5psc- zjS16yb>dFn>KPOF;imD}e!enuIniFzv}n$m2#gCCv4jM#ArwlzZ$7@9&XkFxZ4n!V zj3dyiwW4Ki2QG{@i>yuZXQizw_OkZI^-3otXC{!(lUpJF33gI60ak;Uqitp74|B6I zgg{b=Iz}WkhCGj1M=hu4#Aw173YxIVbISaoc z-nLZC*6Tgivd5V`K%GxhBsp@SUU60-rfc$=wb>zdJzXS&-5(NRRodFk;Kxk!S(O(a0e7oY=E( zAyS;Ow?6Q&XA+cnkCb{28_1N8H#?J!*$MmIwLq^*T_9-z^&UE@A(z9oGYtFy6EZef LrJugUA?W`A8`#=m diff --git a/docs/public/favicon.svg b/docs/public/favicon.svg new file mode 100644 index 00000000..e6aa5e00 --- /dev/null +++ b/docs/public/favicon.svg @@ -0,0 +1,2 @@ + +es-hangul \ No newline at end of file diff --git a/docs/public/next.svg b/docs/public/next.svg deleted file mode 100644 index 5174b28c..00000000 --- a/docs/public/next.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/public/vercel.svg b/docs/public/vercel.svg deleted file mode 100644 index d2f84222..00000000 --- a/docs/public/vercel.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file From 0bd21e7d8533e291ec1f838f13de5259f9a464f8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 30 Jun 2024 23:54:06 +0900 Subject: [PATCH 16/19] chore: version packages (#153) Co-authored-by: github-actions[bot] --- .changeset/famous-cheetahs-sneeze.md | 5 ----- CHANGELOG.md | 6 ++++++ docs/CHANGELOG.md | 7 +++++++ docs/package.json | 2 +- package.json | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) delete mode 100644 .changeset/famous-cheetahs-sneeze.md diff --git a/.changeset/famous-cheetahs-sneeze.md b/.changeset/famous-cheetahs-sneeze.md deleted file mode 100644 index f20b5a83..00000000 --- a/.changeset/famous-cheetahs-sneeze.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"es-hangul": minor ---- - -fix: amountToHangul이 소수점, 숫자도 대응할 수 있도록 수정 diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e5583c4..aa48dffc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # es-hangul +## 1.4.0 + +### Minor Changes + +- [#144](https://github.com/toss/es-hangul/pull/144) [`b114897`](https://github.com/toss/es-hangul/commit/b1148973e6c2b640ce528fc8ba4b8e2e034b90de) Thanks [@Collection50](https://github.com/Collection50)! - fix: amountToHangul이 소수점, 숫자도 대응할 수 있도록 수정 + ## 1.3.10 ### Patch Changes diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index adc357a5..43b723a4 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,12 @@ # docs +## 0.1.7 + +### Patch Changes + +- Updated dependencies [[`b114897`](https://github.com/toss/es-hangul/commit/b1148973e6c2b640ce528fc8ba4b8e2e034b90de)]: + - es-hangul@1.4.0 + ## 0.1.6 ### Patch Changes diff --git a/docs/package.json b/docs/package.json index 2e1db525..cb05dd32 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "docs", - "version": "0.1.6", + "version": "0.1.7", "private": true, "packageManager": "yarn@4.1.1", "scripts": { diff --git a/package.json b/package.json index cc3f0c6f..b0e08ad8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "es-hangul", - "version": "1.3.10", + "version": "1.4.0", "keywords": [ "한글", "한국어", From f7e60aeca9f315ac1e34eba0a1f8a82f55d79956 Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Mon, 1 Jul 2024 01:17:41 +0900 Subject: [PATCH 17/19] =?UTF-8?q?fix:=20=ED=8C=A8=ED=82=A4=EC=A7=80?= =?UTF-8?q?=EA=B0=80=20=EB=85=B8=EC=B6=9C=ED=95=98=EB=8A=94=20=EC=9D=B8?= =?UTF-8?q?=ED=84=B0=ED=8E=98=EC=9D=B4=EC=8A=A4=EB=A5=BC=20=EB=AA=85?= =?UTF-8?q?=ED=99=95=ED=9E=88=20=ED=95=98=EA=B8=B0=20=EC=9C=84=ED=95=B4=20?= =?UTF-8?q?index.ts=EB=A5=BC=20named=20export=EB=A1=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=ED=95=A9=EB=8B=88=EB=8B=A4=20(#157)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: exposing public apis strictly * Create wild-cows-juggle.md --- .changeset/wild-cows-juggle.md | 5 +++++ src/index.ts | 33 +++++++++++++++++++++------------ 2 files changed, 26 insertions(+), 12 deletions(-) create mode 100644 .changeset/wild-cows-juggle.md diff --git a/.changeset/wild-cows-juggle.md b/.changeset/wild-cows-juggle.md new file mode 100644 index 00000000..4dccf2ec --- /dev/null +++ b/.changeset/wild-cows-juggle.md @@ -0,0 +1,5 @@ +--- +"es-hangul": patch +--- + +fix: 패키지가 노출하는 인터페이스를 명확히 하기 위해 index.ts를 named export로 수정합니다 diff --git a/src/index.ts b/src/index.ts index ee3becfd..5e839a05 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,12 +1,21 @@ -export * from './assemble'; -export * from './chosungIncludes'; -export * from './combineHangulCharacter'; -export * from './convertQwertyToHangulAlphabet'; -export * from './disassemble'; -export * from './disassembleCompleteHangulCharacter'; -export * from './hangulIncludes'; -export * from './josa'; -export * from './removeLastHangulCharacter'; -export * from './utils'; -export * from './extractHangul'; -export * from './acronymizeHangul'; +export { assembleHangul } from './assemble'; +export { chosungIncludes } from './chosungIncludes'; +export { combineHangulCharacter, combineVowels, curriedCombineHangulCharacter } from './combineHangulCharacter'; +export { convertQwertyToHangul, convertQwertyToHangulAlphabet } from './convertQwertyToHangulAlphabet'; +export { disassembleHangul, disassembleHangulToGroups } from './disassemble'; +export { disassembleCompleteHangulCharacter } from './disassembleCompleteHangulCharacter'; +export { hangulIncludes } from './hangulIncludes'; +export { josa } from './josa'; +export { removeLastHangulCharacter } from './removeLastHangulCharacter'; +export { + canBeChosung, + canBeJongsung, + canBeJungsung, + getChosung, + hasBatchim, + hasProperty, + hasSingleBatchim, + hasValueInReadOnlyStringList, +} from './utils'; +export { extractHangul } from './extractHangul'; +export { acronymizeHangul } from './acronymizeHangul'; From d58ba15678f6d50b00fcd6dbf1e6388e61b3143b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 01:19:25 +0900 Subject: [PATCH 18/19] chore: version packages (#160) Co-authored-by: github-actions[bot] --- .changeset/wild-cows-juggle.md | 5 ----- CHANGELOG.md | 6 ++++++ docs/CHANGELOG.md | 7 +++++++ docs/package.json | 2 +- package.json | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) delete mode 100644 .changeset/wild-cows-juggle.md diff --git a/.changeset/wild-cows-juggle.md b/.changeset/wild-cows-juggle.md deleted file mode 100644 index 4dccf2ec..00000000 --- a/.changeset/wild-cows-juggle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"es-hangul": patch ---- - -fix: 패키지가 노출하는 인터페이스를 명확히 하기 위해 index.ts를 named export로 수정합니다 diff --git a/CHANGELOG.md b/CHANGELOG.md index aa48dffc..2a30ae47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # es-hangul +## 1.4.1 + +### Patch Changes + +- [#157](https://github.com/toss/es-hangul/pull/157) [`f7e60ae`](https://github.com/toss/es-hangul/commit/f7e60aeca9f315ac1e34eba0a1f8a82f55d79956) Thanks [@manudeli](https://github.com/manudeli)! - fix: 패키지가 노출하는 인터페이스를 명확히 하기 위해 index.ts를 named export로 수정합니다 + ## 1.4.0 ### Minor Changes diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 43b723a4..8009477c 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,12 @@ # docs +## 0.1.8 + +### Patch Changes + +- Updated dependencies [[`f7e60ae`](https://github.com/toss/es-hangul/commit/f7e60aeca9f315ac1e34eba0a1f8a82f55d79956)]: + - es-hangul@1.4.1 + ## 0.1.7 ### Patch Changes diff --git a/docs/package.json b/docs/package.json index cb05dd32..9269fa8e 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "docs", - "version": "0.1.7", + "version": "0.1.8", "private": true, "packageManager": "yarn@4.1.1", "scripts": { diff --git a/package.json b/package.json index b0e08ad8..9f2f69e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "es-hangul", - "version": "1.4.0", + "version": "1.4.1", "keywords": [ "한글", "한국어", From 11e0ba9b8762f25b321d208ba12ff7dc4510ae6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=B0=AC=ED=98=81?= Date: Wed, 3 Jul 2024 14:26:43 +0900 Subject: [PATCH 19/19] =?UTF-8?q?docs:=20CONTRIBUTING.md=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EC=97=90=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=BB=A8?= =?UTF-8?q?=EB=B2=A4=EC=85=98=EC=9D=84=20=EC=9E=91=EC=84=B1=ED=95=A9?= =?UTF-8?q?=EB=8B=88=EB=8B=A4.=20(#132)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update CONTRIBUTING.md * fix * write contribution.md Co-authored-by: Jonghyeon Ko <61593290+manudeli@users.noreply.github.com> Co-authored-by: Dongkyu Kim <55759551+po4tion@users.noreply.github.com> * Update .github/CONTRIBUTING.md Co-authored-by: Jonghyeon Ko * Update .github/CONTRIBUTING.md Co-authored-by: Jonghyeon Ko * Update .github/CONTRIBUTING.md Co-authored-by: Jonghyeon Ko --------- Co-authored-by: Jonghyeon Ko <61593290+manudeli@users.noreply.github.com> Co-authored-by: Dongkyu Kim <55759551+po4tion@users.noreply.github.com> Co-authored-by: Jonghyeon Ko --- .github/CONTRIBUTING.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 6d96350e..1bba496f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -48,3 +48,30 @@ ### 2.2 Description A clear and concise description of what the pr is about. + +## 3. Convention + +함수명에는 특별한 이유가 없다면 hangul을 포함하지 않습니다. + +```ts +// Don't +function getHangulSimilarity(); +// Do +function getSimilarity(); + +// Don't +function disassembleHangul(); +// Do +function disassemble(); +``` + +함수명을 지을 때 아래와 같이 import될 것을 고려해야 합니다. + +```ts +import { getSimilarity, disassemble, josa } from 'es-hangul' // 따로 나눠서도 제공 +import hangul from 'es-hangul' // hangul default export에 묶어서도 제공 + +hangul.getSimilarity(...) +hangul.disassemble(...) +hangul.josa(...) +