Skip to content

Commit

Permalink
chore: note tasks and predefine function signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
WieeRd committed Feb 5, 2024
1 parent 304ccb7 commit c4110c7
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions mklookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# FIX: moum to jungseong can be 1:1 mapped; it does not need a lookup table


def jamo_to_compat_jamo(jamo: str, /) -> str | None:
"""Maps a Jamo character to a Compatibility Jamo character."""
name = ud.name(jamo).split(" ")[-1] # HANGUL CHOSEONG "KIYEOK"
Expand Down
20 changes: 20 additions & 0 deletions ricecake/hangul/compose.py
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
"""(De)composition of Hangul Jamo and Syllable."""


def compose(cho: str, jung: str, jong: str | None) -> str:
"""Composes Choseong, Jungseong, and Jongseong into a Syllable."""
...

Check failure on line 6 in ricecake/hangul/compose.py

View workflow job for this annotation

GitHub Actions / Ruff

Ruff (PIE790)

ricecake/hangul/compose.py:6:5: PIE790 Unnecessary `...` literal


def decompose(syl: str) -> tuple[str, str, str | None]:
"""Decomposes a Syllable into Choseong, Jungseong, and Jongseong."""
...

Check failure on line 11 in ricecake/hangul/compose.py

View workflow job for this annotation

GitHub Actions / Ruff

Ruff (PIE790)

ricecake/hangul/compose.py:11:5: PIE790 Unnecessary `...` literal


# FEAT: decompose composite Jaum and Moum into tuple of str
# |
# | - [ ] There are 5 cases, cho/jung/jong and compat jaum/moum.
# | Which should be included and which should be not?
# |
# | - [ ] Should it be keyboard-based or shape-based?
# | "ㅐ" is "ㅏ" + "ㅣ" but it can be typed at once with a keyboard.
# | If so, should "ㅙ" be decomposed to ("ㅗ", "ㅐ") or ("ㅗ", "ㅏ", "ㅣ")?
20 changes: 20 additions & 0 deletions ricecake/hangul/convert.py
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
"""Conversion between Hangul Jamo and Compatibility Jamo."""


def jamo_to_compat_jamo(c: str, /) -> str | None:
"""Maps a Jamo character to a Compatibility Jamo character."""
...

Check failure on line 6 in ricecake/hangul/convert.py

View workflow job for this annotation

GitHub Actions / Ruff

Ruff (PIE790)

ricecake/hangul/convert.py:6:5: PIE790 Unnecessary `...` literal


def compat_jaum_to_choseong(c: str, /) -> str | None:
"""Maps a Compatibility Jaum character to a Jamo Choseong character."""
...

Check failure on line 11 in ricecake/hangul/convert.py

View workflow job for this annotation

GitHub Actions / Ruff

Ruff (PIE790)

ricecake/hangul/convert.py:11:5: PIE790 Unnecessary `...` literal


def compat_moum_to_jungseong(c: str, /) -> str:
"""Maps a Compatibility Moum character to a Jamo Jungseong character."""
...

Check failure on line 16 in ricecake/hangul/convert.py

View workflow job for this annotation

GitHub Actions / Ruff

Ruff (PIE790)

ricecake/hangul/convert.py:16:5: PIE790 Unnecessary `...` literal


def compat_jaum_to_jongseong(c: str, /) -> str:
"""Maps a Compatibility Jaum character to a Jamo Jongseong character."""
...

Check failure on line 21 in ricecake/hangul/convert.py

View workflow job for this annotation

GitHub Actions / Ruff

Ruff (PIE790)

ricecake/hangul/convert.py:21:5: PIE790 Unnecessary `...` literal
1 change: 1 addition & 0 deletions ricecake/hangul/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
JONGSEONG_COEF = 1


# FIX: MAYBE: MODERN_{kind} vs {kind}_MODERN
# https://en.wikipedia.org/wiki/Hangul_Jamo_(Unicode_block)
JAMO_BASE = 0x1100 # 'ᄀ'
JAMO_END = 0x11FF # 'ᇿ'
Expand Down

0 comments on commit c4110c7

Please sign in to comment.