Skip to content

Commit

Permalink
combine method docs
Browse files Browse the repository at this point in the history
  • Loading branch information
okinawaa committed Aug 9, 2024
1 parent 08adfc9 commit 6f25af8
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): boolean;
```

### 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

인자로 초성, 중성, 종성을 받아 하나의 한글 문자를 반환합니다.

```typescript
function combineCharacter(choseong: string, jungseong: string, jongseong?: string): boolean;
```

### 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 6f25af8

Please sign in to comment.