Skip to content

Commit 9d7116a

Browse files
committed
Stir the spaghetti logic and comment it a tiny bit
1 parent c46a844 commit 9d7116a

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

unicodetools/src/main/java/org/unicode/props/PropertyParsingInfo.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,6 +1891,8 @@ private static void setDefaultValueForPropertyName(
18911891

18921892
static void init() {
18931893
final Matcher semicolon = SEMICOLON.matcher("");
1894+
// Populate property2PropertyInfo, first from the index, then from our split Unihan
1895+
// implicitly.
18941896
for (final String line :
18951897
FileUtilities.in(IndexUnicodeProperties.class, "IndexUnicodeProperties.txt")) {
18961898
if (line.startsWith("#") || line.isEmpty()) {
@@ -1906,6 +1908,17 @@ static void init() {
19061908
fromStrings(parts);
19071909
}
19081910
}
1911+
1912+
// Starting with Unicode 13, we preprocess the Unihan data using the
1913+
// <Unicode Tools>/py/splitunihan.py script.
1914+
// It parses the small number of large, multi-property Unihan*.txt files
1915+
// and writes many smaller, single-property files like kTotalStrokes.txt.
1916+
for (UcdProperty prop : UcdProperty.values()) {
1917+
if (prop.getShortName().startsWith("cjk")) {
1918+
fromUnihanProperty(prop);
1919+
}
1920+
}
1921+
19091922
// DO THESE FIRST (overrides values in files!)
19101923
parseMissingFromValueAliases(
19111924
FileUtilities.in(IndexUnicodeProperties.class, "ExtraPropertyAliases.txt"));
@@ -1941,16 +1954,6 @@ static void init() {
19411954
// if (property2PropertyInfo.containsKey(x.toString())) continue;
19421955
// if (SHOW_PROP_INFO) System.out.println("Missing: " + x);
19431956
// }
1944-
1945-
// Starting with Unicode 13, we preprocess the Unihan data using the
1946-
// <Unicode Tools>/py/splitunihan.py script.
1947-
// It parses the small number of large, multi-property Unihan*.txt files
1948-
// and writes many smaller, single-property files like kTotalStrokes.txt.
1949-
for (UcdProperty prop : UcdProperty.values()) {
1950-
if (prop.getShortName().startsWith("cjk")) {
1951-
fromUnihanProperty(prop);
1952-
}
1953-
}
19541957
}
19551958

19561959
private static void parseMissingFromValueAliases(Iterable<String> aliasesLines) {

0 commit comments

Comments
 (0)