Skip to content

Commit

Permalink
docs: combineCharacter, combineVowels 에 대한 문서화를 진행합니다 (#229)
Browse files Browse the repository at this point in the history
* 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
okinawaa and manudeli committed Aug 16, 2024
1 parent 2c3c981 commit 32fc3f0
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 0 deletions.
71 changes: 71 additions & 0 deletions docs/src/pages/docs/api/combine.en.mdx
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>
71 changes: 71 additions & 0 deletions docs/src/pages/docs/api/combine.ko.mdx
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>

0 comments on commit 32fc3f0

Please sign in to comment.