Skip to content

Commit

Permalink
Fixup script
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Sep 19, 2023
1 parent a859939 commit 30e33bd
Show file tree
Hide file tree
Showing 2 changed files with 421 additions and 269 deletions.
4 changes: 2 additions & 2 deletions scripts/unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ def load_east_asian_widths() -> "list[EffectiveWidth]":
`Ambiguous` chracters are assigned `EffectiveWidth.AMBIGUOUS`."""
with fetch_open("EastAsianWidth.txt") as eaw:
# matches a width assignment for a single codepoint, i.e. "1F336;N # ..."
single = re.compile(r"^([0-9A-F]+);(\w+) +# (\w+)")
single = re.compile(r"^([0-9A-F]+)\s+;\s+(\w+) +# (\w+)")
# matches a width assignment for a range of codepoints, i.e. "3001..3003;W # ..."
multiple = re.compile(r"^([0-9A-F]+)\.\.([0-9A-F]+);(\w+) +# (\w+)")
multiple = re.compile(r"^([0-9A-F]+)\.\.([0-9A-F]+)\s+;\s+(\w+) +# (\w+)")
# map between width category code and condensed width
width_codes = {
**{c: EffectiveWidth.NARROW for c in ["N", "Na", "H"]},
Expand Down
Loading

0 comments on commit 30e33bd

Please sign in to comment.