hangul_contains 는 입력을 자모 단위로 분해해 비교합니다. 그래서 초성 검색과 부분 음절 검색을 같은 함수로 처리할 수 있습니다.
not_allow_empty를 생략하면 기본값은 False이고, 빈 문자열 패턴을 허용합니다.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
초성, 부분 음절, 완성형 패턴 포함 여부 확인
hangul_contains 는 입력을 자모 단위로 분해해 비교합니다. 그래서 초성 검색과 부분 음절 검색을 같은 함수로 처리할 수 있습니다.
hangul_contains(word: str, pattern: str, not_allow_empty: bool = False) -> bool
not_allow_empty를 생략하면 기본값은 False이고, 빈 문자열 패턴을 허용합니다.
notallowempty 이름은 v1.5에서 제거됐습니다. not_allow_empty로
마이그레이션하세요.from hangulpy import hangul_contains
print(hangul_contains("사과", "ㅅ")) # True
print(hangul_contains("사과", "삭")) # True
print(hangul_contains("사과", "ㅅㄱ")) # True
print(hangul_contains("사과", "삽")) # False
from hangulpy import hangul_contains
print(hangul_contains("사과", "")) # True
print(hangul_contains("사과", "", not_allow_empty=True)) # False