toss / es-hangul

A modern JavaScript library for handling Hangul characters.
https://es-hangul.slash.page/
MIT License
1.24k stars 83 forks source link

feat: choseongIncludes함수를 제거합니다. #197

Closed okinawaa closed 1 month ago

okinawaa commented 1 month ago

Overview

chosungIncludes : 한글 문자열에서 초성을 검색하는 함수 어떤 한글 문자열이 주어졌을 때 해당 문자열에서 초성만 추출하는 것은 한글 처리에 대한 도메인 지식이 필요하지만, includes라는 동작은 그렇지 않아요. 저는 choseongify("안녕하세요") === "ㅇㄴㅎㅅㅇ"만을 제공하는 것이 더 나은 인터페이스라고 생각해요. 초성을 추출하는 동작은 표준 라이브러리만으로는 구현이 쉽지 않고, 따라서 es-hangul이 이 문제를 해결해주면 나머지 처리(.includes)는 사용자가 원하는 방식, 익숙한 방식대로 진행할 수 있어요. 예를들어 "맛있다 사과"에서 "ㅅㄱ"라는 초성이 몇 번째 index에 등장하는지를 알고 싶다면, es-hangul에서는 현재 마땅한 방법이 없어요. 다만 위에서 제가 제시한 대안대로면 얼마든지 다른 문자열 처리 메서드를 사용할 수 있어서 choseongify("맛있다 사과").search("ㅅㄱ")로 가능하구요.

PR Checklist

  1. I have read the Contributing Guide
  2. I have written documents and tests, if needed.
vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
es-hangul ❌ Failed (Inspect) Jul 23, 2024 3:37am
changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: 06ff169248e6707d8d8716e9444f2fc15cd2bb96

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