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

# 키보드 변환과 오타 교정

> 한영 키보드 입력 변환과 오타 교정

## koen

한글 입력을 영문 키 시퀀스로 변환합니다.

```python theme={null}
koen(text: str) -> str
```

## enko

영문 키 시퀀스를 한글 입력으로 조합합니다.

```python theme={null}
enko(text: str, allowDoubleConsonant: bool = False) -> str
```

`allowDoubleConsonant` 를 생략하면 기본값은 `False` 이고, 두 개의 초성을 자동으로 쌍자음으로 합치지 않습니다.

## autofix

한글과 영문이 뒤바뀐 입력을 자동 보정합니다.

```python theme={null}
autofix(text: str, allowDoubleConsonant: bool = False) -> str
```

`allowDoubleConsonant` 를 생략하면 기본값은 `False` 이고, 쌍자음 후보를 보수적으로 처리합니다.

## convert\_hangul\_to\_qwerty

한글을 QWERTY 자판 입력 문자열로 변환합니다. `koen` 과 같은 동작입니다.

```python theme={null}
convert_hangul_to_qwerty(text: str) -> str
```

## convert\_qwerty\_to\_hangul

QWERTY 자판 입력을 한글로 조합합니다. 영문 대소문자와 이미 섞여 있는 한글 자모를 함께 처리합니다.

```python theme={null}
convert_qwerty_to_hangul(text: str, allowDoubleConsonant: bool = False) -> str
```

## convert\_qwerty\_to\_alphabet

QWERTY 자판 입력을 조합하지 않고 한글 자모로 변환합니다.

```python theme={null}
convert_qwerty_to_alphabet(text: str) -> str
```

## 예시

```python theme={null}
from hangulpy import (
    autofix,
    convert_hangul_to_qwerty,
    convert_qwerty_to_alphabet,
    convert_qwerty_to_hangul,
    enko,
    koen,
)

print(koen("한글"))  # gksrmf
print(enko("gksrmf"))  # 한글
print(enko("rrk"))  # ㄱ가
print(enko("rrk", allowDoubleConsonant=True))  # 까
print(autofix("gksrmf"))  # 한글
print(autofix("rrk"))  # ㄱ가
print(autofix("rrk", allowDoubleConsonant=True))  # 까

print(convert_hangul_to_qwerty("뮻"))  # abc
print(convert_qwerty_to_hangul("ABC"))  # 뮻
print(convert_qwerty_to_hangul("RㅏㄱEㅜrl"))  # 깍뚜기
print(convert_qwerty_to_alphabet("abc"))  # ㅁㅠㅊ
```

## 같이 보기

* [romanize / Romanizer](romanize)
