Skip to content

Commit ec0e6ef

Browse files
authored
NamesList in IUP, drop the outdated JSP copy of NamesList.txt (#1128)
* NamesList in IUP * Remove the hacky subhead and the copy of NamesList which was stuck at 15.1 * missing * Always ignore the names list in propertywise tests * Not uniform on Cn * something something
1 parent 79986f7 commit ec0e6ef

File tree

17 files changed

+237
-56073
lines changed

17 files changed

+237
-56073
lines changed

UnicodeJsps/src/main/java/org/unicode/jsp/Common.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public String transform(String source) {
4545
};
4646

4747
static List<String> XPROPERTY_NAMES =
48-
Arrays.asList(new String[] {"toNFC", "toNFD", "toNFKC", "toNFKD", "subhead"});
48+
Arrays.asList(new String[] {"toNFC", "toNFD", "toNFKC", "toNFKD"});
4949
static final int XSTRING_START = UProperty.STRING_LIMIT;
5050

5151
public static String getXStringPropertyValue(int propertyEnum, int codepoint, int nameChoice) {
@@ -59,8 +59,6 @@ public static String getXStringPropertyValue(int propertyEnum, int codepoint, in
5959
return Common.MyNormalize(codepoint, Normalizer.NFKC);
6060
case Common.TO_NFKD:
6161
return Common.MyNormalize(codepoint, Normalizer.NFKD);
62-
case Common.SUBHEAD:
63-
return UnicodeUtilities.getSubheader().getSubheader(codepoint);
6462
}
6563
return UCharacter.getStringPropertyValue(propertyEnum, codepoint, nameChoice);
6664
}
@@ -99,8 +97,7 @@ static String MyNormalize(String string, Mode mode) {
9997
static final int TO_NFD = UProperty.STRING_LIMIT + 1;
10098
static final int TO_NFKC = UProperty.STRING_LIMIT + 2;
10199
static final int TO_NFKD = UProperty.STRING_LIMIT + 3;
102-
public static final int SUBHEAD = TO_NFKD + 1;
103-
static final int XSTRING_LIMIT = SUBHEAD + 1;
100+
static final int XSTRING_LIMIT = TO_NFKD + 1;
104101
// static UnicodeSet isCaseFolded = new UnicodeSet();
105102
// static UnicodeSet isLowercase = new UnicodeSet();
106103
// static UnicodeSet isUppercase = new UnicodeSet();

UnicodeJsps/src/main/java/org/unicode/jsp/GenerateSubheader.java

Lines changed: 0 additions & 16 deletions
This file was deleted.

UnicodeJsps/src/main/java/org/unicode/jsp/Subheader.java

Lines changed: 0 additions & 225 deletions
This file was deleted.

UnicodeJsps/src/main/java/org/unicode/jsp/UnicodeUtilities.java

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ public class UnicodeUtilities {
7474
.removeAll(new UnicodeSet("[:whitespace:]"))
7575
.freeze();
7676

77-
private static Subheader subheader = null;
78-
7977
static Transliterator toHTML;
8078
static Transliterator toHTMLInput;
8179
static String HTML_RULES_CONTROLS;
@@ -449,17 +447,26 @@ public static void showSet(
449447
+ "}'>"
450448
+ block
451449
+ "</a>";
452-
String newSubhead = getSubheader().getSubheader(s);
453-
if (newSubhead == null) {
454-
newSubhead = "<u>no subhead</u>";
455-
} else {
456-
newSubhead =
457-
"<a href='list-unicodeset.jsp?a=\\p{subhead="
458-
+ newSubhead
459-
+ "}'>"
460-
+ newSubhead
461-
+ "</a>";
462-
}
450+
String devSubhead =
451+
getFactory().getProperty("Udev:Names_List_Subheader").getValue(s);
452+
String subhead = getFactory().getProperty("Names_List_Subheader").getValue(s);
453+
String newSubhead =
454+
showDevProperties && devSubhead != null && !devSubhead.equals(subhead)
455+
? "<a class='changed' href='list-unicodeset.jsp?a=\\p{U"
456+
+ Settings.latestVersion
457+
+ Settings.latestVersionPhase
458+
+ ":Names_List_Subheader="
459+
+ devSubhead
460+
+ "}'>"
461+
+ devSubhead
462+
+ "</a>"
463+
: subhead != null
464+
? "<a href='list-unicodeset.jsp?a=\\p{Names_List_Subheader="
465+
+ subhead
466+
+ "}'>"
467+
+ subhead
468+
+ "</a>"
469+
: "<u>no subheader</u>";
463470
newBlock = newBlock + " \u2014 <i>" + newSubhead + "</i>";
464471
UnicodeSet set = items.get(newBlock);
465472
if (set == null) items.put(newBlock, set = new UnicodeSet());
@@ -2017,31 +2024,6 @@ private static String getPropLink(
20172024
return result;
20182025
}
20192026

2020-
static Subheader getSubheader() {
2021-
if (subheader == null) {
2022-
// /home/users/jakarta/apache-tomcat-6.0.14/bin
2023-
// /home/users/jakarta/apache-tomcat-6.0.14/webapps/cldr/utility
2024-
subheader = new Subheader(UnicodeUtilities.class.getResourceAsStream("NamesList.txt"));
2025-
// try {
2026-
// final String unicodeDataDirectory = "../webapps/cldr/utility/";
2027-
// //System.out.println(canonicalPath);
2028-
// subheader = new Subheader(unicodeDataDirectory);
2029-
// } catch (IOException e) {
2030-
// try {
2031-
// final String unicodeDataDirectory = "./jsp/";
2032-
// subheader = new Subheader(unicodeDataDirectory);
2033-
// } catch (IOException e2) {
2034-
// final String[] list = new File("home").list();
2035-
// String currentDirectory = list == null ? null : new
2036-
// TreeSet<String>(Arrays.asList(list)).toString();
2037-
// throw (RuntimeException) new IllegalArgumentException("Can't find file
2038-
// starting from: <" + currentDirectory + ">").initCause(e);
2039-
// }
2040-
// }
2041-
}
2042-
return subheader;
2043-
}
2044-
20452027
// static IdnaLabelTester tester = null;
20462028
static String removals =
20472029
new UnicodeSet("[\u1806[:di:]-[:cn:]]").complement().complement().toPattern(false);

UnicodeJsps/src/main/java/org/unicode/jsp/XPropertyFactory.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,6 @@ public String transform(String source) {
162162
.set(NFM.nfm.getSet(null))
163163
.setMain("isNFM", "isNFM", UnicodeProperty.BINARY, "1.1"));
164164

165-
add(
166-
new CodepointTransformProperty(
167-
new Transform<Integer, String>() {
168-
@Override
169-
public String transform(Integer source) {
170-
return UnicodeUtilities.getSubheader().getSubheader(source);
171-
}
172-
},
173-
false)
174-
.setMain("subhead", "subhead", UnicodeProperty.STRING, "1.1"));
175-
176165
add(
177166
new UnicodeSetProperty()
178167
.set("[:^nfcqc=n:]")

0 commit comments

Comments
 (0)