Skip to content

Commit

Permalink
josa.pick에 대한 문서화를 진행합니다 (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
okinawaa committed May 14, 2024
1 parent 11b6ab7 commit 0d89b06
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 0 deletions.
52 changes: 52 additions & 0 deletions docs/src/pages/docs/api/josa.pick.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: josa.pick
---

# josa.pick

The josa.pick method selects and returns the appropriate Korean particle based on a given Korean string and particle options. This method is used within the [josa](https://es-hangul.slash.page/en/docs/api/josa) function, and the form of the particle is determined by the last character of the string.

```typescript
function josa.pick(
// The Korean string to base the particle selection on
word: string,
// The particle option to select
josa:
| '이/가'
| '을/를'
| '은/는'
| '으로/로'
| '와/과'
| '이나/나'
| '이에/에'
| '이란/란'
| '아/야'
| '이랑/랑'
| '이에요/예요'
| '으로서/로서'
| '으로써/로써'
| '으로부터/로부터'
): string;
```

`word`: The Korean string to attach the particle to.<br/>
`josa`: Specifies the particle to be attached. You can choose one of the options like '이/가', '을/를', '은/는', '으로/로', '와/과', '이나/나', '이에/에', '이란/란', '아/야', '이랑/랑', '이에요/예요', '으로서/로서', '으로써/로써', '으로부터/로부터'.

## Behavior

`josa.pick` selects the appropriate particle based on whether the last character of the given string has a final consonant and specific conditions (e.g., use of the particle '로').

It follows these rules (exceptions may apply):

- If the last character of the string has a final consonant, typically the first particle option is used (e.g., for '이/가', '이' is used).
- If there is no final consonant, the second particle option is used (e.g., for '이/가', '가' is used).
- In special cases, such as when the final consonant is 'ㄹ', different rules may apply when using particles like '로'.

## Examples

```typescript
josa.pick('샴푸', '이/가'); // '가'
josa.pick('칫솔', '이/가'); // '이'
josa.pick('바깥', '으로/로'); // '으로'
josa.pick('내부', '으로/로'); // '로'
```
52 changes: 52 additions & 0 deletions docs/src/pages/docs/api/josa.pick.ko.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: josa.pick
---

# josa.pick

`josa.pick` 메서드는 주어진 한글 문자열과 조사 옵션에 따라 적절한 조사를 선택하여 반환합니다. 이 메서드는 [josa](https://es-hangul.slash.page/docs/api/josa) 함수 내에서 사용되며, 문자열의 마지막 글자에 따라 조사의 형태가 결정됩니다.

```typescript
function josa.pick(
// 조사를 선택할 기준 한글 문자열
word: string,
// 선택하려는 조사 옵션
josa:
| '이/가'
| '을/를'
| '은/는'
| '으로/로'
| '와/과'
| '이나/나'
| '이에/에'
| '이란/란'
| '아/야'
| '이랑/랑'
| '이에요/예요'
| '으로서/로서'
| '으로써/로써'
| '으로부터/로부터'
): string;
```

`word`: 조사를 붙일 한글 문자열입니다.<br/>
`josa`: 붙일 조사를 지정합니다. 이는 '이/가', '을/를', '은/는', '으로/로', '와/과', '이나/나', '이에/에', '이란/란', '아/야', '이랑/랑', '이에요/예요', '으로서/로서', '으로써/로써', '으로부터/로부터'와 같은 옵션들 중 하나를 선택할 수 있습니다.

## Behavior

josa.pick은 주어진 문자열의 마지막 글자가 받침이 있는지, 그리고 특정 조건(예: '로'와 같은 조사 사용시)을 기반으로 적절한 조사를 선택합니다.

특히 다음과 같은 규칙을 따릅니다(예외도 존재합니다)

- 문자열의 마지막 글자에 받침이 있으면 보통 첫 번째 조사를 사용합니다 (예: '이/가'의 경우 '이').
- 받침이 없는 경우 두 번째 조사를 사용합니다 (예: '이/가'의 경우 '가').
- 특별한 경우, 예를 들어 'ㄹ' 받침이 있는 경우 '로' 조사를 사용할 때 조건에 따라 다르게 적용될 수 있습니다.

## Examples

```typescript
josa.pick('샴푸', '이/가'); // '가'
josa.pick('칫솔', '이/가'); // '이'
josa.pick('바깥', '으로/로'); // '으로'
josa.pick('내부', '으로/로'); // '로'
```

0 comments on commit 0d89b06

Please sign in to comment.