-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: combineCharacter, combineVowels 에 대한 문서화를 진행합니다 (#229)
* combine method docs * Update docs/src/pages/docs/api/combine.ko.mdx Co-authored-by: Jonghyeon Ko <[email protected]> * Update docs/src/pages/docs/api/combine.en.mdx Co-authored-by: Jonghyeon Ko <[email protected]> * Update docs/src/pages/docs/api/combine.ko.mdx Co-authored-by: Jonghyeon Ko <[email protected]> --------- Co-authored-by: Jonghyeon Ko <[email protected]>
- Loading branch information
Showing
2 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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): string; | ||
``` | ||
|
||
### Examples | ||
|
||
```typescript | ||
combineCharacter('ㄱ', 'ㅏ', 'ㅂㅅ') // '값' | ||
combineCharacter('ㅌ', 'ㅗ') // '토' | ||
``` | ||
|
||
### Demo | ||
|
||
<br /> | ||
|
||
<Sandpack> | ||
|
||
```ts index.ts | ||
import { combineCharacter } from 'es-hangul'; | ||
|
||
console.log(combineCharacter('ㄱ', 'ㅏ', 'ㅂㅅ')) | ||
console.log(combineCharacter('ㅌ', 'ㅗ')) | ||
|
||
``` | ||
|
||
</Sandpack> | ||
|
||
|
||
## 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 | ||
|
||
<br /> | ||
|
||
<Sandpack> | ||
|
||
```ts index.ts | ||
import { combineVowels } from 'es-hangul'; | ||
console.log(combineVowels('ㅗ', 'ㅏ')) | ||
console.log(combineVowels('ㅗ', 'ㅐ')) | ||
console.log(combineVowels('ㅗ', 'ㅛ')) | ||
``` | ||
</Sandpack> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
title: combine | ||
--- | ||
|
||
import { Sandpack } from '@/components/Sandpack'; | ||
|
||
# combine | ||
|
||
## combineCharacter | ||
|
||
인자로 받은 초성, 중성, 종성을 조합해 한글 1자를 반환합니다. | ||
|
||
```typescript | ||
function combineCharacter(choseong: string, jungseong: string, jongseong?: string): string; | ||
``` | ||
|
||
### Examples | ||
|
||
```typescript | ||
combineCharacter('ㄱ', 'ㅏ', 'ㅂㅅ') // '값' | ||
combineCharacter('ㅌ', 'ㅗ') // '토' | ||
``` | ||
|
||
### 사용해보기 | ||
|
||
<br /> | ||
|
||
<Sandpack> | ||
|
||
```ts index.ts | ||
import { combineCharacter } from 'es-hangul'; | ||
|
||
console.log(combineCharacter('ㄱ', 'ㅏ', 'ㅂㅅ')) | ||
console.log(combineCharacter('ㅌ', 'ㅗ')) | ||
|
||
``` | ||
|
||
</Sandpack> | ||
|
||
|
||
## combineVowels | ||
|
||
인자로 두 개의 모음을 받아 합성하여 겹모음을 생성합니다. 만약 올바른 한글 규칙으로 합성할 수 없는 모음들이라면 단순 Join합니다. | ||
|
||
```typescript | ||
function combineVowels(vowel1: string, vowel2: string): string | ||
``` | ||
|
||
### Examples | ||
|
||
```typescript | ||
combineVowels('ㅗ', 'ㅏ') // 'ㅘ' | ||
combineVowels('ㅗ', 'ㅐ') // 'ㅙ' | ||
combineVowels('ㅗ', 'ㅛ') // 'ㅗㅛ' | ||
``` | ||
|
||
### 사용해보기 | ||
|
||
<br /> | ||
|
||
<Sandpack> | ||
|
||
```ts index.ts | ||
import { combineVowels } from 'es-hangul'; | ||
console.log(combineVowels('ㅗ', 'ㅏ')) | ||
console.log(combineVowels('ㅗ', 'ㅐ')) | ||
console.log(combineVowels('ㅗ', 'ㅛ')) | ||
``` | ||
</Sandpack> |