Skip to content

Commit

Permalink
CLDR-17063 CLDRModify -fQ debugging, real/fake keyword paths
Browse files Browse the repository at this point in the history
-This illustrates cause of draft=unconfirmed bug

-The old, fake keyword path is derived from tts path by removeAttribute

-The new, real keyword path gotten from the CLDRFile

-In general, they are not the same, common difference is draft unconfirmed
  • Loading branch information
btangmu committed Sep 18, 2023
1 parent 7f3d2e9 commit 445d45c
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2122,6 +2122,7 @@ public void handlePath(String xpath) {
}
XPathParts keywordParts = parts.cloneAsThawed().removeAttribute(2, "type");
String keywordPath = keywordParts.toString();
keywordPath = cldrFileToFilter.getFullXPath(keywordPath);
fakeKeywordPaths.add(keywordPath);
String distinguishingKeywordPath =
CLDRFile.getDistinguishingXPath(keywordPath, null);
Expand All @@ -2145,7 +2146,8 @@ public void handlePath(String xpath) {

String name = resolved.getStringValue(xpath);
String keywordValue = resolved.getStringValue(keywordPath);
String sourceLocaleId = resolved.getSourceLocaleID(distinguishingKeywordPath, null);
String sourceLocaleId =
resolved.getSourceLocaleID(distinguishingKeywordPath, null);
sorted.clear();
sorted.add(name);

Expand All @@ -2166,18 +2168,28 @@ public void handlePath(String xpath) {
@Override
public void handleEnd() {
if (fakeKeywordPaths.isEmpty() || realKeywordPaths.isEmpty()) {
throw new RuntimeException("fake/real EMPTY loc: " + cldrFileToFilter.getLocaleID());
throw new RuntimeException(
"fake/real EMPTY loc: " + cldrFileToFilter.getLocaleID());
}
if (!fakeKeywordPaths.equals(realKeywordPaths)) {
fakeKeywordPaths.removeAll(realKeywordPaths);
realKeywordPaths.removeAll(fakeKeywordPaths);
for (String p : fakeKeywordPaths) {
System.out.println("ONLY fake: " + p + " loc: " + cldrFileToFilter.getLocaleID());
System.out.println(
"ONLY fake: "
+ p
+ " loc: "
+ cldrFileToFilter.getLocaleID());
}
for (String p : realKeywordPaths) {
System.out.println("ONLY real: " + p + " loc: " + cldrFileToFilter.getLocaleID());
System.out.println(
"ONLY real: "
+ p
+ " loc: "
+ cldrFileToFilter.getLocaleID());
}
// throw new RuntimeException("fake/real diff loc: " + cldrFileToFilter.getLocaleID());
// throw new RuntimeException("fake/real diff loc: " +
// cldrFileToFilter.getLocaleID());
}
}
});
Expand Down

0 comments on commit 445d45c

Please sign in to comment.