get_chosung_string
문자열에서 초성만 추출합니다.keep_spaces 를 생략하면 기본값은 False 이고, 공백을 제거한 초성 문자열을 반환합니다.
예시
keep_spaces=True 를 사용하면 공백 위치를 유지한 채 초성 문자열을 만들 수 있습니다.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
초성 추출과 초성 기반 포함 여부 확인
get_chosung_string(text: str, keep_spaces: bool = False) -> str
keep_spaces 를 생략하면 기본값은 False 이고, 공백을 제거한 초성 문자열을 반환합니다.
from hangulpy import get_chosung_string
print(get_chosung_string("라면")) # ㄹㅁ
print(get_chosung_string("띄어 쓰기")) # ㄸㅇㅆㄱ
print(get_chosung_string("띄어 쓰기", keep_spaces=True)) # ㄸㅇ ㅆㄱ
keep_spaces=True 를 사용하면 공백 위치를 유지한 채 초성 문자열을 만들 수 있습니다.
chosung_includes(word: str, pattern: str) -> bool
chosungIncludes는 v1.5에서 제거됐습니다. 새 코드에서는
chosung_includes를 사용하세요.from hangulpy import chosung_includes
print(chosung_includes("라면", "ㄹㅁ")) # True
print(chosung_includes("사과", "ㅅㄱ")) # True