> ## Documentation Index
> Fetch the complete documentation index at: https://hangulpy.uiharu.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 받침 판별 (has_jongsung, has_batchim, ends_with_consonant)

> 문자열의 마지막 한글 음절 받침과 자음 끝 여부 확인

## has\_jongsung / has\_batchim

문자열의 마지막 유효 한글 음절에 받침이 있는지 확인합니다. `has_batchim`은 `has_jongsung`과 같은 동작을 하는 별칭입니다.

```python theme={null}
has_jongsung(text: str, only: "single" | "double" | None = None) -> bool
has_batchim(text: str, only: "single" | "double" | None = None) -> bool
```

`only="single"`은 홑받침만, `only="double"`은 겹받침만 확인합니다.

### 예시

```python theme={null}
from hangulpy import has_batchim, has_jongsung

print(has_jongsung("각"))  # True
print(has_jongsung("가"))  # False
print(has_jongsung("책!"))  # True
print(has_batchim("값", only="double"))  # True
print(has_batchim("각", only="single"))  # True
```

## ends\_with\_consonant

음절뿐 아니라 자모 입력까지 포함해서 자음으로 끝나는지 확인합니다.

```python theme={null}
ends_with_consonant(char: str) -> bool
```

### 예시

```python theme={null}
from hangulpy import ends_with_consonant

print(ends_with_consonant("각"))  # True
print(ends_with_consonant("가"))  # False
print(ends_with_consonant("ㄱ"))  # True
```

## 차이점

* `has_jongsung` 과 `has_batchim` 은 문자열의 마지막 유효 한글 음절을 기준으로 받침을 확인합니다.
* `ends_with_consonant` 는 자모 입력까지 함께 다룰 때 편합니다.

## 같이 보기

* [josa](josa)
