Skip to content

Commit

Permalink
fix: update outdated search module
Browse files Browse the repository at this point in the history
  • Loading branch information
WieeRd committed Feb 12, 2024
1 parent c8a36dc commit f93caf2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions ricecake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
:copyright: (c) 2024-present WieeRd
:license: MIT, see LICENSE for more details.
"""

from .search import *
4 changes: 2 additions & 2 deletions ricecake/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ def search_pattern(

elif (
choseong_search
and hg.COMPAT_MODERN_JAUM_BASE <= code <= hg.COMPAT_MODERN_JAUM_END
and hg.MODERN_COMPAT_JAUM_BASE <= code <= hg.MODERN_COMPAT_JAUM_END
):
# compat jamo cannot be 1:1 mapped to jamo or syllable using algorithm
# because jamo separates jongseong-only jaums while compat jamo does not
# instead, consult the lookup table and yield a pattern that matches
# choseong itself, or any syllable that starts with the choseong
offset = ord(c) - hg.COMPAT_MODERN_JAUM_BASE
offset = ord(c) - hg.MODERN_COMPAT_JAUM_BASE
yield _COMPAT_JAMO_CHOSEONG_PATTERN[offset] or c

elif hg.is_jamo(c):
Expand Down

0 comments on commit f93caf2

Please sign in to comment.