Skip to content

Commit

Permalink
Invariants for Equivalent_Unified_Ideograph (#673)
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin authored Jan 31, 2024
1 parent 202077c commit 95a988a
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,18 @@ Let $ideohack = [〆 〇 〡-〩]
# TODO(macchiati): The kHanyuPinyin UnicodeSet is excruciatingly slow.
# \p{kHanyuPinyin=/./} - \p{kMandarin=/./} = [\{228F5}\x{2574C}]

Let $strokesAndRadicals = [\p{Name=/^CJK STROKE /}\p{Name=/^(CJK|KANGXI) RADICAL /}]-\p{gc=Cn}
Let $nonIdeographicRadicals = \N{CJK RADICAL REPEAT}
# The following set may expand over time, if strokes are added.
# It can also shrink, if single-stroke ideographs are encoded.
Let $nonIdeographicStrokes = \p{Name=/^CJK STROKE (T|WG|XG|BXG|SW|HZZ|HP|HZWG|SZWG|HZT|HZZP|HPWG|HZW|HZZZ|PG|Q|HZXG|SZP)$/}

\p{Equivalent_Unified_Ideograph=/./} ⊆ $strokesAndRadicals
[$strokesAndRadicals - \p{Equivalent_Unified_Ideograph=/./}] = [$nonIdeographicStrokes $nonIdeographicRadicals]
# TODO(egg): NFC_Quick_Check is a stupid way to get a Yes here; we are checking
# that Equivalent_Unified_Ideograph values are single unified ideographs.
In \p{Equivalent_Unified_Ideograph=/./} Unified_Ideograph * Equivalent_Unified_Ideograph = NFC_Quick_Check

# InPC-InSC-gc invariants
# See https://www.unicode.org/L2/L2023/23200-category-invariants.pdf.
\p{InPC=/(Left|Right)/} ⊆ [\p{gc=Mc}\p{gc=Lo}\p{gc=Lm}]
Expand Down

0 comments on commit 95a988a

Please sign in to comment.