From 1d7d7f00baaee1433eb4501587e1c27d42d04c98 Mon Sep 17 00:00:00 2001 From: Mark Davis Date: Thu, 8 Jun 2006 18:16:40 +0000 Subject: [PATCH] ICU-5222 updates for UCD/A 5.0.0 X-SVN-Rev: 19697 --- tools/unicodetools/com/ibm/text/UCA/UCA.java | 34 ++--- .../com/ibm/text/UCA/UCA_Data.java | 10 +- .../com/ibm/text/UCA/WriteCharts.java | 30 ++--- .../com/ibm/text/UCA/WriteCollationData.java | 14 +-- tools/unicodetools/readme.html | 119 ++++++++++++++++-- 5 files changed, 153 insertions(+), 54 deletions(-) diff --git a/tools/unicodetools/com/ibm/text/UCA/UCA.java b/tools/unicodetools/com/ibm/text/UCA/UCA.java index 28cb9a66e3d..8e36595dc1f 100644 --- a/tools/unicodetools/com/ibm/text/UCA/UCA.java +++ b/tools/unicodetools/com/ibm/text/UCA/UCA.java @@ -5,8 +5,8 @@ ******************************************************************************* * * $Source: /xsrl/Nsvn/icu/unicodetools/com/ibm/text/UCA/UCA.java,v $ -* $Date: 2005/05/02 15:39:54 $ -* $Revision: 1.25 $ +* $Date: 2006/06/08 18:16:40 $ +* $Revision: 1.26 $ * ******************************************************************************* */ @@ -1128,7 +1128,7 @@ CP => [.AAAA.0020.0002.][.BBBB.0000.0000.] Normalizer skipDecomps; Normalizer nfd; Normalizer nfkd; - Iterator enum = null; + Iterator enum1 = null; byte ceLimit; int currentRange = SAMPLE_RANGES.length; // set to ZERO to enable int startOfRange = SAMPLE_RANGES[0][0]; @@ -1197,9 +1197,9 @@ CP => [.AAAA.0020.0002.][.BBBB.0000.0000.] } // contractions - if (enum == null) enum = ucaData.getContractions(); - while (enum.hasNext()) { - result = (String)enum.next(); + if (enum1 == null) enum1 = ucaData.getContractions(); + while (enum1.hasNext()) { + result = (String)enum1.next(); if (result.length() == 1 && UTF16.isLeadSurrogate(result.charAt(0))) { //System.out.println("Skipping " + ucd.getCodeAndName(result)); continue; // try again @@ -1500,9 +1500,9 @@ CP => [.AAAA.0020.0002.][.BBBB.0000.0000.] Map missingStrings = new HashMap(); Map tempMap = new HashMap(); - Iterator enum = ucaData.getContractions(); - while (enum.hasNext()) { - String sequence = (String)enum.next(); + Iterator enum1 = ucaData.getContractions(); + while (enum1.hasNext()) { + String sequence = (String)enum1.next(); //System.out.println("Contraction: " + Utility.hex(sequence)); for (int i = sequence.length()-1; i > 0; --i) { String shorter = sequence.substring(0,i); @@ -1520,26 +1520,26 @@ CP => [.AAAA.0020.0002.][.BBBB.0000.0000.] // now add them. We couldn't before because we were iterating over it. - enum = tempMap.keySet().iterator(); - while (enum.hasNext()) { - String shorter = (String) enum.next(); + enum1 = tempMap.keySet().iterator(); + while (enum1.hasNext()) { + String shorter = (String) enum1.next(); IntStack tempStack = (IntStack) tempMap.get(shorter); ucaData.add(shorter, tempStack); } - enum = missingStrings.keySet().iterator(); + enum1 = missingStrings.keySet().iterator(); if (missingStrings.size() != 0) { /** - while (enum.hasMoreElements()) { - String sequence = (String)enum.nextElement(); + while (enum1.hasMoreElements()) { + String sequence = (String)enum1.nextElement(); getCE(sequence); FIX LATER; } */ String errorMessage = ""; - while (enum.hasNext()) { - String missing = (String)enum.next(); + while (enum1.hasNext()) { + String missing = (String)enum1.next(); if (errorMessage.length() != 0) errorMessage += ", "; errorMessage += "\"" + missing + "\""; } diff --git a/tools/unicodetools/com/ibm/text/UCA/UCA_Data.java b/tools/unicodetools/com/ibm/text/UCA/UCA_Data.java index a5b645bbbbb..97500208950 100644 --- a/tools/unicodetools/com/ibm/text/UCA/UCA_Data.java +++ b/tools/unicodetools/com/ibm/text/UCA/UCA_Data.java @@ -5,8 +5,8 @@ ******************************************************************************* * * $Source: /xsrl/Nsvn/icu/unicodetools/com/ibm/text/UCA/UCA_Data.java,v $ -* $Date: 2005/05/02 15:39:54 $ -* $Revision: 1.3 $ +* $Date: 2006/06/08 18:16:40 $ +* $Revision: 1.4 $ * ******************************************************************************* */ @@ -294,9 +294,9 @@ public class UCA_Data implements UCA_Types { if (collationElements[i] == CONTRACTING) ceSet.add(i); } UnicodeSet ceSet2 = new UnicodeSet(); - Iterator enum = contractingTable.keySet().iterator(); - while (enum.hasNext()) { - String sequence = (String)enum.next(); + Iterator enum1 = contractingTable.keySet().iterator(); + while (enum1.hasNext()) { + String sequence = (String)enum1.next(); ceSet2.add(sequence.charAt(0)); } diff --git a/tools/unicodetools/com/ibm/text/UCA/WriteCharts.java b/tools/unicodetools/com/ibm/text/UCA/WriteCharts.java index 5f3642241f6..afb11b0c780 100644 --- a/tools/unicodetools/com/ibm/text/UCA/WriteCharts.java +++ b/tools/unicodetools/com/ibm/text/UCA/WriteCharts.java @@ -5,8 +5,8 @@ ******************************************************************************* * * $Source: /xsrl/Nsvn/icu/unicodetools/com/ibm/text/UCA/WriteCharts.java,v $ -* $Date: 2005/04/06 08:48:17 $ -* $Revision: 1.21 $ +* $Date: 2006/06/08 18:16:40 $ +* $Revision: 1.22 $ * ******************************************************************************* */ @@ -266,10 +266,12 @@ public class WriteCharts implements UCD_Types { String[] replacement = new String[] {"%%%", "Normalization Charts"}; String folder = "charts\\normalization\\"; + + //System.out.println("File: " + new File(".").getCanonicalPath()); - Utility.copyTextFile("index.html", Utility.UTF8, folder + "index.html", replacement); - Utility.copyTextFile("charts.css", Utility.LATIN1, folder + "charts.css"); - Utility.copyTextFile("norm_help.html", Utility.UTF8, folder + "help.html"); + Utility.copyTextFile("com/ibm/text/UCA/index.html", Utility.UTF8, folder + "index.html", replacement); + Utility.copyTextFile("com/ibm/text/UCA/charts.css", Utility.LATIN1, folder + "charts.css"); + Utility.copyTextFile("com/ibm/text/UCA/norm_help.html", Utility.UTF8, folder + "help.html"); indexFile = Utility.openPrintWriter(folder + "index_list.html", Utility.UTF8_WINDOWS); Utility.appendFile(WORKING_DIR + "index_header.html", Utility.UTF8, indexFile, replacement); @@ -375,9 +377,9 @@ public class WriteCharts implements UCD_Types { String[] replacement = new String[] {"%%%", "Case Charts"}; String folder = "charts\\case\\"; - Utility.copyTextFile("index.html", Utility.UTF8, folder + "index.html", replacement); - Utility.copyTextFile("charts.css", Utility.LATIN1, folder + "charts.css"); - Utility.copyTextFile("case_help.html", Utility.UTF8, folder + "help.html"); + Utility.copyTextFile("com/ibm/text/UCA/index.html", Utility.UTF8, folder + "index.html", replacement); + Utility.copyTextFile("com/ibm/text/UCA/charts.css", Utility.LATIN1, folder + "charts.css"); + Utility.copyTextFile("com/ibm/text/UCA/case_help.html", Utility.UTF8, folder + "help.html"); indexFile = Utility.openPrintWriter(folder + "index_list.html", Utility.UTF8_WINDOWS); Utility.appendFile(WORKING_DIR + "index_header.html", Utility.UTF8, indexFile, replacement); @@ -487,9 +489,9 @@ public class WriteCharts implements UCD_Types { String[] replacement = new String[] {"%%%", "Script Charts"}; String folder = "charts\\script\\"; - Utility.copyTextFile("index.html", Utility.UTF8, folder + "index.html", replacement); - Utility.copyTextFile("charts.css", Utility.LATIN1, folder + "charts.css"); - Utility.copyTextFile("script_help.html", Utility.UTF8, folder + "help.html"); + Utility.copyTextFile("com/ibm/text/UCA/index.html", Utility.UTF8, folder + "index.html", replacement); + Utility.copyTextFile("com/ibm/text/UCA/charts.css", Utility.LATIN1, folder + "charts.css"); + Utility.copyTextFile("com/ibm/text/UCA/script_help.html", Utility.UTF8, folder + "help.html"); indexFile = Utility.openPrintWriter(folder + "index_list.html", Utility.UTF8_WINDOWS); Utility.appendFile(WORKING_DIR + "script_index_header.html", Utility.UTF8, indexFile, replacement); @@ -609,9 +611,9 @@ public class WriteCharts implements UCD_Types { String[] replacement = new String[] {"%%%", "Name Charts"}; String folder = "charts\\name\\"; - Utility.copyTextFile("index.html", Utility.UTF8, folder + "index.html", replacement); - Utility.copyTextFile("charts.css", Utility.LATIN1, folder + "charts.css"); - Utility.copyTextFile("name_help.html", Utility.UTF8, folder + "help.html"); + Utility.copyTextFile("com/ibm/text/UCA/index.html", Utility.UTF8, folder + "index.html", replacement); + Utility.copyTextFile("com/ibm/text/UCA/charts.css", Utility.LATIN1, folder + "charts.css"); + Utility.copyTextFile("com/ibm/text/UCA/name_help.html", Utility.UTF8, folder + "help.html"); indexFile = Utility.openPrintWriter(folder + "index_list.html", Utility.UTF8_WINDOWS); Utility.appendFile(WORKING_DIR + "index_header.html", Utility.UTF8, indexFile, replacement); diff --git a/tools/unicodetools/com/ibm/text/UCA/WriteCollationData.java b/tools/unicodetools/com/ibm/text/UCA/WriteCollationData.java index 6421c50c28b..2b6499f0259 100644 --- a/tools/unicodetools/com/ibm/text/UCA/WriteCollationData.java +++ b/tools/unicodetools/com/ibm/text/UCA/WriteCollationData.java @@ -5,8 +5,8 @@ ******************************************************************************* * * $Source: /xsrl/Nsvn/icu/unicodetools/com/ibm/text/UCA/WriteCollationData.java,v $ -* $Date: 2006/04/05 22:12:46 $ -* $Revision: 1.43 $ +* $Date: 2006/06/08 18:16:40 $ +* $Revision: 1.44 $ * ******************************************************************************* */ @@ -2301,7 +2301,7 @@ F900..FAFF; CJK Compatibility Ideographs // NOTE: we add the back map based on the string value; the smallest (UTF-16 order) string wins Object key = new ArrayWrapper((int[])(ces.clone()),0, len); if (false) { - Object value = backMap.get(key); + String value = (String)backMap.get(key); if (value == null) return; if (s.compareTo(value) >= 0) return; } @@ -4099,23 +4099,23 @@ F900..FAFF; CJK Compatibility Ideographs writeDuplicates(); writeOverlap(); - log.println("

