From 6f25af85f5d43ad5f7d5632b21f8841bcbb4bfd5 Mon Sep 17 00:00:00 2001 From: chanhyuk-park Date: Fri, 9 Aug 2024 22:49:55 +0900 Subject: [PATCH] combine method docs --- docs/src/pages/docs/api/combine.en.mdx | 71 ++++++++++++++++++++++++++ docs/src/pages/docs/api/combine.ko.mdx | 71 ++++++++++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 docs/src/pages/docs/api/combine.en.mdx create mode 100644 docs/src/pages/docs/api/combine.ko.mdx diff --git a/docs/src/pages/docs/api/combine.en.mdx b/docs/src/pages/docs/api/combine.en.mdx new file mode 100644 index 00000000..b2747cb5 --- /dev/null +++ b/docs/src/pages/docs/api/combine.en.mdx @@ -0,0 +1,71 @@ +--- +title: combine +--- + +import { Sandpack } from '@/components/Sandpack'; + +# combine + +## combineCharacter + +Given inputs of an choseong, jungseong, and jongseong return a single Korean character + +```typescript +function combineCharacter(choseong: string, jungseong: string, jongseong?: string): boolean; +``` + +### Examples + +```typescript +combineCharacter('ㄱ', 'ㅏ', 'ㅂㅅ') // '값' +combineCharacter('ㅌ', 'ㅗ') // '토' +``` + +### Demo + +
+ + + +```ts index.ts +import { combineCharacter } from 'es-hangul'; + +console.log(combineCharacter('ㄱ', 'ㅏ', 'ㅂㅅ')) +console.log(combineCharacter('ㅌ', 'ㅗ')) + +``` + + + + +## combineVowels + +Given two vowel inputs, combine them to create a diphthong. If the vowels cannot be combined according to the correct Korean rules, simply join them together + +```typescript +function combineVowels(vowel1: string, vowel2: string): string +``` + +### Examples + +```typescript +combineVowels('ㅗ', 'ㅏ') // 'ㅘ' +combineVowels('ㅗ', 'ㅐ') // 'ㅙ' +combineVowels('ㅗ', 'ㅛ') // 'ㅗㅛ' +``` + +### Demo + +
+ + + +```ts index.ts +import { combineVowels } from 'es-hangul'; + +console.log(combineVowels('ㅗ', 'ㅏ')) +console.log(combineVowels('ㅗ', 'ㅐ')) +console.log(combineVowels('ㅗ', 'ㅛ')) + +``` + diff --git a/docs/src/pages/docs/api/combine.ko.mdx b/docs/src/pages/docs/api/combine.ko.mdx new file mode 100644 index 00000000..b3fc30a0 --- /dev/null +++ b/docs/src/pages/docs/api/combine.ko.mdx @@ -0,0 +1,71 @@ +--- +title: combine +--- + +import { Sandpack } from '@/components/Sandpack'; + +# combine + +## combineCharacter + +인자로 초성, 중성, 종성을 받아 하나의 한글 문자를 반환합니다. + +```typescript +function combineCharacter(choseong: string, jungseong: string, jongseong?: string): boolean; +``` + +### Examples + +```typescript +combineCharacter('ㄱ', 'ㅏ', 'ㅂㅅ') // '값' +combineCharacter('ㅌ', 'ㅗ') // '토' +``` + +### 사용해보기 + +
+ + + +```ts index.ts +import { combineCharacter } from 'es-hangul'; + +console.log(combineCharacter('ㄱ', 'ㅏ', 'ㅂㅅ')) +console.log(combineCharacter('ㅌ', 'ㅗ')) + +``` + + + + +## combineVowels + +인자로 두 개의 모음을 받아 합성하여 겹모음을 생성합니다. 만약 올바른 한글 규칙으로 합성할 수 없는 모음들이라면 단순 Join합니다. + +```typescript +function combineVowels(vowel1: string, vowel2: string): string +``` + +### Examples + +```typescript +combineVowels('ㅗ', 'ㅏ') // 'ㅘ' +combineVowels('ㅗ', 'ㅐ') // 'ㅙ' +combineVowels('ㅗ', 'ㅛ') // 'ㅗㅛ' +``` + +### 사용해보기 + +
+ + + +```ts index.ts +import { combineVowels } from 'es-hangul'; + +console.log(combineVowels('ㅗ', 'ㅏ')) +console.log(combineVowels('ㅗ', 'ㅐ')) +console.log(combineVowels('ㅗ', 'ㅛ')) + +``` +