Skip to content

Commit

Permalink
Update to Unicode 12.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed May 26, 2019
1 parent c2732d2 commit eb156d5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: python
python: "3.6"
install:
- wget ftp://ftp.unicode.org/Public/11.0.0/ucd/Unihan-11.0.0d2.zip
- unzip -d Unihan Unihan-*.zip
- wget ftp://ftp.unicode.org/Public/12.1.0/ucd/Unihan.zip
- unzip -d Unihan Unihan*.zip
script:
- '[[ "$TRAVIS_TAG" = "" ]] || grep "$TRAVIS_TAG" README.md'
- '[[ "$TRAVIS_TAG" = "" ]] || grep "${TRAVIS_TAG%-[0-9]*}" .travis.yml'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To download JSON data files, see the [latest release]. To load them from a web
page through XHR or `window.fetch()` function, request the following URI
(replace `<PROP>` with a property name, e.g., `kSimplifiedVariant`):

https://dahlia.github.io/unihan-json/11.0.0d2-0/<PROP>.json
https://dahlia.github.io/unihan-json/12.1.0/<PROP>.json

Each JSON file corresponds to a property, and is an object which represents
a table from Unicode characters to values for the property. For example,
Expand Down
11 changes: 9 additions & 2 deletions process.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def parse_ints(entries: str) -> List[int]:
'kOtherNumeric': int,
'kPrimaryNumeric': int,
'kSimplifiedVariant': parse_unicode_points,
'kTaiwanTelegraph': int,
'kTaiwanTelegraph': parse_ints,
'kTang': str.split,
'kTotalStrokes': parse_ints,
'kTraditionalVariant': parse_unicode_points,
Expand Down Expand Up @@ -149,7 +149,14 @@ def flush(self) -> Iterator[Tuple[str, pathlib.Path]]:
except ValueError as e:
raise ValueError(f'{e}: {line!r}')
char = parse_unicode_point(code)
parsed_value = parse_value(value)
try:
parsed_value = parse_value(value)
except Exception as e:
self.logger.exception(
'Failed to parse %s property (%r): %s',
prop, value, e
)
raise
if first:
wf('\n')
first = False
Expand Down

0 comments on commit eb156d5

Please sign in to comment.