Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: 문서에서 사용해볼 수 있는 데모 추가 #210

Merged
merged 17 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/fluffy-mirrors-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'docs': patch
---

docs: 문서에서 사용해볼 수 있는 데모를 추가합니다.
(amountToHangul, disassemble, disassembleToGroups, getChoseong, hasBatchim, romanize, standardizePronunciation, susa)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: amountToHangul
---

import { Sandpack } from '@/components/Sandpack';

# amountToHangul

Converts numeric amounts to the Korean reading of the [National Institute of Korean Language](https://ko.dict.naver.com/#/correct/korean/info?seq=602) rules.
Expand All @@ -20,3 +22,17 @@ amountToHangul('120,030원'); // '일십이만삼십'
amountToHangul('12345.6789'); // '일만이천삼백사십오점육칠팔구'
amountToHangul(15_201_100); // '일천오백이십만천백''
```

## Demo

<br />

<Sandpack>

```ts index.ts
import { amountToHangul } from 'es-hangul';

console.log(amountToHangul('15,201,100'));
```

</Sandpack>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: amountToHangul
---

import { Sandpack } from '@/components/Sandpack';

# amountToHangul

숫자나 문자를 [국립국어원](https://ko.dict.naver.com/#/correct/korean/info?seq=602) 규칙의 한글 읽기 문자열로 변환합니다.
Expand All @@ -20,3 +22,17 @@ amountToHangul('120,030원'); // '일십이만삼십'
amountToHangul('12345.6789'); // '일만이천삼백사십오점육칠팔구'
amountToHangul(15_201_100); // '일천오백이십만천백''
```

## 사용해보기

<br />

<Sandpack>

```ts index.ts
import { amountToHangul } from 'es-hangul';

console.log(amountToHangul('15,201,100'));
```

</Sandpack>
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@
title: canBe
---

# canBeChoseong
import { Sandpack } from '@/components/Sandpack';

# canBe

## canBeChoseong

Check if a given character can be a choseong in Korean.

```typescript
function canBeChoseong(character: string): boolean;
```

### Examples

```typescript
canBeChoseong('ㄱ'); // true
canBeChoseong('ㅃ'); // true
Expand All @@ -18,14 +24,30 @@ canBeChoseong('ㅏ'); // false
canBeChoseong('가'); // false
```

# canBeJungseong
### Demo

<br />

<Sandpack>

```ts index.ts
import { canBeChoseong } from 'es-hangul';

console.log(canBeChoseong('ㄱ'));
```

</Sandpack>

## canBeJungseong

Check if a given character can be a jungseong in Korean.

```typescript
function canBeJungseong(character: string): boolean;
```

### Examples

```typescript
canBeJungseong('ㅏ'); // true
canBeJungseong('ㅗㅏ'); // true
Expand All @@ -35,14 +57,30 @@ canBeJungseong('ㄱㅅ'); // false
canBeJungseong('가'); // false
```

# canBeJongseong
### Demo

<br />

<Sandpack>

```ts index.ts
import { canBeJungseong } from 'es-hangul';

console.log(canBeJungseong('ㅏ'));
```

</Sandpack>

## canBeJongseong

Check if a given character can be a jongseong in Korean.

```typescript
function canBeJongseong(character: string): boolean;
```

### Examples

```typescript
canBeJongseong('ㄱ'); // true
canBeJongseong('ㄱㅅ'); // true
Expand All @@ -51,3 +89,17 @@ canBeJongseong('가'); // false
canBeJongseong('ㅏ'); // false
canBeJongseong('ㅗㅏ'); // false
```

### Demo

<br />

<Sandpack>

```ts index.ts
import { canBeJongseong } from 'es-hangul';

console.log(canBeJongseong('ㄱ'));
```

</Sandpack>
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@
title: canBe
---

# canBeChoseong
import { Sandpack } from '@/components/Sandpack';

# canBe

## canBeChoseong

인자로 받은 문자가 초성으로 위치할 수 있는 문자인지 검사합니다.

```typescript
function canBeChoseong(character: string): boolean;
```

### Examples

```typescript
canBeChoseong('ㄱ'); // true
canBeChoseong('ㅃ'); // true
Expand All @@ -18,14 +24,30 @@ canBeChoseong('ㅏ'); // false
canBeChoseong('가'); // false
```

# canBeJungseong
### 사용해보기

<br />

<Sandpack>

```ts index.ts
import { canBeJungseong } from 'es-hangul';

console.log(canBeJungseong('ㅏ'));
```

</Sandpack>

## canBeJungseong

인자로 받은 문자가 중성으로 위치할 수 있는 문자인지 검사합니다.

```typescript
function canBeJungseong(character: string): boolean;
```

### Examples

```typescript
canBeJungseong('ㅏ'); // true
canBeJungseong('ㅗㅏ'); // true
Expand All @@ -35,14 +57,30 @@ canBeJungseong('ㄱㅅ'); // false
canBeJungseong('가'); // false
```

# canBeJongseong
### 사용해보기

<br />

<Sandpack>

```ts index.ts
import { canBeJungseong } from 'es-hangul';

console.log(canBeJungseong('ㅏ'));
```

</Sandpack>

## canBeJongseong

인자로 받은 문자가 종성으로 위치할 수 있는 문자인지 검사합니다.

```typescript
function canBeJongseong(character: string): boolean;
```

### Examples

```typescript
canBeJongseong('ㄱ'); // true
canBeJongseong('ㄱㅅ'); // true
Expand All @@ -51,3 +89,17 @@ canBeJongseong('가'); // false
canBeJongseong('ㅏ'); // false
canBeJongseong('ㅗㅏ'); // false
```

### 사용해보기

<br />

<Sandpack>

```ts index.ts
import { canBeJongseong } from 'es-hangul';

console.log(canBeJongseong('ㄱ'));
```

</Sandpack>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: disassemble
---

import { Sandpack } from '@/components/Sandpack';

# disassemble

Completely separates a Hangul string into its individual characters by initial consonants, medial vowels, and final consonants, creating a single string.
Expand All @@ -23,3 +25,17 @@ disassemble('값이 비싸다'); // 'ㄱㅏㅂㅅㅇㅣ ㅂㅣㅆㅏㄷㅏ'
disassemble('ㅘ'); // 'ㅗㅏ'
disassemble('ㄵ'); // 'ㄴㅈ'
```

## Demo

<br />

<Sandpack>

```ts index.ts
import { disassemble } from 'es-hangul';

console.log(disassemble('값'));
```

</Sandpack>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: disassemble
---

import { Sandpack } from '@/components/Sandpack';

# disassemble

한글 문자열을 글자별로 초성/중성/종성 단위로 완전히 분리하여, 하나의 문자열로 만듭니다.
Expand All @@ -23,3 +25,17 @@ disassemble('값이 비싸다'); // 'ㄱㅏㅂㅅㅇㅣ ㅂㅣㅆㅏㄷㅏ'
disassemble('ㅘ'); // 'ㅗㅏ'
disassemble('ㄵ'); // 'ㄴㅈ'
```

## 사용해보기

<br />

<Sandpack>

```ts index.ts
import { disassemble } from 'es-hangul';

console.log(disassemble('값'));
```

</Sandpack>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: disassembleToGroups
---

import { Sandpack } from '@/components/Sandpack';

# disassembleToGroups

Completely separate a Hangul string into individual characters based on the initial consonant, medial vowel, and final consonant.
Expand All @@ -24,3 +26,17 @@ disassembleToGroups('사과'); // [['ㅅ', 'ㅏ'], ['ㄱ', 'ㅗ', 'ㅏ']]
disassembleToGroups('ㅘ'); // [['ㅗ', 'ㅏ']]
disassembleToGroups('ㄵ'); // [['ㄴ', 'ㅈ']]
```

## Demo

<br />

<Sandpack>

```ts index.ts
import { disassembleToGroups } from 'es-hangul';

console.log(disassembleToGroups('사과'));
```

</Sandpack>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: disassembleToGroups
---

import { Sandpack } from '@/components/Sandpack';

# disassembleToGroups

한글 문자열을 글자별로 초성/중성/종성 단위로 완전히 분리합니다.
Expand All @@ -24,3 +26,17 @@ disassembleToGroups('사과'); // [['ㅅ', 'ㅏ'], ['ㄱ', 'ㅗ', 'ㅏ']]
disassembleToGroups('ㅘ'); // [['ㅗ', 'ㅏ']]
disassembleToGroups('ㄵ'); // [['ㄴ', 'ㅈ']]
```

## 사용해보기

<br />

<Sandpack>

```ts index.ts
import { disassembleToGroups } from 'es-hangul';

console.log(disassembleToGroups('사과'));
```

</Sandpack>
Loading