Skip to content

Commit

Permalink
CheckProperties handle multiple Unihan numeric values
Browse files Browse the repository at this point in the history
  • Loading branch information
markusicu committed Sep 19, 2023
1 parent 05d18a1 commit 2e9af22
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public UnicodeMap<Double> loadDouble(UcdProperty prop2) {
if (prop2 == UcdProperty.kPrimaryNumeric
|| prop2 == UcdProperty.kAccountingNumeric
|| prop2 == UcdProperty.kOtherNumeric) {
// Unicode 15.1: A character may have multiple numeric values.
// Unicode 15.1+: A character may have multiple Unihan numeric values.
pos = v.indexOf(' ');
if (pos >= 0) {
v = value.substring(0, pos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@

public class CheckProperties {
private static final boolean VERBOSE = true;
private static final String LAST_RELEASE = Utility.searchPath[0];
;

private static final String JUNK = Settings.UnicodeTools.UCD_DIR; // force load

private static final int DEBUG_CODE_POINT = 0x0600;
Expand Down Expand Up @@ -129,7 +128,7 @@ public static void main(String[] args) throws Exception {
extent = Extent.ALL;
}
if (version == null) {
version = LAST_RELEASE;
version = Settings.lastVersion;
}

final Timer total = new Timer();
Expand Down Expand Up @@ -856,6 +855,11 @@ private static Double numericValue(String a) {
return Double.parseDouble(a.substring(0, slashPos))
/ Double.parseDouble(a.substring(slashPos + 1));
}
// Unicode 15.1+: A character may have multiple Unihan numeric values.
int pos = a.indexOf(' ');
if (pos >= 0) {
a = a.substring(0, pos);
}
return Double.parseDouble(a);
}

Expand Down

0 comments on commit 2e9af22

Please sign in to comment.