Coverage

"); + log.println("

11. Coverage

"); BagFormatter bf = new BagFormatter(); bf.setLineSeparator("
\r\n"); - ToolUnicodePropertySource ups = ToolUnicodePropertySource.make(""); + ToolUnicodePropertySource ups = ToolUnicodePropertySource.make(Default.ucdVersion()); bf.setUnicodePropertyFactory(ups); bf.setShowLiteral(TransliteratorUtilities.toHTML); bf.setFixName(TransliteratorUtilities.toHTML); UCD ucd = Default.ucd(); UnicodeProperty cat = ups.getProperty("gc"); - UnicodeSet ucd410 = cat.getSet("Cn") + UnicodeSet ucdCharacters = cat.getSet("Cn") .addAll(cat.getSet("Co")) .addAll(cat.getSet("Cs")) .complement() //.addAll(ups.getSet("Noncharactercodepoint=true")) //.addAll(ups.getSet("Default_Ignorable_Code_Point=true")) ; - bf.showSetDifferences(log, "UCD4.1.0", ucd410, "UCA4.1.0", coverage, 3); + bf.showSetDifferences(log, "UCD" + Default.ucdVersion(), ucdCharacters, collator.getFileVersion(), coverage, 3); log.println(""); log.close(); diff --git a/tools/unicodetools/readme.html b/tools/unicodetools/readme.html index e54aad58a81..acf49f9d1aa 100644 --- a/tools/unicodetools/readme.html +++ b/tools/unicodetools/readme.html @@ -4,6 +4,11 @@ New Page 18 + @@ -170,14 +175,14 @@ CopyrightYear: 2006 // Pick the current year
  • Run>Run As...
    1. Choose Java Application
        -
      • it will fail, don't worry; you need to set some parameters
      • +
      • it will fail, don't worry; you need to set some parameters.
  • Run>Run...