### Install es-hangul Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/installation.ko.mdx Installs the es-hangul library using either npm or yarn. This is the primary step to begin using the library in your project. ```npm npm install es-hangul ``` ```yarn yarn add es-hangul ``` -------------------------------- ### Interactive Example with Sandpack Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/pronunciation/standardizePronunciation.ko.mdx An interactive example using Sandpack to demonstrate the standardizePronunciation function in a runnable environment. ```ts import { standardizePronunciation } from 'es-hangul'; console.log(standardizePronunciation('곧이듣다')); console.log(standardizePronunciation('곧이듣다', { hardConversion: false })); ``` -------------------------------- ### Install es-hangul with npm or yarn Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/installation.en.mdx This snippet shows how to install the es-hangul library using either npm or yarn. It's a direct installation command for adding the package to your project's dependencies. ```shell npm install es-hangul ``` -------------------------------- ### Sandpack Usage Example Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/number/numberToHangul.en.mdx An example demonstrating how to use the numberToHangul function within a Sandpack environment, logging output to the console. ```javascript import { numberToHangul } from 'es-hangul'; console.log(numberToHangul(123_456_780)); console.log(numberToHangul(123_456_780, { spacing: true })); ``` -------------------------------- ### Interactive Example with Sandpack Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/number/numberToHangulMixed.ko.mdx Provides an interactive example using Sandpack to demonstrate the numberToHangulMixed function. It shows how to import and use the function with and without the spacing option. ```javascript import { numberToHangulMixed } from 'es-hangul'; console.log(numberToHangulMixed(123_456_780)); console.log(numberToHangulMixed(123_456_780, { spacing: true })); ``` -------------------------------- ### Interactive canBeJongseong Example Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/canBeJongseong.ko.mdx An interactive example using Sandpack to test the canBeJongseong function with the input 'ㄱ'. ```ts import { canBeJongseong } from 'es-hangul'; console.log(canBeJongseong('ㄱ')); ``` -------------------------------- ### Interactive hasBatchim Example Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/hasBatchim.ko.mdx An interactive example using Sandpack to demonstrate the `hasBatchim` function in a live JavaScript environment. It shows basic usage and usage with the `only` option. ```javascript import { hasBatchim } from 'es-hangul'; console.log(hasBatchim('값')); console.log(hasBatchim('값', { only: 'single' })); ``` -------------------------------- ### Usage Example with Sandpack Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/disassembleCompleteCharacter.ko.mdx An interactive example using Sandpack to demonstrate the functionality of disassembleCompleteCharacter by logging the disassembled jamo for the character '값'. ```javascript import { disassembleCompleteCharacter } from 'es-hangul'; console.log(disassembleCompleteCharacter('값')); ``` -------------------------------- ### Days Function Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/number/days.en.mdx Provides examples of how to use the `days` function with various numbers to get their native Korean day names. ```javascript days(1); // '하루' days(2); // '이틀' days(3); // '사흘' days(10); // '열흘' days(11); // '열하루' days(20); // '스무날' days(29); // '스무아흐레' days(30); // '서른날' ``` -------------------------------- ### josa.pick Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/josa.pick.ko.mdx Provides examples of how to use the josa.pick function with different Korean words and particle options, demonstrating its behavior in selecting the correct particle. ```typescript josa.pick('샴푸', '이/가'); // '가' josa.pick('칫솔', '이/가'); // '이' josa.pick('바깥', '으로/로'); // '으로' josa.pick('내부', '으로/로'); // '로' ``` -------------------------------- ### convertHangulToQwerty Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/keyboard/convertHangulToQwerty.en.mdx Provides several examples demonstrating the usage of the `convertHangulToQwerty` function with different Korean and mixed character inputs. ```typescript convertHangulToQwerty('뮻'); // 'abc' convertHangulToQwerty('겨노'); // 'rush' convertHangulToQwerty('님노'); // 'slash' convertHangulToQwerty('RㅏㄱEㅜrl'); // 'RkrEnrl' convertHangulToQwerty('ㅙㅜㅎ 햐ㅣ애ㅜㅎ'); // 'hong gildong' convertHangulToQwerty('ㄴ대ㅕㅣ, ㅏㅐㄱㄷㅁ'); // 'seoul, korea' ``` -------------------------------- ### Show convertQwertyToAlphabet Usage Examples in TypeScript Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/keyboard/convertQwertyToAlphabet.en.mdx These examples demonstrate the practical application of the `convertQwertyToAlphabet` function. They illustrate how various English and mixed-language inputs are transformed into their corresponding Korean phoneme outputs based on the QWERTY keyboard layout. ```typescript convertQwertyToAlphabet('abc'); // 'ㅁㅠㅊ' convertQwertyToAlphabet('ABC'); // 'ㅁㅠㅊ' convertQwertyToAlphabet('vm론트'); // 'ㅍㅡ론트' convertQwertyToAlphabet('RㅏㄱEㅜrl'); // 'ㄲㅏㄱㄸㅜㄱㅣ' ``` -------------------------------- ### getChoseong Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/getChoseong.en.mdx Provides examples of how to use the getChoseong function with different Korean words, demonstrating its output. ```tsx getChoseong('사과'); // 'ㅅㄱ' getChoseong('띄어 쓰기'); // 'ㄸㅇ ㅆㄱ' ``` -------------------------------- ### Interactive Example with Sandpack Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/getChoseong.ko.mdx An interactive example using Sandpack to demonstrate the getChoseong function in action. Imports the function from 'es-hangul' and logs the result of '사과'. ```ts import { getChoseong } from 'es-hangul'; console.log(getChoseong('사과')); ``` -------------------------------- ### seosusa Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/number/seosusa.ko.mdx Provides examples of the seosusa function's output for various inputs, demonstrating the conversion to Korean ordinal numbers. ```typescript seosusa(1); // '첫째' seosusa(2); // '둘째' seosusa(3); // '셋째' seosusa(10); // '열째' seosusa(11); // '열한째' seosusa(12); // '열두째' seosusa(13); // '열셋째' seosusa(20); // '스무째' seosusa(21); // '스물한째' seosusa(99); // '아흔아홉째' seosusa(100); // '백째' ``` -------------------------------- ### canBeJungseong Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/canBeJungseong.en.mdx Provides examples demonstrating the usage of the `canBeJungseong` function with various Korean characters, showing expected true and false outputs. ```typescript canBeJungseong('ㅏ'); // true canBeJungseong('ㅗㅏ'); // true canBeJungseong('ㅏㅗ'); // false canBeJungseong('ㄱ'); // false canBeJungseong('ㄱㅅ'); // false canBeJungseong('가'); // false ``` -------------------------------- ### josa.pick Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/josa.pick.en.mdx Illustrates the usage of the josa.pick method with different Korean words and particle options, showing the expected output for each case. ```typescript josa.pick('샴푸', '이/가'); // '가' josa.pick('칫솔', '이/가'); // '이' josa.pick('바깥', '으로/로'); // '으로' josa.pick('내부', '으로/로'); // '로' ``` -------------------------------- ### amountToHangul Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/number/amountToHangul.ko.mdx Provides examples of how to use the amountToHangul function with various input formats, including strings with commas, currency symbols, decimal points, and direct number inputs. ```typescript amountToHangul('15,201,100'); // '일천오백이십만천백' amountToHangul('120,030원'); // '일십이만삼십' amountToHangul('12345.6789'); // '일만이천삼백사십오점육칠팔구' amountToHangul(15_201_100); // '일천오백이십만천백' ``` -------------------------------- ### Example Usage of assemble Function (TypeScript) Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/assemble.ko.mdx Illustrates how to import and use the `assemble` function from the `es-hangul` library. The examples demonstrate composing various Korean character sequences, including fragmented and complete words, into correct Korean text. ```typescript import { assemble } from 'es-hangul'; console.log(assemble(['아버지가', ' ', '방ㅇ', 'ㅔ ', '들ㅇ', 'ㅓ갑니다'])); console.log(assemble(['아버지가', ' ', '방에 ', '들어갑니다'])); console.log(assemble(['ㅇ', 'ㅏ', 'ㅂ', 'ㅓ', 'ㅈ', 'ㅣ'])); ``` -------------------------------- ### susa Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/number/susa.en.mdx Demonstrates the usage of the susa function with various numbers, showcasing both native numeral words and numeral determiners. ```javascript susa(1); // '하나' susa(2); // '둘' susa(11); // '열하나' susa(21); // '스물하나' susa(99); // '아흔아홉' susa(100); // '백' susa(1, true); // '한' susa(2, true); // '두' susa(11, true); // '열한' susa(20, true); // '스무' susa(21, true); // '스물한' ``` -------------------------------- ### Disassemble Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/disassemble.ko.mdx Provides examples of the `disassemble` function's output for various Korean inputs, including single characters, phrases, and special vowel/consonant combinations. ```tsx disassemble('값'); // 'ㄱㅏㅂㅅ' disassemble('값이 비싸다'); // 'ㄱㅏㅂㅅㅇㅣ ㅂㅣㅆㅏㄷㅏ' disassemble('ㅘ'); // 'ㅗㅏ' disassemble('ㄵ'); // 'ㄴㅈ' ``` -------------------------------- ### Using numberToHangul in Sandpack Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/number/numberToHangul.ko.mdx An example of how to import and use the numberToHangul function within a Sandpack environment, showcasing its output. ```ts import { numberToHangul } from 'es-hangul'; console.log(numberToHangul(123_456_780)); console.log(numberToHangul(123_456_780, { spacing: true })); ``` -------------------------------- ### Sandpack Usage Example Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/number/seosusa.ko.mdx Demonstrates how to use the seosusa function within a Sandpack environment, importing it from the 'es-hangul' library and logging the output. ```typescript import { seosusa } from 'es-hangul'; console.log(seosusa(1)); ``` -------------------------------- ### Live Demo of disassembleToGroups Function Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/disassembleToGroups.en.mdx A runnable example demonstrating how to import and use the `disassembleToGroups` function from the `es-hangul` library to process a Hangul string and log the result to the console. ```typescript import { disassembleToGroups } from 'es-hangul'; console.log(disassembleToGroups('사과')); ``` -------------------------------- ### disassemble Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/disassemble.en.mdx Provides examples of how to use the disassemble function with different Korean characters and phrases, demonstrating its ability to break down complex Hangul into jamo. ```tsx disassemble('값'); // 'ㄱㅏㅂㅅ' disassemble('값이 비싸다'); // 'ㄱㅏㅂㅅㅇㅣ ㅂㅣㅆㅏㄷㅏ' disassemble('ㅘ'); // 'ㅗㅏ' disassemble('ㄵ'); // 'ㄴㅈ' ``` -------------------------------- ### Illustrate canBeChoseong Usage with Examples in TypeScript Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/canBeChoseong.en.mdx Provides various examples demonstrating the expected boolean output of the `canBeChoseong` function for different input characters, including valid single choseongs, invalid multi-character inputs, and non-choseong characters. ```typescript canBeChoseong('ㄱ'); // true canBeChoseong('ㅃ'); // true canBeChoseong('ㄱㅅ'); // false canBeChoseong('ㅏ'); // false canBeChoseong('가'); // false ``` -------------------------------- ### hasBatchim Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/hasBatchim.en.mdx Illustrates the usage of the `hasBatchim` function with various Korean characters and options, demonstrating its behavior in detecting batchim. ```typescript hasBatchim('값'); // true hasBatchim('토'); // false hasBatchim('갑', { only: 'single' }); // true hasBatchim('값', { only: 'single' }); // false hasBatchim('토', { only: 'double' }); // false ``` -------------------------------- ### disassembleToGroups Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/disassembleToGroups.ko.mdx Provides examples of how to use the disassembleToGroups function, demonstrating its ability to handle simple characters, combined vowels like 'ㅘ', and combined consonants like 'ㄵ'. ```typescript disassembleToGroups('사과'); // [['ㅅ', 'ㅏ'], ['ㄱ', 'ㅗ', 'ㅏ']] disassembleToGroups('ㅘ'); // [['ㅗ', 'ㅏ']] disassembleToGroups('ㄵ'); // [['ㄴ', 'ㅈ']] ``` -------------------------------- ### Try Romanize Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/pronunciation/romanize.ko.mdx A runnable example using Sandpack to demonstrate the romanize function with the input '백마'. ```ts import { romanize } from 'es-hangul'; console.log(romanize('백마')); ``` -------------------------------- ### Example Usage of assemble Function in TypeScript Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/assemble.en.mdx Illustrates how to import and use the `assemble` function from the `es-hangul` library. The examples demonstrate its capability to correctly combine various forms of Korean text fragments, from individual characters to partial and complete sentences, into grammatically correct strings. ```typescript import { assemble } from 'es-hangul'; console.log(assemble(['아버지가', ' ', '방ㅇ', 'ㅔ ', '들ㅇ', 'ㅓ갑니다'])) console.log(assemble(['아버지가', ' ', '방에 ', '들어갑니다'])) console.log(assemble(['ㅇ', 'ㅏ', 'ㅂ', 'ㅓ', 'ㅈ', 'ㅣ'])) ``` -------------------------------- ### numberToHangul Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/number/numberToHangul.ko.mdx Demonstrates various use cases of the numberToHangul function, including different number formats and the spacing option. ```tsx numberToHangul(210_000); // '이십일만'; numberToHangul(12_345); // '일만이천삼백사십오'; numberToHangul(123_456_780); // '일억이천삼백사십오만육천칠백팔십'; numberToHangul(-12_345.678); // '마이너스일만이천삼백사십오점육칠팔'; numberToHangul(123_456_780, { spacing: true }); // '일억 이천삼백사십오만 육천칠백팔십'; ``` -------------------------------- ### numberToHangul Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/number/numberToHangul.en.mdx Demonstrates various use cases of the numberToHangul function, including different number formats and the effect of the spacing option. ```tsx numberToHangul(210_000); // '이십일만'; numberToHangul(12_345); // '일만이천삼백사십오'; numberToHangul(123_456_780); // '일억이천삼백사십오만육천칠백팔십'; numberToHangulMixed(-12_345.678); // '마이너스일만이천삼백사십오점육칠팔'; numberToHangul(123_456_780, { spacing: true }); // '일억 이천삼백사십오만 육천칠백팔십'; ``` -------------------------------- ### Examples of getChoseong Usage Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/getChoseong.ko.mdx Demonstrates the usage of the getChoseong function with different Korean words, including those with spaces. ```tsx getChoseong('사과'); // 'ㅅㄱ' getChoseong('띄어 쓰기'); // 'ㄸㅇ ㅆㄱ' ``` -------------------------------- ### hasValueInReadOnlyStringList and hasProperty implementations Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/migration/v2.en.mdx Provides example implementations for hasValueInReadOnlyStringList and hasProperty, as these functions were removed for not being closely related to the Hangul domain. ```tsx export function hasValueInReadOnlyStringList(list: readonly T[], value: string): value is T { return list.some(item => item === value); } export function hasProperty(obj: T, key: K): key is K & keyof T { return Object.prototype.hasOwnProperty.call(obj, key); } ``` -------------------------------- ### Using numberToHangulMixed with Sandpack Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/number/numberToHangulMixed.en.mdx An example of how to use the numberToHangulMixed function within a Sandpack environment, demonstrating its output for a large number with and without spacing. ```javascript import { numberToHangulMixed } from 'es-hangul'; console.log(numberToHangulMixed(1_2345_6780)); console.log(numberToHangulMixed(1_2345_6780, { spacing: true })); ``` -------------------------------- ### Try amountToHangul Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/number/amountToHangul.ko.mdx A Sandpack example demonstrating the usage of the amountToHangul function within a TypeScript environment, logging the output of a sample conversion. ```ts import { amountToHangul } from 'es-hangul'; console.log(amountToHangul('15,201,100')); ``` -------------------------------- ### josa Function Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/josa.en.mdx Illustrates the usage of the josa function with different Hangul words and particles, showing the expected output after appending the correct particle. ```typescript josa('샴푸', '이/가'); // '샴푸가' josa('칫솔', '이/가'); // '칫솔이' josa('바깥', '으로/로'); // '바깥으로' josa('내부', '으로/로'); // '내부로' ``` -------------------------------- ### Examples of removeLastCharacter Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/removeLastCharacter.ko.mdx Provides examples demonstrating the usage of the removeLastCharacter function with various Korean strings. ```tsx removeLastCharacter('안녕하세요 값'); // '안녕하세요 갑' removeLastCharacter('프론트엔드'); // '프론트엔ㄷ' removeLastCharacter('일요일'); // '일요이' removeLastCharacter('전화'); // '전호' removeLastCharacter('신세계'); // '신세ㄱ' ``` -------------------------------- ### josa.pick Demo with Sandpack Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/josa.pick.en.mdx A live demo of the josa.pick method using Sandpack, demonstrating its functionality by picking the correct particle for a given word. ```typescript import { josa } from 'es-hangul'; console.log(josa.pick('샴푸', '이/가')); ``` -------------------------------- ### Romanize Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/pronunciation/romanize.ko.mdx Provides practical examples of the romanize function converting Korean words and phrases into Roman characters. ```tsx romanize('백마'); // 'baengma' romanize('학여울'); // 'hangnyeoul' romanize('해돋이'); // 'haedoji' romanize('좋고'); // 'joko' romanize('압구정'); // 'apgujeong' romanize('구미'); // 'gumi' romanize('대관령'); // 'daegwallyeong' romanize('ㄱ'); // 'g' romanize('한국어!'); // 'hangugeo!' romanize('안녕하세요'); // 'annyeonghaseyo' ``` -------------------------------- ### Live Demo with es-hangul Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/keyboard/convertHangulToQwerty.en.mdx A runnable demo using Sandpack that imports and utilizes the `convertHangulToQwerty` function from the 'es-hangul' library to demonstrate its functionality. ```typescript import { convertHangulToQwerty } from 'es-hangul'; console.log(convertHangulToQwerty('뮻')); console.log(convertHangulToQwerty('겨노')); console.log(convertHangulToQwerty('님노')); console.log(convertHangulToQwerty('RㅏㄱEㅜrl')); console.log(convertHangulToQwerty('ㅙㅜㅎ 햐ㅣ애ㅜㅎ')); console.log(convertHangulToQwerty('ㄴ대ㅕㅣ, ㅏㅐㄱㄷㅁ')); ``` -------------------------------- ### Using josa.pick in Sandpack Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/josa.pick.ko.mdx A runnable example using the josa.pick function within a Sandpack environment, demonstrating its practical application by logging the result of picking a particle for a given word. ```typescript import { josa } from 'es-hangul'; console.log(josa.pick('샴푸', '이/가')); ``` -------------------------------- ### standardizePronunciation Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/pronunciation/standardizePronunciation.en.mdx Provides various examples of using the standardizePronunciation function with and without the hardConversion option to demonstrate its behavior with different Hangul inputs. ```tsx console.log(standardizePronunciation('디귿이')); // '디그시' console.log(standardizePronunciation('굳이')); // '구지' console.log(standardizePronunciation('담요')); // '딤뇨' console.log(standardizePronunciation('침략')); // '침냑' console.log(standardizePronunciation('먹는')); // '멍는' console.log(standardizePronunciation('신라')); // '실라' console.log(standardizePronunciation('놓고')); // '노코' console.log(standardizePronunciation('곧이듣다')); // '고지듣따' console.log(standardizePronunciation('곧이듣다', { hardConversion: false })); // '고지듣다' console.log(standardizePronunciation('닦다')); // '닥따' console.log(standardizePronunciation('닦다', { hardConversion: false })); // '닥다' console.log(standardizePronunciation('있다')); // '읻따' console.log(standardizePronunciation('있다', { hardConversion: false })); // '읻다' console.log(standardizePronunciation('핥다')); // '할따' console.log(standardizePronunciation('핥다', { hardConversion: false })); // '할다' console.log(standardizePronunciation('젊다')); // '점따' console.log(standardizePronunciation('젊다', { hardConversion: false })); // '점다' ``` -------------------------------- ### Live Demo of convertQwertyToHangul Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/keyboard/convertQwertyToHangul.en.mdx Provides an interactive Sandpack environment to test the `convertQwertyToHangul` function with sample inputs. ```typescript import { convertQwertyToHangul } from 'es-hangul'; console.log(convertQwertyToHangul('abc')); console.log(convertQwertyToHangul('ABC')); console.log(convertQwertyToHangul('vm론트')); ``` -------------------------------- ### Implement convertQwertyToAlphabet Demo in TypeScript Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/keyboard/convertQwertyToAlphabet.en.mdx This code snippet provides a runnable demonstration of the `convertQwertyToAlphabet` function. It imports the function from the 'es-hangul' library and logs the results of converting several example strings to the console, showcasing its functionality in a practical context. ```ts import { convertQwertyToAlphabet } from 'es-hangul'; console.log(convertQwertyToAlphabet('abc')); console.log(convertQwertyToAlphabet('ABC')); console.log(convertQwertyToAlphabet('vm론트')); ``` -------------------------------- ### amountToHangul Demo Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/number/amountToHangul.en.mdx A Sandpack demo showcasing the usage of the amountToHangul function by importing it and logging the result of a sample conversion. ```ts import { amountToHangul } from 'es-hangul'; console.log(amountToHangul('15,201,100')); ``` -------------------------------- ### disassembleCompleteCharacter Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/disassembleCompleteCharacter.en.mdx Provides examples of how to use the disassembleCompleteCharacter function with different Korean characters, showing the expected output structure containing choseong, jungseong, and jongseong. ```tsx disassembleCompleteCharacter('값'); // { choseong: 'ㄱ', jungseong: 'ㅏ', jongseong: 'ㅂㅅ' } disassembleCompleteCharacter('리'); // { choseong: 'ㄹ', jungseong: 'ㅣ', jongseong: '' } disassembleCompleteCharacter('빚'); // { choseong: 'ㅂ', jungseong: 'ㅣ', jongseong: 'ㅈ' } disassembleCompleteCharacter('박'); // { choseong: 'ㅂ', jungseong: 'ㅏ', jongseong: 'ㄱ' } ``` -------------------------------- ### canBeJongseong Demo Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/canBeJongseong.en.mdx A live demo using Sandpack to showcase the canBeJongseong function in action, importing it from the 'es-hangul' library and logging the result for a sample character. ```ts import { canBeJongseong } from 'es-hangul'; console.log(canBeJongseong('ㄱ')); ``` -------------------------------- ### Demonstrate canBeChoseong Import and Usage in TypeScript Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/canBeChoseong.en.mdx Shows how to import the `canBeChoseong` function from the `es-hangul` library and use it to log the result for a sample character, illustrating a basic integration scenario. ```typescript import { canBeChoseong } from 'es-hangul'; console.log(canBeChoseong('ㄱ')); ``` -------------------------------- ### combineCharacter Usage Examples (TypeScript) Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/combineCharacter.en.mdx Provides practical examples demonstrating how to invoke the `combineCharacter` function to form various Korean characters, including cases with and without a final consonant. ```typescript combineCharacter('ㄱ', 'ㅏ', 'ㅂㅅ'); // '값' combineCharacter('ㅌ', 'ㅗ'); // '토' ``` -------------------------------- ### seosusa Function Usage Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/number/seosusa.en.mdx Provides a series of examples demonstrating the `seosusa` function's behavior with various integer inputs, showcasing its conversion of numbers to Korean ordinal words, including both native and Sino-Korean forms. ```typescript seosusa(1); // '첫째' seosusa(2); // '둘째' seosusa(3); // '셋째' seosusa(10); // '열째' seosusa(11); // '열한째' seosusa(12); // '열두째' seosusa(13); // '열셋째' seosusa(20); // '스무째' seosusa(21); // '스물한째' seosusa(99); // '아흔아홉째' seosusa(100); // '백째' ``` -------------------------------- ### es-hangul hasBatchim Demo Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/hasBatchim.en.mdx A live demo using Sandpack to showcase the `hasBatchim` function from the 'es-hangul' library in a Node.js environment. ```ts import { hasBatchim } from 'es-hangul'; console.log(hasBatchim('값')); console.log(hasBatchim('값', { only: 'single' })); ``` -------------------------------- ### TypeScript combineVowels Function Usage Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/combineVowels.en.mdx These examples illustrate the behavior of the `combineVowels` function with various Korean vowel inputs. They demonstrate how the function correctly forms diphthongs like 'ㅘ' and 'ㅙ' when rules allow, and simply concatenates vowels like 'ㅗㅛ' when combination rules are not met. ```typescript combineVowels('ㅗ', 'ㅏ'); // 'ㅘ' combineVowels('ㅗ', 'ㅐ'); // 'ㅙ' combineVowels('ㅗ', 'ㅛ'); // 'ㅗㅛ' ``` -------------------------------- ### assembleHangul 함수명 변경 Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/migration/v2.ko.mdx assembleHangul 함수의 이름이 assemble로 변경되었습니다. 이 변경은 함수명에서 'Hangul'을 제거하여 라이브러리의 일관성을 높이기 위한 조치입니다. 함수는 초성, 중성, 종성을 받아 완성된 한글 문자를 생성합니다. ```tsx // ASIS assembleHangul('ㄱ', 'ㅏ', 'ㅁ') // TOBE assemble('ㄱ', 'ㅏ', 'ㅁ') ``` -------------------------------- ### canBeChoseong Examples Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/canBeChoseong.ko.mdx Illustrates the usage of the canBeChoseong function with various Korean characters to demonstrate its behavior. ```typescript canBeChoseong('ㄱ'); // true canBeChoseong('ㅃ'); // true canBeChoseong('ㄱㅅ'); // false canBeChoseong('ㅏ'); // false canBeChoseong('가'); // false ``` -------------------------------- ### Examples of standardizePronunciation Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/pronunciation/standardizePronunciation.ko.mdx Demonstrates various use cases of the standardizePronunciation function with and without the hardConversion option. ```tsx standardizePronunciation('디귿이'); // '디그시' standardizePronunciation('굳이'); // '구지' standardizePronunciation('담요'); // '담뇨' standardizePronunciation('침략'); // '침냑' standardizePronunciation('먹는'); // '멍는' standardizePronunciation('신라'); // '실라' standardizePronunciation('놓고'); // '노코' standardizePronunciation('곧이듣다'); // '고지듣따' standardizePronunciation('곧이듣다', { hardConversion: false }); // '고지듣다' standardizePronunciation('닦다'); // '닥따' standardizePronunciation('닦다', { hardConversion: false }); // '닥다' standardizePronunciation('있다'); // '읻따' standardizePronunciation('있다', { hardConversion: false }); // '읻다' standardizePronunciation('핥다'); // '할따' standardizePronunciation('핥다', { hardConversion: false }); // '할다' standardizePronunciation('젊다'); // '점따' standardizePronunciation('젊다', { hardConversion: false }); // '점다' ``` -------------------------------- ### Try disassembleToGroups Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/disassembleToGroups.ko.mdx An interactive example using Sandpack to demonstrate the disassembleToGroups function with the input '사과'. ```typescript import { disassembleToGroups } from 'es-hangul'; console.log(disassembleToGroups('사과')); ``` -------------------------------- ### 초성 검색 (getChoseong) Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/introduction.ko.mdx 특정 단어에서 초성을 추출하여 검색어의 초성과 일치하는지 확인하는 기능을 제공합니다. 입력값으로 단어와 사용자 입력 초성을 받습니다. ```tsx import { getChoseong } from 'es-hangul'; const searchWord = '라면'; const userInput = 'ㄹㅁ'; const result = getChoseong(searchWord); // ㄹㅁ // 검색어의 초성과 사용자 입력 초성이 일치하는지 확인 if (result === userInput) { something(); } ``` -------------------------------- ### Try removeLastCharacter in Sandpack Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/core/removeLastCharacter.ko.mdx An interactive example using Sandpack to demonstrate the removeLastCharacter function with Korean strings. ```ts import { removeLastCharacter } from 'es-hangul'; console.log(removeLastCharacter('안녕하세요 값')); // '안녕하세요 갑' console.log(removeLastCharacter('프론트엔드')); // '프론트엔ㄷ' ``` -------------------------------- ### Sandpack Demo Source: https://github.com/toss/es-hangul/blob/main/docs/src/pages/docs/api/number/susa.en.mdx A Sandpack component demonstrating the practical application of the susa function by logging converted numbers to the console. ```javascript import { susa } from 'es-hangul'; console.log(susa(1)); console.log(susa(1, true)); ```