Skip to content

Commit

Permalink
expansion(kRSGeneric): Fix double apostrophe (non-apostrophe, simplif…
Browse files Browse the repository at this point in the history
…ied radical)

via https://www.unicode.org/reports/tr38/#kRSUnicode:

> The standard radical-stroke count for this ideograph in the form “radical.additional strokes.” The radical is indicated by a number in the range 1–214, followed by an optional single apostrophe (U+0027 ' apostrophe) or double apostrophe ('') suffix. A single apostrophe after the radical indicates a Chinese simplified version of the given radical. Two apostrophes after the radical indicates a non-Chinese simplified version of the given radical. The “additional strokes” value is the residual stroke-count, the count of all strokes remaining after eliminating all strokes associated with the radical.
  • Loading branch information
tony committed Dec 10, 2023
1 parent f4f9f16 commit 95a80fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/unihan_etl/expansion.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ def _expand_kRSGeneric(value: t.List[str]) -> t.List[kRSGenericDict]:
pattern = re.compile(
r"""
(?P<radical>[1-9][0-9]{0,2})
(?P<simplified>\'?)\.
(?P<simplified>\'{0,2})\.
(?P<strokes>-?[0-9]{1,2})
""",
re.X,
Expand Down

0 comments on commit 95a80fd

Please sign in to comment.