From bd9e7149282776975597e25f42de7b6233d0798d Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Wed, 22 May 2024 15:26:07 -0700 Subject: [PATCH] update: spotless 2.43 & google-java-style 1.22 --- .../org/unicode/cldr/tool/TablePrinter.java | 1 + .../src/main/java/org/unicode/jsp/Globe.java | 17 +++++++++++++++++ .../main/java/org/unicode/jsp/ScriptTester.java | 2 ++ .../src/main/java/org/unicode/jsp/Typology.java | 1 + .../java/org/unicode/jsp/UnicodeUtilities.java | 2 ++ .../java/org/unicode/jsptest/TestBuilder.java | 1 + .../test/java/org/unicode/jsptest/TestJsp.java | 1 + .../org/unicode/jsptest/TestProperties.java | 1 + pom.xml | 7 ++++--- .../unicode/unittest/TestFmwkMinusMinus.java | 1 + .../java/org/unicode/draft/AcceptLanguage.java | 1 + .../java/org/unicode/draft/CldrUtility.java | 8 ++++++++ .../org/unicode/draft/GeneratePickerData2.java | 1 + .../java/org/unicode/draft/MessageFormat.java | 2 ++ .../java/org/unicode/draft/OldPunycode.java | 7 +++++++ .../main/java/org/unicode/draft/Punycode.java | 2 ++ .../java/org/unicode/draft/UnicodeIntMap.java | 5 +++++ .../java/org/unicode/idna/GenerateIdnaTest.java | 1 + .../src/main/java/org/unicode/idna/Idna.java | 1 + .../main/java/org/unicode/idna/Punycode.java | 6 ++++++ .../java/org/unicode/idna/StringPrepData.java | 1 + .../src/main/java/org/unicode/idna/Uts46.java | 1 + .../java/org/unicode/jsp/FileUtilities.java | 1 + .../src/main/java/org/unicode/parse/Pick.java | 3 +++ .../java/org/unicode/props/BagFormatter.java | 4 ++++ .../unicode/props/IndexUnicodeProperties.java | 1 + .../unicode/props/PropNormalizationData.java | 1 + .../org/unicode/props/PropertyParsingInfo.java | 3 ++- .../org/unicode/props/PropertyUtilities.java | 1 + .../unicode/props/RandomStringGenerator.java | 1 + .../main/java/org/unicode/props/ScriptInfo.java | 1 + .../java/org/unicode/props/UcdLineParser.java | 2 ++ .../unicode/text/UCA/CompareDucetToCldr.java | 1 + .../java/org/unicode/text/UCA/Fractional.java | 10 ++++++++++ .../java/org/unicode/text/UCA/Implicit.java | 7 +++++++ .../text/UCA/MappingsForFractionalUCA.java | 3 +++ .../unicode/text/UCA/PrimariesToFractional.java | 9 +++++++++ .../org/unicode/text/UCA/RadicalStroke.java | 7 +++++++ .../unicode/text/UCA/SecTerToFractional.java | 4 ++++ .../src/main/java/org/unicode/text/UCA/UCA.java | 4 ++++ .../org/unicode/text/UCA/UCA_Statistics.java | 1 + .../unicode/text/UCA/WriteCollationData.java | 1 + .../java/org/unicode/text/UCD/BuildNames.java | 1 + .../java/org/unicode/text/UCD/CheckICU.java | 1 + .../java/org/unicode/text/UCD/ConvertUCD.java | 3 +++ .../org/unicode/text/UCD/DerivedProperty.java | 1 + .../org/unicode/text/UCD/GenerateBreakTest.java | 1 + .../unicode/text/UCD/GenerateConfusables.java | 10 ++++++++++ .../text/UCD/GenerateConfusablesCopy.java | 10 ++++++++++ .../text/UCD/GenerateHanTransliterator.java | 1 + .../unicode/text/UCD/GenerateStringPrep.java | 1 + .../org/unicode/text/UCD/IdentifierInfo.java | 1 + .../org/unicode/text/UCD/MakeUnicodeFiles.java | 4 +++- .../java/org/unicode/text/UCD/NamesList.java | 1 + .../java/org/unicode/text/UCD/QuickTest.java | 1 + .../unicode/text/UCD/TestNameUniqueness.java | 1 + .../text/UCD/ToolUnicodePropertySource.java | 1 + .../src/main/java/org/unicode/text/UCD/UCD.java | 1 + .../java/org/unicode/text/UCD/UCDProperty.java | 1 + .../java/org/unicode/text/UCD/UCD_Names.java | 1 + .../java/org/unicode/text/UCD/UCD_Types.java | 1 + .../main/java/org/unicode/text/UCD/UData.java | 1 + .../unicode/text/UCD/UnifiedBinaryProperty.java | 1 + .../org/unicode/text/UCD/UnifiedProperty.java | 1 + .../java/org/unicode/text/tools/StringTree.java | 1 + .../org/unicode/text/tools/UnicodeSetTree.java | 1 + .../org/unicode/text/tools/VerifyXmlUcd.java | 1 + .../unicode/text/utility/ChainException.java | 1 + .../unicode/text/utility/CompactByteArray.java | 5 +++++ .../unicode/text/utility/CompactShortArray.java | 12 ++++++++++++ .../unicode/text/utility/FastUnicodeSet.java | 1 + .../org/unicode/text/utility/IndentWriter.java | 1 + .../text/utility/OldEquivalenceClass.java | 2 ++ .../java/org/unicode/text/utility/Settings.java | 5 +++++ .../org/unicode/text/utility/TestUtility.java | 1 + .../unicode/text/utility/UnicodeTransform.java | 2 ++ .../java/org/unicode/text/utility/Utility.java | 1 + .../java/org/unicode/text/utility/XMLParse.java | 1 + .../org/unicode/tools/GeneratePickerData.java | 1 + .../src/main/java/org/unicode/tools/Ids.java | 2 ++ .../main/java/org/unicode/tools/Segmenter.java | 2 ++ .../java/org/unicode/tools/emoji/BirthInfo.java | 2 ++ .../org/unicode/tools/emoji/CountEmoji.java | 1 + .../java/org/unicode/tools/emoji/Emoji.java | 4 ++++ .../unicode/tools/emoji/EmojiAnnotations.java | 1 + .../java/org/unicode/tools/emoji/EmojiData.java | 1 + .../org/unicode/tools/emoji/EmojiFlagOrder.java | 1 + .../org/unicode/tools/emoji/EmojiFrequency.java | 4 ++++ .../org/unicode/tools/emoji/EmojiIterator.java | 1 + .../org/unicode/tools/emoji/EmojiMatcher.java | 1 + .../tools/emoji/GenerateMissingAnnotations.java | 1 + .../org/unicode/tools/emoji/ProposalData.java | 2 ++ .../org/unicode/unused/CheckSystemFonts.java | 1 + .../org/unicode/unused/DataInputCompressor.java | 1 + .../unicode/unused/DataOutputCompressor.java | 1 + .../main/java/org/unicode/unused/Implicit.java | 2 ++ .../unicode/unused/TransformTransliterator.java | 1 + .../unicode/unused/UnicodePropertySource.java | 1 + .../unicode/utilities/UnicodeSetFormatter.java | 1 + .../src/test/java/org/unicode/draft/Test2.java | 1 + .../test/java/org/unicode/idna/TestUts46.java | 1 + .../org/unicode/propstest/PropertyAliases.java | 1 + .../org/unicode/propstest/XMLProperties.java | 2 ++ .../unittest/TestEmojiDataConsistency.java | 2 ++ .../unicode/unittest/LocaleCanonicalizer.java | 1 + .../org/unicode/unittest/LocaleExtensions.java | 1 + .../org/unicode/unittest/TestUnicodeSet.java | 1 + 107 files changed, 252 insertions(+), 5 deletions(-) diff --git a/UnicodeJsps/src/main/java/org/unicode/cldr/tool/TablePrinter.java b/UnicodeJsps/src/main/java/org/unicode/cldr/tool/TablePrinter.java index 6ed8a4d96..5bb9fb9b4 100644 --- a/UnicodeJsps/src/main/java/org/unicode/cldr/tool/TablePrinter.java +++ b/UnicodeJsps/src/main/java/org/unicode/cldr/tool/TablePrinter.java @@ -451,6 +451,7 @@ private int findIdentical(Comparable[][] sortedFlat, int rowIndex, int colIndex) } return sortedFlat.length - rowIndex; } + // to-do: prevent overlap when it would cause information to be lost. private BitSet breaksSpans = new BitSet(); diff --git a/UnicodeJsps/src/main/java/org/unicode/jsp/Globe.java b/UnicodeJsps/src/main/java/org/unicode/jsp/Globe.java index 8315b123d..95a6d70b2 100644 --- a/UnicodeJsps/src/main/java/org/unicode/jsp/Globe.java +++ b/UnicodeJsps/src/main/java/org/unicode/jsp/Globe.java @@ -495,6 +495,7 @@ private static void loadSourceMap(String sname) { } changeImage(frame); } + /** * @param frame */ @@ -704,12 +705,14 @@ public Shape getClip() { } return clip; } + /** * @return */ public boolean usesOrigin() { return false; } + // must set before use Transform set(double srcW, double srcH, double dstW, double dstH) { this.srcW = srcW; @@ -724,6 +727,7 @@ Transform set(double srcW, double srcH, double dstW, double dstH) { clip = null; return this; } + // Remember that the coordinate system is upside down so apply // the transform as if the angle were negated. // cos(-angle) = cos(angle) @@ -750,6 +754,7 @@ public final boolean transform(double x, double y, DPoint retcoord) { retcoord.y = lat_dstH.map(retcoord.y); return retcoord.x >= 0.0 && retcoord.x <= dstW && retcoord.y >= 0 && retcoord.y <= dstH; } + // Remember that the coordinate system is upside down so apply // the transform as if the angle were negated. Since inverting // the transform is also the same as negating the angle, itransform @@ -774,11 +779,13 @@ public final boolean itransform(double x, double y, DPoint retcoord) { retcoord.y = srcH_lat.back(retcoord.y); return retcoord.x >= 0.0 && retcoord.x <= srcW && retcoord.y >= 0 && retcoord.y <= srcH; } + /** * @param input and output: latitude in y (radians from -pi/2 to pi/2) and longitude in x * (radians from -pi to pi) */ protected abstract void _transform(DPoint retcoord); + /** * @param input and output: latitude in y (radians from -pi/2 to pi/2) and longitude in x * (radians from -pi to pi) @@ -786,6 +793,7 @@ public final boolean itransform(double x, double y, DPoint retcoord) { protected abstract void _itransform(DPoint retcoord); protected abstract Shape _getClip(); + /** * @param style * @return @@ -866,6 +874,7 @@ public void _transform(DPoint retcoord) { public void _itransform(DPoint retcoord) { // nothing } + /* (non-Javadoc) * @see Globe.Transform#_getClip() */ @@ -979,6 +988,7 @@ public static class TransformEqualAreaEllipse extends Transform { debugTemp = false; } } + // Area of a spherical cap is 2 pi r^2 (1-sin(lat)) // Area of a circular segment is r^2 ( acos(p) - p sqrt(1-p^2)), where p = dist to chord/r // Thus we get the itransform easily: @@ -1016,6 +1026,7 @@ public void _itransform(DPoint retcoord) { protected Shape _getClip() { return new Ellipse2D.Double(0, 0, dstW, dstH); } + /** * @param in -1..1 * @return value in 0..PI @@ -1573,6 +1584,7 @@ public void imageComplete(int status) { consumer.imageComplete(status); } } + /* public static double convertDegreesToDecimal(double degrees, double minutes, double seconds, boolean NorthOrEast) { double result = (degrees + minutes / 60 + seconds / 3600); @@ -1932,6 +1944,7 @@ void fixContents() { lineContents[c.yStart].add(c); } } + /** * @param c * @return @@ -2066,6 +2079,7 @@ private static void drawDegrees( } private static DPoint drawLineP1 = new DPoint(); + /* private static void drawLine(Graphics2D graphics2D, Transform trans, double x1, double y1, double x2, double y2) { @@ -2111,6 +2125,7 @@ private static void drawLine2(Graphics2D graphics2D, Transform trans, double x, abstract static class TTransform { double x, y; + // t is 0..1 abstract void transform(double t); } @@ -2174,11 +2189,13 @@ static class LineDrawer { transient double startX, startY, startT; // transient double endX, endY, endT; TTransform ttransform; + // int segments = 0; LineDrawer(Graphics2D graphics2D, TTransform ttransform) { this.graphics2D = graphics2D; this.ttransform = ttransform; } + // t is 0..1 void draw(double startT, double endT) { this.startT = startT; diff --git a/UnicodeJsps/src/main/java/org/unicode/jsp/ScriptTester.java b/UnicodeJsps/src/main/java/org/unicode/jsp/ScriptTester.java index 7d3a191d4..6113ecc69 100644 --- a/UnicodeJsps/src/main/java/org/unicode/jsp/ScriptTester.java +++ b/UnicodeJsps/src/main/java/org/unicode/jsp/ScriptTester.java @@ -45,6 +45,7 @@ public enum ScriptSpecials { public static final int EXTRA_COUNT = 16; // should be enough, hard working as UTC is! public static final Map extraScripts = new ConcurrentHashMap<>(EXTRA_COUNT); + /** Extended scripts; note that they do not have stable numbers, and should not be persisted. */ public static final int // HANT = UScript.CODE_LIMIT, @@ -551,6 +552,7 @@ public ScriptTester get() { } return new ScriptTester(character_scripts); } + /** * Add list of scripts that are acceptable in combination together. * diff --git a/UnicodeJsps/src/main/java/org/unicode/jsp/Typology.java b/UnicodeJsps/src/main/java/org/unicode/jsp/Typology.java index c6ed039c1..92ef62dee 100644 --- a/UnicodeJsps/src/main/java/org/unicode/jsp/Typology.java +++ b/UnicodeJsps/src/main/java/org/unicode/jsp/Typology.java @@ -34,6 +34,7 @@ public class Typology { public static Relation labelToPaths = new Relation(new TreeMap(), TreeSet.class); public static Map> label_parent_uset = new TreeMap(); + // public static Relation pathToList = new Relation(new TreeMap(), // TreeSet.class); diff --git a/UnicodeJsps/src/main/java/org/unicode/jsp/UnicodeUtilities.java b/UnicodeJsps/src/main/java/org/unicode/jsp/UnicodeUtilities.java index ee7d8e1e4..4f2e153ed 100644 --- a/UnicodeJsps/src/main/java/org/unicode/jsp/UnicodeUtilities.java +++ b/UnicodeJsps/src/main/java/org/unicode/jsp/UnicodeUtilities.java @@ -1348,6 +1348,7 @@ public static void getDifferences( }; static Comparator col = UnicodeSetUtilities.MAIN_COLLATOR; + // Collator.getInstance(ULocale.ROOT); // static { // ((RuleBasedCollator) col).setNumericCollation(true); @@ -1958,6 +1959,7 @@ static Subheader getSubheader() { static String removals = new UnicodeSet("[\u1806[:di:]-[:cn:]]").complement().complement().toPattern(false); static Matcher rem = Pattern.compile(removals).matcher(""); + // TODO use UnicodeRegex // static IdnaLabelTester getIdna2008Tester() { diff --git a/UnicodeJsps/src/test/java/org/unicode/jsptest/TestBuilder.java b/UnicodeJsps/src/test/java/org/unicode/jsptest/TestBuilder.java index 277783b6e..760b4bd39 100644 --- a/UnicodeJsps/src/test/java/org/unicode/jsptest/TestBuilder.java +++ b/UnicodeJsps/src/test/java/org/unicode/jsptest/TestBuilder.java @@ -46,6 +46,7 @@ public void TestCollection() { Set w = Builder.with(EnumSet.noneOf(Foo.class)).add(Foo.foo1).freeze(); assertTrue("w", w.size() == 1 && w.contains(Foo.foo1)); } + /** * * diff --git a/UnicodeJsps/src/test/java/org/unicode/jsptest/TestJsp.java b/UnicodeJsps/src/test/java/org/unicode/jsptest/TestJsp.java index 5d38023d1..8ddda6d82 100644 --- a/UnicodeJsps/src/test/java/org/unicode/jsptest/TestJsp.java +++ b/UnicodeJsps/src/test/java/org/unicode/jsptest/TestJsp.java @@ -666,6 +666,7 @@ public void assertNoMatch(String message, String pattern, Object actual) { false, actual); } + // return handleAssert(expected == actual, message, stringFor(expected), // stringFor(actual), "==", false); diff --git a/UnicodeJsps/src/test/java/org/unicode/jsptest/TestProperties.java b/UnicodeJsps/src/test/java/org/unicode/jsptest/TestProperties.java index 59b98a53b..3a2c47b71 100644 --- a/UnicodeJsps/src/test/java/org/unicode/jsptest/TestProperties.java +++ b/UnicodeJsps/src/test/java/org/unicode/jsptest/TestProperties.java @@ -223,6 +223,7 @@ public void TestNFM() { assertTrue("toNFM=a", actual2.contains("A")); assertTrue("toNFM=a", !actual2.contains("B")); } + // public void TestDefaultEncodingValue() { // UnicodeProperty prop = factory.getProperty("enc_ISO-8859-2"); // assertTrue("Default for Γ…, enc_ISO-8859-2", prop.isDefault('Γ…')); diff --git a/pom.xml b/pom.xml index 88cbc1ea6..31c4ce994 100644 --- a/pom.xml +++ b/pom.xml @@ -47,7 +47,7 @@ 3.0.0-M5 - 2.22.5 + 2.43.0 @@ -138,8 +138,9 @@ - - 1.15.0 + + 1.22.0 false diff --git a/unicodetools-testutils/src/main/java/org/unicode/unittest/TestFmwkMinusMinus.java b/unicodetools-testutils/src/main/java/org/unicode/unittest/TestFmwkMinusMinus.java index 9cc215190..df5c2974c 100644 --- a/unicodetools-testutils/src/main/java/org/unicode/unittest/TestFmwkMinusMinus.java +++ b/unicodetools-testutils/src/main/java/org/unicode/unittest/TestFmwkMinusMinus.java @@ -219,6 +219,7 @@ public boolean handleAssert( System.err.println("UNICODETOOLS_VERBOSE=" + verbose); System.err.println("UNICODETOOLS_RUN_BROKEN_TEST=" + runBroken); } + /** * set property: UNICODETOOLS_INCLUSION 0 = fewest tests, 5 is normal build (default), 10 is * most tests diff --git a/unicodetools/src/main/java/org/unicode/draft/AcceptLanguage.java b/unicodetools/src/main/java/org/unicode/draft/AcceptLanguage.java index 415c2c877..363ac79b7 100644 --- a/unicodetools/src/main/java/org/unicode/draft/AcceptLanguage.java +++ b/unicodetools/src/main/java/org/unicode/draft/AcceptLanguage.java @@ -1,4 +1,5 @@ package org.unicode.draft; + /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/unicodetools/src/main/java/org/unicode/draft/CldrUtility.java b/unicodetools/src/main/java/org/unicode/draft/CldrUtility.java index 54cf0c622..053b62fd6 100644 --- a/unicodetools/src/main/java/org/unicode/draft/CldrUtility.java +++ b/unicodetools/src/main/java/org/unicode/draft/CldrUtility.java @@ -1,4 +1,5 @@ package org.unicode.draft; + /* ********************************************************************** * Copyright (c) 2002-2004, International Business Machines @@ -68,6 +69,7 @@ public static class VariableReplacer { // simple implementation for now private final Map m = new TreeMap(Collections.reverseOrder()); + /** * Add a new variable * @@ -79,6 +81,7 @@ public VariableReplacer add(String variable, String value) { m.put(variable, value); return this; } + /** * Replace all of the variables in the source, recursively. * @@ -118,6 +121,7 @@ static String getPath(String path) { } static final boolean DEBUG_SHOW_BAT = false; + /** * default working directory for Eclipse is . = ${workspace_loc:cldr}, which is * /tools/java/ @@ -129,6 +133,7 @@ static String getPath(String path) { CldrUtility.getProperty( "CLDR_DIR", null)); // new File(Utility.getProperty("CLDR_DIR", null)).getPath(); + // // get up to public static final String UTIL_DATA_DIR = @@ -150,6 +155,7 @@ static String getPath(String path) { */ @Deprecated public static final String SUPPLEMENTAL_DIRECTORY = getPath(COMMON_DIRECTORY, "supplemental/"); + /** Only the default, if no other directory is specified. */ public static final String DEFAULT_SUPPLEMENTAL_DIRECTORY = getPath(COMMON_DIRECTORY, "supplemental/"); @@ -171,6 +177,7 @@ static String getPath(String path) { public interface LineComparer { static final int LINES_DIFFERENT = -1, LINES_SAME = 0, SKIP_FIRST = 1, SKIP_SECOND = 2; + /** * Returns LINES_DIFFERENT, LINES_SAME, or if one of the lines is ignorable, SKIP_FIRST or * SKIP_SECOND @@ -399,6 +406,7 @@ boolean matches(StringIterator other) { } } } + /** * @return Returns the position. */ diff --git a/unicodetools/src/main/java/org/unicode/draft/GeneratePickerData2.java b/unicodetools/src/main/java/org/unicode/draft/GeneratePickerData2.java index c756120d7..5cfbb0082 100644 --- a/unicodetools/src/main/java/org/unicode/draft/GeneratePickerData2.java +++ b/unicodetools/src/main/java/org/unicode/draft/GeneratePickerData2.java @@ -2426,6 +2426,7 @@ public static UnicodeSet flatten(UnicodeSet exemplar1) { + "-[:script=katakana:]" + "-[〇]" + "]"); // we'll alter + // below to remove // iicore diff --git a/unicodetools/src/main/java/org/unicode/draft/MessageFormat.java b/unicodetools/src/main/java/org/unicode/draft/MessageFormat.java index f8d355c74..d6bb75d1b 100644 --- a/unicodetools/src/main/java/org/unicode/draft/MessageFormat.java +++ b/unicodetools/src/main/java/org/unicode/draft/MessageFormat.java @@ -1,4 +1,5 @@ package org.unicode.draft; + /* ********************************************************************** * Copyright (c) 2004-2009, International Business Machines @@ -839,6 +840,7 @@ public Format[] getFormatsByArgumentIndex() { } return resultArray; } + // TODO: provide method public Map getFormatsByArgumentName(). // Where Map is: String argumentName --> Format format. diff --git a/unicodetools/src/main/java/org/unicode/draft/OldPunycode.java b/unicodetools/src/main/java/org/unicode/draft/OldPunycode.java index 2f56f7759..97e0c570c 100644 --- a/unicodetools/src/main/java/org/unicode/draft/OldPunycode.java +++ b/unicodetools/src/main/java/org/unicode/draft/OldPunycode.java @@ -1,4 +1,5 @@ package org.unicode.draft; + /* ******************************************************************************* * Copyright (C) 2003-2008, International Business Machines Corporation and * @@ -45,6 +46,7 @@ public final class OldPunycode { private static final int CAPITAL_A = 0x41; private static final int CAPITAL_Z = 0x5a; private static final int MAX_CP_COUNT = 200; + // private static final int UINT_MAGIC = 0x80000000; // private static final long ULONG_MAGIC = 0x8000000000000000L; @@ -101,6 +103,7 @@ private static char asciiCaseMap(char b, boolean uppercase) { } return b; } + /// CLOVER:ON /** * digitToBasic() returns the basic code point whose value (when used for representing integers) @@ -120,6 +123,7 @@ private static char digitToBasic(int digit, boolean uppercase) { return (char) ((ZERO - 26) + digit); } } + /** * Converts Unicode to Punycode. The input string must not contain single, unpaired surrogates. * The output will be represented as an array of ASCII code points. @@ -296,14 +300,17 @@ public static StringBuffer encode(StringBuffer src, boolean[] caseFlags) private static boolean isBasic(int ch) { return (ch < INITIAL_N); } + /// CLOVER:OFF private static boolean isBasicUpperCase(int ch) { return (CAPITAL_A <= ch && ch >= CAPITAL_Z); } + /// CLOVER:ON private static boolean isSurrogate(int ch) { return (((ch) & 0xfffff800) == 0xd800); } + /** * Converts Punycode to Unicode. The Unicode string will be at most as long as the Punycode * string. diff --git a/unicodetools/src/main/java/org/unicode/draft/Punycode.java b/unicodetools/src/main/java/org/unicode/draft/Punycode.java index dd773b73d..9d67aaadf 100644 --- a/unicodetools/src/main/java/org/unicode/draft/Punycode.java +++ b/unicodetools/src/main/java/org/unicode/draft/Punycode.java @@ -1,4 +1,5 @@ package org.unicode.draft; + /* ******************************************************************************* * Copyright (C) 2003-2008, International Business Machines Corporation and * @@ -38,6 +39,7 @@ public final class Punycode { private final char DELIMITER; private static final int MAX_CP_COUNT = 200; + // private static final int UINT_MAGIC = 0x80000000; // private static final long ULONG_MAGIC = 0x8000000000000000L; diff --git a/unicodetools/src/main/java/org/unicode/draft/UnicodeIntMap.java b/unicodetools/src/main/java/org/unicode/draft/UnicodeIntMap.java index 852413c65..179740842 100644 --- a/unicodetools/src/main/java/org/unicode/draft/UnicodeIntMap.java +++ b/unicodetools/src/main/java/org/unicode/draft/UnicodeIntMap.java @@ -251,6 +251,7 @@ private void _removeAt(int index, int count) { } length -= count; } + /** * Add a gap from index to index+count-1. The values there are undefined, and must be set. * Logically grows arrays to accomodate. Actual growth is limited @@ -547,6 +548,7 @@ public UnicodeIntMap setMissing(int value) { return putAll(keySet(UNASSIGNED), value); } } + /** * Returns the keyset consisting of all the keys that would produce the given value. Deposits * into result if it is not null. Remember to clear if you just want the new values. @@ -623,6 +625,7 @@ public > U values(U result) { public Set values() { return getAvailableValues(null); } + /** * Gets the value associated with a given code point. Returns null, if there is no such value. * @@ -755,12 +758,14 @@ public String toString(Comparator collected) { } return result.toString(); } + /** * @return Returns the errorOnReset value. */ public boolean getErrorOnReset() { return errorOnReset; } + /** * Puts the UnicodeMap into a state whereby new mappings are accepted, but changes to old * mappings cause an exception. diff --git a/unicodetools/src/main/java/org/unicode/idna/GenerateIdnaTest.java b/unicodetools/src/main/java/org/unicode/idna/GenerateIdnaTest.java index d22ce92ef..6fbe881ba 100644 --- a/unicodetools/src/main/java/org/unicode/idna/GenerateIdnaTest.java +++ b/unicodetools/src/main/java/org/unicode/idna/GenerateIdnaTest.java @@ -453,6 +453,7 @@ String getCanonicalString(String source) { result.append(getCanonicalLabel(source.substring(last))); return result.toString(); } + // we uppercase IF all ascii, otherwise leave it alone String getCanonicalLabel(String source) { final StringBuilder result = new StringBuilder(); diff --git a/unicodetools/src/main/java/org/unicode/idna/Idna.java b/unicodetools/src/main/java/org/unicode/idna/Idna.java index d7bbc81bb..68951bab0 100644 --- a/unicodetools/src/main/java/org/unicode/idna/Idna.java +++ b/unicodetools/src/main/java/org/unicode/idna/Idna.java @@ -35,6 +35,7 @@ public enum IdnaType { public UnicodeSet validSet_transitional = new UnicodeSet(); protected boolean checkPunycodeValidity = false; private final String name; + // static final Normalizer2 nfc = Normalizer2.getInstance(null, "nfc", // Normalizer2.Mode.COMPOSE); diff --git a/unicodetools/src/main/java/org/unicode/idna/Punycode.java b/unicodetools/src/main/java/org/unicode/idna/Punycode.java index 97e07e944..e389520a8 100644 --- a/unicodetools/src/main/java/org/unicode/idna/Punycode.java +++ b/unicodetools/src/main/java/org/unicode/idna/Punycode.java @@ -41,6 +41,7 @@ public final class Punycode { private static final int CAPITAL_A = 0x41; private static final int CAPITAL_Z = 0x5a; private static final int MAX_CP_COUNT = 200; + // private static final int UINT_MAGIC = 0x80000000; // private static final long ULONG_MAGIC = 0x8000000000000000L; @@ -97,6 +98,7 @@ private static char asciiCaseMap(char b, boolean uppercase) { } return b; } + /// CLOVER:ON /** * digitToBasic() returns the basic code point whose value (when used for representing integers) @@ -116,6 +118,7 @@ private static char digitToBasic(int digit, boolean uppercase) { return (char) ((ZERO - 26) + digit); } } + /** * Converts Unicode to Punycode. The input string must not contain single, unpaired surrogates. * The output will be represented as an array of ASCII code points. @@ -266,14 +269,17 @@ public static StringBuffer encode(StringBuffer src, boolean[] caseFlags) private static boolean isBasic(int ch) { return (ch < INITIAL_N); } + /// CLOVER:OFF private static boolean isBasicUpperCase(int ch) { return (CAPITAL_A <= ch && ch >= CAPITAL_Z); } + /// CLOVER:ON private static boolean isSurrogate(int ch) { return (((ch) & 0xfffff800) == 0xd800); } + /** * Converts Punycode to Unicode. The Unicode string will be at most as long as the Punycode * string. diff --git a/unicodetools/src/main/java/org/unicode/idna/StringPrepData.java b/unicodetools/src/main/java/org/unicode/idna/StringPrepData.java index ded575a3c..a17c398b6 100644 --- a/unicodetools/src/main/java/org/unicode/idna/StringPrepData.java +++ b/unicodetools/src/main/java/org/unicode/idna/StringPrepData.java @@ -18,6 +18,7 @@ public class StringPrepData { private static final boolean DEBUG = getDebugFlag(StringPrepData.class); + /** * 3. Mapping This profile specifies mapping using the following tables from [STRINGPREP]: Table * B.1 Table B.2 4. Normalization This profile specifies using Unicode normalization form KC, as diff --git a/unicodetools/src/main/java/org/unicode/idna/Uts46.java b/unicodetools/src/main/java/org/unicode/idna/Uts46.java index 0e7ec4e12..1f4c10a50 100644 --- a/unicodetools/src/main/java/org/unicode/idna/Uts46.java +++ b/unicodetools/src/main/java/org/unicode/idna/Uts46.java @@ -185,6 +185,7 @@ public boolean handleLine(int start, int end, String[] items) { static final UnicodeSet EN = new UnicodeSet("[[:bc=EN:]]").freeze(); static final UnicodeSet AN = new UnicodeSet("[[:bc=AN:]]").freeze(); static final UnicodeSet NSM = new UnicodeSet("[[:bc=NSM:]]").freeze(); + /** * Checks a string for IDNA2008 bidi errors. label must not be empty * diff --git a/unicodetools/src/main/java/org/unicode/jsp/FileUtilities.java b/unicodetools/src/main/java/org/unicode/jsp/FileUtilities.java index 7b8028da0..6e0923460 100644 --- a/unicodetools/src/main/java/org/unicode/jsp/FileUtilities.java +++ b/unicodetools/src/main/java/org/unicode/jsp/FileUtilities.java @@ -123,6 +123,7 @@ public SemiFileReader process(BufferedReader in, String fileName) { protected void processComment(String line, int comment) {} } + // // public static SemiFileReader fillMapFromSemi(Class classLocation, String fileName, // SemiFileReader handler) { diff --git a/unicodetools/src/main/java/org/unicode/parse/Pick.java b/unicodetools/src/main/java/org/unicode/parse/Pick.java index 1eadd25d6..02cbb8346 100644 --- a/unicodetools/src/main/java/org/unicode/parse/Pick.java +++ b/unicodetools/src/main/java/org/unicode/parse/Pick.java @@ -55,6 +55,7 @@ public String toString() { public abstract String toString(int depth); public abstract String getInternal(int depth, Set alreadySeen); + // Internals protected String name; @@ -130,6 +131,7 @@ public String getInternal(int depth, Set alreadySeen) { } return result + ")"; } + // keep private private Alternation() { sep = "|"; @@ -303,6 +305,7 @@ public String toString(int depth) { abstract static class Visitor { Set already = new HashSet(); + // Note: each visitor should return the Pick that will replace a (or a itself) abstract Pick handle(Pick a); diff --git a/unicodetools/src/main/java/org/unicode/props/BagFormatter.java b/unicodetools/src/main/java/org/unicode/props/BagFormatter.java index a19032f4e..fa0279aff 100644 --- a/unicodetools/src/main/java/org/unicode/props/BagFormatter.java +++ b/unicodetools/src/main/java/org/unicode/props/BagFormatter.java @@ -95,6 +95,7 @@ public void showSetDifferences( PrintWriter pw, String name1, UnicodeSet set1, String name2, UnicodeSet set2) { showSetDifferences(pw, name1, set1, name2, set2, -1); } + /** * Compare two UnicodeSets, and show the differences * @@ -775,6 +776,7 @@ private static class NameIterator { this.source = source; this.limit = source.length(); } + /** * Find next word, including trailing spaces * @@ -811,6 +813,7 @@ static int findMatchingEnd(String s1, String s2) { private class RangeFinder { int start, limit; private int veryLimit; + // String label, value; void reset(int rangeStart, int rangeLimit) { limit = rangeStart; @@ -1222,6 +1225,7 @@ public BagFormatter setRangeBreakSource(UnicodeLabel label) { public Transliterator getFixName() { return fixName; } + /** * @param fixName The fixName to set. */ diff --git a/unicodetools/src/main/java/org/unicode/props/IndexUnicodeProperties.java b/unicodetools/src/main/java/org/unicode/props/IndexUnicodeProperties.java index 1d16677ff..e0f0cf172 100644 --- a/unicodetools/src/main/java/org/unicode/props/IndexUnicodeProperties.java +++ b/unicodetools/src/main/java/org/unicode/props/IndexUnicodeProperties.java @@ -59,6 +59,7 @@ public class IndexUnicodeProperties extends UnicodeProperty.Factory { public static final String UNCHANGED_IN_BASE_VERSION = "πŸ‘‰ SEE OTHER VERSION OF UNICODE"; static final String SET_SEPARATOR = "|"; + /** Control file caching */ static final boolean GZIP = true; diff --git a/unicodetools/src/main/java/org/unicode/props/PropNormalizationData.java b/unicodetools/src/main/java/org/unicode/props/PropNormalizationData.java index d0418276c..0c220ca02 100644 --- a/unicodetools/src/main/java/org/unicode/props/PropNormalizationData.java +++ b/unicodetools/src/main/java/org/unicode/props/PropNormalizationData.java @@ -17,6 +17,7 @@ public class PropNormalizationData implements org.unicode.text.UCD.Normalization final UnicodeMap nfd = new UnicodeMap<>(); final UnicodeMap nfkd = new UnicodeMap<>(); final UnicodeMap> pairwiseComposition; + // TODO find out why UnicodeMap[] fails hashCode public PropNormalizationData(IndexUnicodeProperties properties) { diff --git a/unicodetools/src/main/java/org/unicode/props/PropertyParsingInfo.java b/unicodetools/src/main/java/org/unicode/props/PropertyParsingInfo.java index 48b3e4055..68ff0d963 100644 --- a/unicodetools/src/main/java/org/unicode/props/PropertyParsingInfo.java +++ b/unicodetools/src/main/java/org/unicode/props/PropertyParsingInfo.java @@ -83,6 +83,7 @@ enum SpecialProperty { public static final Pattern EQUALS = Pattern.compile("\\s*=\\s*"); public static final Pattern COMMA = Pattern.compile("\\s*,\\s*"); public static final Pattern DECOMP_REMOVE = Pattern.compile("\\{[^}]+\\}|\\<[^>]+\\>"); + /** General constants */ public static final Pattern SEMICOLON = Pattern.compile("\\s*;\\s*"); @@ -1336,7 +1337,7 @@ private static void parseMissingFromValueAliases(Iterable aliasesLines) line.getOriginalLine(), line.getParts()[1], line.getParts()[2], - /* isEmpty=*/ false, + /* isEmpty= */ false, last_applicable_version); } } diff --git a/unicodetools/src/main/java/org/unicode/props/PropertyUtilities.java b/unicodetools/src/main/java/org/unicode/props/PropertyUtilities.java index a9d7e5804..e2e9c1708 100644 --- a/unicodetools/src/main/java/org/unicode/props/PropertyUtilities.java +++ b/unicodetools/src/main/java/org/unicode/props/PropertyUtilities.java @@ -14,6 +14,7 @@ public static interface Merge { public static final class Joiner implements Merge { static String separator; + /** * @param separator */ diff --git a/unicodetools/src/main/java/org/unicode/props/RandomStringGenerator.java b/unicodetools/src/main/java/org/unicode/props/RandomStringGenerator.java index e11371f55..b93e4ee52 100644 --- a/unicodetools/src/main/java/org/unicode/props/RandomStringGenerator.java +++ b/unicodetools/src/main/java/org/unicode/props/RandomStringGenerator.java @@ -25,6 +25,7 @@ public class RandomStringGenerator { * debugging. */ public static UnicodeSet DEBUG_REDUCE_SET_SIZE = null; // new + // UnicodeSet("[\\u0000-\\u00FF\\u0300-\\u03FF\\u2000-\\u20FF]"); // // new UnicodeSet("[\\u0000-\\u00FF\\u2000-\\u20FF]"); // // or null diff --git a/unicodetools/src/main/java/org/unicode/props/ScriptInfo.java b/unicodetools/src/main/java/org/unicode/props/ScriptInfo.java index 99519d106..9c1ee309d 100644 --- a/unicodetools/src/main/java/org/unicode/props/ScriptInfo.java +++ b/unicodetools/src/main/java/org/unicode/props/ScriptInfo.java @@ -83,6 +83,7 @@ public static class IdentifierVersionInfo { private final UnicodeMap numericValue; private final UnicodeMap> scriptExtensions; private final Map scriptExtensionsFlattened; + // private final UnicodeMap script; public IdentifierVersionInfo(String version) { diff --git a/unicodetools/src/main/java/org/unicode/props/UcdLineParser.java b/unicodetools/src/main/java/org/unicode/props/UcdLineParser.java index c17f3c326..6b65b8153 100644 --- a/unicodetools/src/main/java/org/unicode/props/UcdLineParser.java +++ b/unicodetools/src/main/java/org/unicode/props/UcdLineParser.java @@ -73,6 +73,7 @@ public enum Contents { private final boolean withRange; private final boolean withMissing; private final Iterator rawLines; + /** Code points covered by @missing lines for less than all of Unicode. */ private final UnicodeSet missingSet = new UnicodeSet(); @@ -210,6 +211,7 @@ public String[] getParts() { public IntRange getRange() { return intRange; } + /** * @return Code points covered by @missing lines for less than all of Unicode. */ diff --git a/unicodetools/src/main/java/org/unicode/text/UCA/CompareDucetToCldr.java b/unicodetools/src/main/java/org/unicode/text/UCA/CompareDucetToCldr.java index df8721d7f..91b09a09b 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCA/CompareDucetToCldr.java +++ b/unicodetools/src/main/java/org/unicode/text/UCA/CompareDucetToCldr.java @@ -241,6 +241,7 @@ public Weight(boolean variable, int parseInt, int parseInt2, int parseInt3) { secondary = parseInt2; tertiary = parseInt2; } + // 0EC4 0E9C ; [.24BE.0020.0002.0E9C][.24DC.0020.001F.0EC4] static WeightList parse(String input) { final List result = new ArrayList(); diff --git a/unicodetools/src/main/java/org/unicode/text/UCA/Fractional.java b/unicodetools/src/main/java/org/unicode/text/UCA/Fractional.java index 1d5e22bbf..1e5361ba2 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCA/Fractional.java +++ b/unicodetools/src/main/java/org/unicode/text/UCA/Fractional.java @@ -17,6 +17,7 @@ public final class Fractional { /** Common (default) secondary weight. */ public static final int COMMON_SEC = 5; + /** * Top of the byte range for compressing a sequence of common secondary weights into a single * sort key byte. @@ -25,8 +26,10 @@ public final class Fractional { * for tailoring secondary-after a primary CE with a common secondary. */ public static final int COMMON_SEC_TOP = 0x45; + /** First non-common secondary weight byte used in FractionalUCA.txt. */ public static final int FIRST_SEC_ASSIGNED = 0x70; + /** * First secondary weight byte of any secondary CE (primary ignorable). Not actually assigned in * FractionalUCA.txt. @@ -35,8 +38,10 @@ public final class Fractional { * a gap for tailoring secondary-before the first secondary CE. */ public static final int FIRST_IGNORABLE_SEC = 0x80; + /** First secondary weight byte of any secondary CE in FractionalUCA.txt. */ public static final int FIRST_IGNORABLE_SEC_ASSIGNED = 0x82; + /** * First secondary weight byte after secondary CEs in FractionalUCA.txt. * @@ -53,13 +58,16 @@ public final class Fractional { * tailoring tertiary-after a primary or secondary CE with a common tertiary. */ public static final int COMMON_TER = 5; + /** First non-common tertiary weight byte used in FractionalUCA.txt. */ public static final int FIRST_TER_ASSIGNED = 0x10; + /** * First non-common tertiary weight byte used in FractionalUCA.txt for primary+secondary with * very few distinct tertiary weights. */ public static final int FIRST_TER_FEW_ASSIGNED = 0x20; + /** * First tertiary weight byte of any tertiary CE (secondary ignorable). Not actually assigned in * FractionalUCA.txt. @@ -68,11 +76,13 @@ public final class Fractional { * a gap for tailoring tertiary-before the first tertiary CE. */ public static final int FIRST_IGNORABLE_TER = 0x3C; + /** * First tertiary weight byte of any tertiary CE in FractionalUCA.txt. There are none in UCA 6.3 * or earlier. */ public static final int FIRST_IGNORABLE_TER_ASSIGNED = 0x3D; + /** * First tertiary weight byte after tertiary CEs in FractionalUCA.txt. * diff --git a/unicodetools/src/main/java/org/unicode/text/UCA/Implicit.java b/unicodetools/src/main/java/org/unicode/text/UCA/Implicit.java index 8efef04ed..283d1af9c 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCA/Implicit.java +++ b/unicodetools/src/main/java/org/unicode/text/UCA/Implicit.java @@ -15,18 +15,22 @@ public class Implicit { /** Start of implicit primaries. */ static final int START = 0xFB00; + /** * First primary weight available for ranges. Intended for siniform ideographic scripts, * starting with Tangut in UCA 9. */ static final int RANGES_BASE = 0xFB00; + /** * Base primary weight for the original CJK Unihan block & non-decomposable CJK compatibility * characters. */ static final int CJK_BASE = 0xFB40; + /** Base primary weight for CJK extensions blocks. */ static final int CJK_EXTENSIONS_BASE = 0xFB80; + /** * Base primary weight for unassigned code points. Formally, this is used for characters that * have neither explicit DUCET mappings nor implicit mappings according to any other rule. @@ -34,6 +38,7 @@ public class Implicit { static final int UNASSIGNED_BASE = 0xFBC0; static final int UNASSIGNED_LIMIT = 0xFC00; + /** End of implicit primaries, start of trailing ones. */ static final int LIMIT = 0xFC00; @@ -54,8 +59,10 @@ static final class Range { final int leadPrimary; int startCP; int endCP; + /** First assigned code point in the range. */ int firstCP; + /** Last assigned code point in the range. */ int lastCP; diff --git a/unicodetools/src/main/java/org/unicode/text/UCA/MappingsForFractionalUCA.java b/unicodetools/src/main/java/org/unicode/text/UCA/MappingsForFractionalUCA.java index f1b094752..d5a0b2107 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCA/MappingsForFractionalUCA.java +++ b/unicodetools/src/main/java/org/unicode/text/UCA/MappingsForFractionalUCA.java @@ -32,13 +32,16 @@ public final class MappingsForFractionalUCA { private final String prefix; private final String s; + /** Only non-zero collation elements, enforced by the constructors. */ private final CEList ces; + /** * Modified CEs, if any. If not null, then these are the CEs to be transformed into * fractional CEs. */ private CEList modifiedCEs; + /** Standard 3-level UCA sort key "string" corresponding to ces. */ private final String sortKey; diff --git a/unicodetools/src/main/java/org/unicode/text/UCA/PrimariesToFractional.java b/unicodetools/src/main/java/org/unicode/text/UCA/PrimariesToFractional.java index 9e630447f..34ef90337 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCA/PrimariesToFractional.java +++ b/unicodetools/src/main/java/org/unicode/text/UCA/PrimariesToFractional.java @@ -38,6 +38,7 @@ public final class PrimariesToFractional { /** Maps UCA primaries to PrimaryToFractional objects. */ private PrimaryToFractional[] primaryProps; + // Put special properties into slots not used for UCA primaries. private static final int IMPLICIT_RANGES_INDEX = 0x10; private static final int HAN_INDEX = 0x50; @@ -55,6 +56,7 @@ private static final class ScriptOptions { boolean beginsByte; boolean endsByte; + /** * If true, then primary weights of this group/script all have the same lead byte and are * therefore compressible when writing sort keys. We need to know this before assigning @@ -69,8 +71,10 @@ private static final class ScriptOptions { /** First UCA primary weight for this script. */ int firstPrimary; + /** The script-first fractional primary inserted before the normal fractional primary. */ int scriptFirstFractional; + /** true until the script-first fractional primary has been written. */ boolean needToWriteScriptFirstFractional = true; @@ -85,11 +89,13 @@ ScriptOptions wholeByte() { beginsByte = endsByte = true; return this; } + /** Start with a new primary lead byte. */ ScriptOptions newByte() { beginsByte = true; return this; } + /** End with the top of a primary lead byte. */ ScriptOptions finishByte() { endsByte = true; @@ -135,6 +141,7 @@ ScriptOptions minimalGap3() { /** FractionalUCA properties for a UCA primary weight. */ public static class PrimaryToFractional { private ScriptOptions options; + /** * true if this primary is at the start of a group or script that begins with a new primary * lead byte. @@ -146,6 +153,7 @@ public static class PrimaryToFractional { private boolean useThreeBytePrimary; private int fractionalPrimary; + /** * Stores fractional primaries for a siniform ideographic range, otherwise null. Offset by * options.implicitRange.startCP. 0 for unassigned code points. @@ -160,6 +168,7 @@ public static class PrimaryToFractional { int neutralSec = -1; int neutralTer = -1; + /** * {@link PrimaryToFractional} serves as a container for {@link SecTerToFractional}. {@link * PrimaryToFractional} does not set or use this reference at all. We just avoid yet another diff --git a/unicodetools/src/main/java/org/unicode/text/UCA/RadicalStroke.java b/unicodetools/src/main/java/org/unicode/text/UCA/RadicalStroke.java index 4d6f5a9f1..71f6d9f0a 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCA/RadicalStroke.java +++ b/unicodetools/src/main/java/org/unicode/text/UCA/RadicalStroke.java @@ -16,6 +16,7 @@ public final class RadicalStroke { private static final int MAX_RADICAL_NUMBER = 214; + /** * The Unicode 1.1 Unihan block was U+4E00..U+9FA5. The ideographs there were allocated in * radical-stroke order, but some of the radical-stroke data was changed later. @@ -27,16 +28,22 @@ public final class RadicalStroke { private static final int SIMPLIFIED_NUM_BITS = 2; private String unicodeVersion; + /** Han character data in code point order. */ private long[] rawHan; + /** Han character data in UCA radical-stroke order. */ private long[] orderedHan; + /** Maps radicalNumberAndSimplified to the radical character. */ private String[] radToChar = new String[(MAX_RADICAL_NUMBER + 1) << SIMPLIFIED_NUM_BITS]; + /** Maps radicalNumberAndSimplified to the radical character and its ideograph sibling. */ private String[] radToChars = new String[(MAX_RADICAL_NUMBER + 1) << SIMPLIFIED_NUM_BITS]; + /** Radical strings. Avoid constructing them over and over. */ private String[] radicalStrings = new String[(MAX_RADICAL_NUMBER + 1) << SIMPLIFIED_NUM_BITS]; + /** * Han characters for which code point order == radical-stroke order. Hand-picked exceptions * that are hard to detect optimally (because there are 2 or 3 in a row out of order) are diff --git a/unicodetools/src/main/java/org/unicode/text/UCA/SecTerToFractional.java b/unicodetools/src/main/java/org/unicode/text/UCA/SecTerToFractional.java index 49f112567..d2798e38f 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCA/SecTerToFractional.java +++ b/unicodetools/src/main/java/org/unicode/text/UCA/SecTerToFractional.java @@ -33,6 +33,7 @@ public final class SecTerToFractional { // and the associated tertiaries (if there are non-trivial ones). private static final int UCA_TERTIARY_LIMIT = UCA_Types.MAX_TERTIARY + 1; + /** * If true, then we store the secondary and tertiary weights for CEs like [00, 00, tt] and [00, * ss, tt]. ss cannot be the common weight. {@link #commonSecTs2f} stores the tertiary weights @@ -45,6 +46,7 @@ public final class SecTerToFractional { private final boolean isPrimaryIgnorable; private int commonSecLowestUCATer; + /** * Tertiaries for the 00 or common secondary weight. null if only 00 and common tertiary * weights. @@ -52,12 +54,14 @@ public final class SecTerToFractional { * @see #isPrimaryIgnorable */ private int[] commonSecTs2f; + /** Secondaries-to-fractional. */ private Map ss2f; private static final class SecondaryToFractional { private int fractionalSecondary; private int lowestUCATer; + /** Tertiaries-to-fractional. */ private int[] ts2f; } diff --git a/unicodetools/src/main/java/org/unicode/text/UCA/UCA.java b/unicodetools/src/main/java/org/unicode/text/UCA/UCA.java index 9dd57d249..35f361b0e 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCA/UCA.java +++ b/unicodetools/src/main/java/org/unicode/text/UCA/UCA.java @@ -313,6 +313,7 @@ public String getSortKey(String sourceString) { return getSortKey( null, sourceString, defaultAlternate, defaultDecomposition, AppendToCe.none); } + /** * Constructs a sort key for a string of input Unicode characters. Uses default value * decomposition. @@ -779,6 +780,7 @@ public static int makeKey(int primary, int secondary, int tertiary) { public static String toString(String sortKey) { return toString(sortKey, Integer.MAX_VALUE); } + /** Produces a human-readable string for a sort key. The 0000 separator is replaced by a '|' */ public static String toString(String sortKey, int level) { final StringBuffer result = new StringBuffer(); @@ -1757,12 +1759,14 @@ private void checkUnique(char value, int result, int fourth, String line) { uniqueTable.put(ceObj, new Character(value)); } } + /** * @return Returns the fileVersion. */ public String getFileVersion() { return fileVersion; } + /** * @return the path (directory) where we write collation output files. */ diff --git a/unicodetools/src/main/java/org/unicode/text/UCA/UCA_Statistics.java b/unicodetools/src/main/java/org/unicode/text/UCA/UCA_Statistics.java index d27057841..7569c21b9 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCA/UCA_Statistics.java +++ b/unicodetools/src/main/java/org/unicode/text/UCA/UCA_Statistics.java @@ -34,6 +34,7 @@ public class UCA_Statistics { UnicodeSet variantSecondaries = new UnicodeSet(0x0153, 0x0154); // TODO, fix UnicodeSet digitSecondaries = new UnicodeSet(0x155, 0x017F); // TODO, fix UnicodeSet homelessSecondaries; + /** Just for statistics */ int lastUniqueVariable = 0; diff --git a/unicodetools/src/main/java/org/unicode/text/UCA/WriteCollationData.java b/unicodetools/src/main/java/org/unicode/text/UCA/WriteCollationData.java index f3b902606..5ea361da7 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCA/WriteCollationData.java +++ b/unicodetools/src/main/java/org/unicode/text/UCA/WriteCollationData.java @@ -1738,6 +1738,7 @@ static final String quoteOperand(String s) { // Do not print a full date+time, to reduce gratuitous file changes. private static DateFormat myDateFormat = new SimpleDateFormat("yyyy-MM-dd"); + // was "yyyy-MM-dd','HH:mm:ss' GMT'" in UCA 6.2 static String getNormalDate() { diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/BuildNames.java b/unicodetools/src/main/java/org/unicode/text/UCD/BuildNames.java index 526d7d303..56e044dbb 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/BuildNames.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/BuildNames.java @@ -292,6 +292,7 @@ static void collectWords() throws IOException { + ", " + (CompactName.lastToken * 4)); } + /* Set stuff = new TreeSet(); for (int i = 0; i < letters.length; ++i) { diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/CheckICU.java b/unicodetools/src/main/java/org/unicode/text/UCD/CheckICU.java index 8cad89ce8..87b7314eb 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/CheckICU.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/CheckICU.java @@ -224,6 +224,7 @@ private static void checkUCD() throws IOException { bf.showSetNames(pw, new UnicodeSet(trailing).removeAll(leading)); pw.close(); } + /* * int icuType; int toolType; diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/ConvertUCD.java b/unicodetools/src/main/java/org/unicode/text/UCD/ConvertUCD.java index 54420ec01..b37f41ae6 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/ConvertUCD.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/ConvertUCD.java @@ -158,6 +158,7 @@ public final class ConvertUCD implements UCD_Types { } } } + /* static String[][] labelList31 = { // Labels for the incoming files. Labels MUST match field order in file. @@ -371,6 +372,7 @@ void toJava(String version) throws Exception { } static PrintWriter log; + // static String directory = BASE_DIR; // static Map appendDuplicates = new HashMap(); @@ -850,6 +852,7 @@ UData getEntry(int cp) { getEntryUData = charEntry; return charEntry; } + /** Adds the character data. Signals duplicates with an exception */ void setBinaryProperty(int cp, int binProp) { final UData charEntry = getEntry(cp); diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/DerivedProperty.java b/unicodetools/src/main/java/org/unicode/text/UCD/DerivedProperty.java index 57a04af4a..62a6e3ecf 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/DerivedProperty.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/DerivedProperty.java @@ -134,6 +134,7 @@ public boolean hasValue(int cp) { class NF_UnsafeStartProp extends UCDProperty { Normalizer nfx; + // int prop; NF_UnsafeStartProp(int i) { diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/GenerateBreakTest.java b/unicodetools/src/main/java/org/unicode/text/UCD/GenerateBreakTest.java index df1f72103..90ee282b8 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/GenerateBreakTest.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/GenerateBreakTest.java @@ -3095,6 +3095,7 @@ public int previousBase() { return result; } } + /* * * if (false) { diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/GenerateConfusables.java b/unicodetools/src/main/java/org/unicode/text/UCD/GenerateConfusables.java index b1870c111..f3001ed3f 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/GenerateConfusables.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/GenerateConfusables.java @@ -381,6 +381,7 @@ private static void addLatin(Map mapping, String fileName) throw + "|\\\\U([a-fA-F0-9]{6})" + "|\\\\u\\{([a-fA-F0-9]{1,6})\\}") .matcher(""); + /** * Convert a string with a mixture of hex and normal characters. Anything like the following is * converted from hex to chars and all spaces are removed hexChar = \b[A-F0-9]{4,6}\b | @@ -574,6 +575,7 @@ private static void generateIDN() throws IOException { // static final String PROHIBITED = "Restricted ; "; // static final String UNPROHIBITED = "Allowed ; "; private static final boolean suppress_NFKC = true; + /** */ /** */ @@ -1484,6 +1486,7 @@ public int compare(Pair o1, Pair o2) { : UCAComparator.compare(o1.getSecond(), o2.getSecond()); } }; + /** * @param skipNFKEquivs TODO * @param onlyLowercase TODO @@ -1606,6 +1609,7 @@ private void checkChar(String string) { public Set getEquivalences(String string) { return dataMixedAnycase.getEquivalences(string); } + /* */ /** */ /* @@ -1693,6 +1697,7 @@ public void close(String reason) { // dataSingleAnycase.close(reason); // dataSingleLowercase.close(reason); } + /** */ public void addUnicodeMap(UnicodeMap decompMap, String type, String errorLine) { int count = 0; @@ -1732,6 +1737,7 @@ public boolean test(String item) { } } ; + /** * @param script TODO * @throws IOException @@ -1933,6 +1939,7 @@ public void writeWholeScripts(String outdir, String filename) throws IOException wsAny.write(out); out.close(); } + /** */ // private String getStatus(String source) { // // TODO Auto-generated method stub @@ -2331,6 +2338,7 @@ private static void generateConfusables( // DataSet clean = total.clean(); // clean.write(outdir, "confusables.txt", true); } + /* BufferedReader in = FileUtilities.openUTF8Reader(Utility.BASE_DIR + "confusables/", "DiacriticFolding.txt"); Set set = new TreeSet(new ArrayComparator(new Comparator[] {new UTF16.StringComparator(), @@ -2468,6 +2476,7 @@ private static void gen() throws IOException { */ private static _BetterTargetIsLess betterTargetIsLess = new _BetterTargetIsLess(false); + // private static _BetterTargetIsLess betterTargetIsLessFavorNeutral = new // _BetterTargetIsLess(true); @@ -2557,6 +2566,7 @@ public int compare(String a, String b) { } return codepointComparator.compare(a, b); } + // private static final int BAD = 1000; private int getValue(String a) { // lower is better diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/GenerateConfusablesCopy.java b/unicodetools/src/main/java/org/unicode/text/UCD/GenerateConfusablesCopy.java index 420da88a1..0c42217fe 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/GenerateConfusablesCopy.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/GenerateConfusablesCopy.java @@ -329,6 +329,7 @@ private static void addLatin(Map mapping, String fileName) throw + "|\\\\U([a-fA-F0-9]{6})" + "|\\\\u\\{([a-fA-F0-9]{1,6})\\}") .matcher(""); + /** * Convert a string with a mixture of hex and normal characters. Anything like the following is * converted from hex to chars and all spaces are removed hexChar = \b[A-F0-9]{4,6}\b | @@ -745,6 +746,7 @@ public boolean replaceBy(Reason possibleReplacement) { && possibleReplacement == limited_use; // && this != historic; } } + /** */ private void loadFileData() throws IOException { BufferedReader br; @@ -1240,6 +1242,7 @@ public Object compose(int codePoint, String string, Object a, Object b) { private static final String UNPROHIBITED = "allowed ; "; private static final String NOT_IN_XID = "not in XID+"; private static final boolean suppress_NFKC = true; + /** */ /** */ @@ -2203,6 +2206,7 @@ public int compare(Pair o1, Pair o2) { : UCAComparator.compare(o1.getSecond(), o2.getSecond()); } }; + /** * @param skipNFKEquivs TODO * @param onlyLowercase TODO @@ -2321,6 +2325,7 @@ private void checkChar(String string) { public Set getEquivalences(String string) { return dataMixedAnycase.getEquivalences(string); } + /* */ /** */ /* @@ -2408,6 +2413,7 @@ public void close(String reason) { // dataSingleAnycase.close(reason); // dataSingleLowercase.close(reason); } + /** */ public void addUnicodeMap(UnicodeMap decompMap, String type, String errorLine) { int count = 0; @@ -2447,6 +2453,7 @@ public boolean test(String item) { } } ; + /** * @param script TODO * @throws IOException @@ -2647,6 +2654,7 @@ public void writeWholeScripts(String outdir, String filename) throws IOException wsAny.write(out); out.close(); } + /** */ // private String getStatus(String source) { // // TODO Auto-generated method stub @@ -3044,6 +3052,7 @@ private static void generateConfusables(String indir, String outdir) throws IOEx // DataSet clean = total.clean(); // clean.write(outdir, "confusables.txt", true); } + /* BufferedReader in = FileUtilities.openUTF8Reader(Utility.BASE_DIR + "confusables/", "DiacriticFolding.txt"); Set set = new TreeSet(new ArrayComparator(new Comparator[] {new UTF16.StringComparator(), @@ -3272,6 +3281,7 @@ public int compare(String a, String b) { } return codepointComparator.compare(a, b); } + // private static final int BAD = 1000; private int getValue(String a) { // lower is better diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/GenerateHanTransliterator.java b/unicodetools/src/main/java/org/unicode/text/UCD/GenerateHanTransliterator.java index b61c527bd..2d2715e12 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/GenerateHanTransliterator.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/GenerateHanTransliterator.java @@ -2632,6 +2632,7 @@ static String removeMatched(String source, char start, char end, String original Transliterator.getInstance("katakana-hiragana"); static final UnicodeSet kana = new UnicodeSet("[[:hiragana:][:katakana:]\u30FC]"); + // since we are working in NFC, we don't worry about the combining marks. // ADD Factory since otherwise getInverse blows out diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/GenerateStringPrep.java b/unicodetools/src/main/java/org/unicode/text/UCD/GenerateStringPrep.java index d135c05a0..b7b788192 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/GenerateStringPrep.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/GenerateStringPrep.java @@ -309,6 +309,7 @@ public Object compose(int codepoint, String string, Object a, Object b) { } static final int OK = 0, DELETED = 1, ILLEGAL = 2, REMAPPED = 3, IDNA_TYPE_LIMIT = 4; + /** */ public static int getIDNAType(int cp) { inbuffer.setLength(0); diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/IdentifierInfo.java b/unicodetools/src/main/java/org/unicode/text/UCD/IdentifierInfo.java index ce7739a83..aa80c7fd3 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/IdentifierInfo.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/IdentifierInfo.java @@ -389,6 +389,7 @@ public static Set fromStringSet(String strings) { return results; } } + /** */ private void loadFileData() throws IOException { BufferedReader br; diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/MakeUnicodeFiles.java b/unicodetools/src/main/java/org/unicode/text/UCD/MakeUnicodeFiles.java index 49067dab8..0c14d0f2d 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/MakeUnicodeFiles.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/MakeUnicodeFiles.java @@ -1655,6 +1655,7 @@ public int compare(String o1, String o2) { return Double.compare(Double.parseDouble(o1), Double.parseDouble(o2)); } }; + /* private static void writeBinaryValues( PrintWriter pw, @@ -1676,7 +1677,7 @@ private static void writeKenFile( pw, prop.getName(), prop, - /*showPropName=*/ false, + /* showPropName= */ false, ps.skipValue == null ? null : prop.getFirstValueAlias(ps.skipValue)); var source = ToolUnicodePropertySource.make(Default.ucdVersion()); UnicodeProperty generalCategory = source.getProperty("General_Category"); @@ -1780,6 +1781,7 @@ public int compare(String o1, String o2) { static class RestoreSpacesFilter extends UnicodeProperty.StringFilter { String skipValue; + /** * @param ps */ diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/NamesList.java b/unicodetools/src/main/java/org/unicode/text/UCD/NamesList.java index 6c557dfa9..abacb9753 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/NamesList.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/NamesList.java @@ -70,6 +70,7 @@ public enum Comment { static final String SP = "\\s+"; static final String OSP = "\\s*"; static final Pattern CHAR_PATTERN = Pattern.compile(CHAR); + // static final Matcher INVISIBLE = // UnicodeRegex.compile(TO_SUPPRESS.toPattern(true)).matcher(""); diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/QuickTest.java b/unicodetools/src/main/java/org/unicode/text/UCD/QuickTest.java index 9be015110..6a54b204f 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/QuickTest.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/QuickTest.java @@ -591,6 +591,7 @@ void add(int codePoint, int cuLen, int processedUnitLength, String processedStri } static final int skip = (1 << UCD.UNASSIGNED) | (1 << UCD.PRIVATE_USE) | (1 << UCD.SURROGATE); + /** */ private static void getLengths(String title, Normalizer normalizer) throws IOException { System.out.println(); diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/TestNameUniqueness.java b/unicodetools/src/main/java/org/unicode/text/UCD/TestNameUniqueness.java index a33197377..11b5f6bb5 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/TestNameUniqueness.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/TestNameUniqueness.java @@ -35,6 +35,7 @@ public static class NameIterator { String line; BufferedReader br; String[] pieces = new String[3]; + /** * @return null when done */ diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/ToolUnicodePropertySource.java b/unicodetools/src/main/java/org/unicode/text/UCD/ToolUnicodePropertySource.java index c45a9be94..582d42eec 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/ToolUnicodePropertySource.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/ToolUnicodePropertySource.java @@ -2360,6 +2360,7 @@ public IdnaType getIDNAType(int cp) { } static final Pattern WELL_FORMED_LANGUAGE_TAG = Pattern.compile("..."); // ... + // is // ugly // mess diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/UCD.java b/unicodetools/src/main/java/org/unicode/text/UCD/UCD.java index f3e3a4fda..ec0abca40 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/UCD.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/UCD.java @@ -1482,6 +1482,7 @@ public boolean isIdentifier(String s) { } return true; } + /* Middle Dot. Because most Catalan legacy data will be encoded in Latin-1, U+00B7 MIDDLE DOT needs to be allowed in . diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/UCDProperty.java b/unicodetools/src/main/java/org/unicode/text/UCD/UCDProperty.java index eff8149b0..01f45c3a3 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/UCDProperty.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/UCDProperty.java @@ -96,6 +96,7 @@ public String getFullName(byte style) { public String getFullName() { return getFullName(NORMAL); } + /** Get the property name. Style is SHORT, NORMAL, LONG */ public String getPropertyName(byte style) { if (style == NORMAL) { diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/UCD_Names.java b/unicodetools/src/main/java/org/unicode/text/UCD/UCD_Names.java index afed2aa65..397827417 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/UCD_Names.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/UCD_Names.java @@ -889,6 +889,7 @@ public final class UCD_Names implements UCD_Types { static String[] COMBINING_CLASS = new String[256]; static String[] LONG_COMBINING_CLASS = new String[256]; + // TODO clean this up, just a quick copy of code static { for (int style = SHORT; style <= LONG; ++style) { diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/UCD_Types.java b/unicodetools/src/main/java/org/unicode/text/UCD/UCD_Types.java index 43ae11d68..fa61f9bc6 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/UCD_Types.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/UCD_Types.java @@ -21,6 +21,7 @@ public interface UCD_Types { * end/limit of the range depends on the Unicode version, see UCD.java mapToRepresentative(). */ public static final int TANGUT_BASE = 0x17000; + // Unicode 9: // 17000;;Lo;0;L;;;;;N;;;;; // 187EC;;Lo;0;L;;;;;N;;;;; diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/UData.java b/unicodetools/src/main/java/org/unicode/text/UCD/UData.java index a77cc756d..18a523f7e 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/UData.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/UData.java @@ -55,6 +55,7 @@ class UData implements UCD_Types { byte Vertical_Orientation = VO_R; static final UData UNASSIGNED = new UData(); + // static final UData NONCHARACTER = new UData(); static { UNASSIGNED.name = ""; diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/UnifiedBinaryProperty.java b/unicodetools/src/main/java/org/unicode/text/UCD/UnifiedBinaryProperty.java index 0ca81bab9..12da58e9f 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/UnifiedBinaryProperty.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/UnifiedBinaryProperty.java @@ -18,6 +18,7 @@ public final class UnifiedBinaryProperty extends UCDProperty { int majorProp; int propValue; + // DerivedProperty dp; public static UCDProperty make(int propMask) { diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/UnifiedProperty.java b/unicodetools/src/main/java/org/unicode/text/UCD/UnifiedProperty.java index 9d5f81b8c..edb632acc 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/UnifiedProperty.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/UnifiedProperty.java @@ -20,6 +20,7 @@ public final class UnifiedProperty extends UCDProperty { int majorProp; + // DerivedProperty dp; public static UCDProperty make(int propMask) { diff --git a/unicodetools/src/main/java/org/unicode/text/tools/StringTree.java b/unicodetools/src/main/java/org/unicode/text/tools/StringTree.java index ca1018357..62e52015c 100644 --- a/unicodetools/src/main/java/org/unicode/text/tools/StringTree.java +++ b/unicodetools/src/main/java/org/unicode/text/tools/StringTree.java @@ -31,6 +31,7 @@ public class StringTree { public abstract static class CPNode> implements Iterable> { public static final int NO_VALUE = Integer.MIN_VALUE; + /** Not complete comparator !! * */ public static final Comparator DEPTH_FIRST = new Comparator() { diff --git a/unicodetools/src/main/java/org/unicode/text/tools/UnicodeSetTree.java b/unicodetools/src/main/java/org/unicode/text/tools/UnicodeSetTree.java index b232d69db..d3b8926b4 100644 --- a/unicodetools/src/main/java/org/unicode/text/tools/UnicodeSetTree.java +++ b/unicodetools/src/main/java/org/unicode/text/tools/UnicodeSetTree.java @@ -21,6 +21,7 @@ static class Node { public boolean add(UnicodeSet entry) { return add(new Node(entry)); } + // returns false if we don't need addition as a child. public boolean add(Node entry) { if (parent == null || parent.containsAll(entry.parent)) { diff --git a/unicodetools/src/main/java/org/unicode/text/tools/VerifyXmlUcd.java b/unicodetools/src/main/java/org/unicode/text/tools/VerifyXmlUcd.java index 2a8dae447..13e80b92a 100644 --- a/unicodetools/src/main/java/org/unicode/text/tools/VerifyXmlUcd.java +++ b/unicodetools/src/main/java/org/unicode/text/tools/VerifyXmlUcd.java @@ -141,6 +141,7 @@ private static void testFile(String file) throws IOException { static Set codepoints = getSet("char", "reserved", "noncharacter", "surrogate"); static Set skipProperties = getSet("cp", "first-cp", "last-cp"); + // static Set hexValue = getSet("slc", "bmg", "lc", "stc", "suc", "tc", "uc"); static Set getSet(String... strings) { diff --git a/unicodetools/src/main/java/org/unicode/text/utility/ChainException.java b/unicodetools/src/main/java/org/unicode/text/utility/ChainException.java index 641be8cd4..9ca118318 100644 --- a/unicodetools/src/main/java/org/unicode/text/utility/ChainException.java +++ b/unicodetools/src/main/java/org/unicode/text/utility/ChainException.java @@ -14,6 +14,7 @@ public class ChainException extends RuntimeException { Object[] keyData; String messageFormat; + // Exception chain; public ChainException(String messageFormat, Object[] objects) { diff --git a/unicodetools/src/main/java/org/unicode/text/utility/CompactByteArray.java b/unicodetools/src/main/java/org/unicode/text/utility/CompactByteArray.java index d59a11b70..e7d06ef19 100644 --- a/unicodetools/src/main/java/org/unicode/text/utility/CompactByteArray.java +++ b/unicodetools/src/main/java/org/unicode/text/utility/CompactByteArray.java @@ -130,6 +130,7 @@ public byte elementAt(char index) // parameterized on byte { return (values[(indices[index >>> BLOCKSHIFT] & 0xFFFF) + (index & BLOCKMASK)]); } + // Set automatically expands the array if it is compacted. // parameterized on value (byte) public void setElementAt(char index, byte value) { @@ -148,6 +149,7 @@ public void setElementAt(char start, char end, byte value) { values[i] = value; } } + // Compact the array. // The value of cycle determines how large the overlap can be. // A cycle of 1 is the most compacted, but takes the most time to do. @@ -203,6 +205,7 @@ public void compact() { isCompact = true; } // endif (isCompact != false) } + // Expanded takes the array back to a 65536 element array public void expand() { int i; @@ -220,6 +223,7 @@ public void expand() { isCompact = false; } } + // Print char Array : Debug only public void printIndex(short start, short count) { int i; @@ -243,6 +247,7 @@ public void printPlainArray(int start, int count, char[] tempIndex) { } System.out.println(" Range: start " + start + " , count " + count); } + // # of elements in the indexed array public short capacity() { return (short) values.length; diff --git a/unicodetools/src/main/java/org/unicode/text/utility/CompactShortArray.java b/unicodetools/src/main/java/org/unicode/text/utility/CompactShortArray.java index 5da763be3..293a0b388 100644 --- a/unicodetools/src/main/java/org/unicode/text/utility/CompactShortArray.java +++ b/unicodetools/src/main/java/org/unicode/text/utility/CompactShortArray.java @@ -74,6 +74,7 @@ public final class CompactShortArray implements Serializable { public CompactShortArray() { this((short) 0); } + /** * Constructor for CompactShortArray. * @@ -91,6 +92,7 @@ public CompactShortArray(short defaultValue) { } isCompact = false; } + /** * Constructor for CompactShortArray. * @@ -113,6 +115,7 @@ public CompactShortArray(short indexArray[], short newValues[]) indices = indexArray; values = newValues; } + /** * Get the mapped value of a Unicode character. * @@ -123,6 +126,7 @@ public short elementAt(char index) // parameterized on short { return (values[(indices[index >> BLOCKSHIFT] & 0xFFFF) + (index & BLOCKMASK)]); } + /** * Set a new value for a Unicode character. Set automatically expands the array if it is * compacted. @@ -136,6 +140,7 @@ public void setElementAt(char index, short value) { } values[index] = value; } + /** * Set new values for a range of Unicode character. * @@ -152,6 +157,7 @@ public void setElementAt(char start, char end, short value) { values[i] = value; } } + /** Compact the array. */ public void compact() { if (isCompact == false) { @@ -202,6 +208,7 @@ public void compact() { isCompact = true; } // endif (isCompact != false) } + /** * For internal use only. Do not modify the result, the behavior of modified results are * undefined. @@ -209,6 +216,7 @@ public void compact() { public short getIndexArray()[] { return indices; } + /** * For internal use only. Do not modify the result, the behavior of modified results are * undefined. @@ -216,6 +224,7 @@ public short getIndexArray()[] { public short getStringArray()[] { return values; } + // -------------------------------------------------------------- // package private // -------------------------------------------------------------- @@ -253,6 +262,7 @@ void writeArrays() { } System.out.println("(short)" + (int) getArrayValue(cnt - 1) + " }"); } + // Print char Array : Debug only void printIndex(short start, short count) { int i; @@ -276,6 +286,7 @@ void printPlainArray(int start, int count, char[] tempIndex) { } System.out.println(" Range: start " + start + " , count " + count); } + // -------------------------------------------------------------- // private // -------------------------------------------------------------- @@ -296,6 +307,7 @@ private void expand() { isCompact = false; } } + // # of elements in the indexed array private short capacity() { return (short) values.length; diff --git a/unicodetools/src/main/java/org/unicode/text/utility/FastUnicodeSet.java b/unicodetools/src/main/java/org/unicode/text/utility/FastUnicodeSet.java index 43c0ff86e..c6d0ec8cc 100644 --- a/unicodetools/src/main/java/org/unicode/text/utility/FastUnicodeSet.java +++ b/unicodetools/src/main/java/org/unicode/text/utility/FastUnicodeSet.java @@ -5,6 +5,7 @@ public final class FastUnicodeSet { static final int index1Length = 272; static final int index2Length = 64; + /** * Structured as a simple trie. The last level is a long (64 bits). It is accessed by taking * successive parts of the codepoint diff --git a/unicodetools/src/main/java/org/unicode/text/utility/IndentWriter.java b/unicodetools/src/main/java/org/unicode/text/utility/IndentWriter.java index 0a5582e06..f2fd890cd 100644 --- a/unicodetools/src/main/java/org/unicode/text/utility/IndentWriter.java +++ b/unicodetools/src/main/java/org/unicode/text/utility/IndentWriter.java @@ -58,6 +58,7 @@ public void setIndent(int indent) { public int getIndent() { return indent; } + /* public void write(String cbuf, int off, int len) throws IOException { if (buffer.length() + len > width) { diff --git a/unicodetools/src/main/java/org/unicode/text/utility/OldEquivalenceClass.java b/unicodetools/src/main/java/org/unicode/text/utility/OldEquivalenceClass.java index 6acdfecb6..1fe4f2450 100644 --- a/unicodetools/src/main/java/org/unicode/text/utility/OldEquivalenceClass.java +++ b/unicodetools/src/main/java/org/unicode/text/utility/OldEquivalenceClass.java @@ -20,6 +20,7 @@ public class OldEquivalenceClass { static final boolean DEBUG = false; + /** * Takes a many:many relation between source and value. Produces equivalence class. Two sources * are in the same equivalence class any time they share the same value. @@ -33,6 +34,7 @@ public class OldEquivalenceClass { Map valueToRepresentativeSource = new HashMap(); Map forcedMerge = new HashMap(); + /** * @return true if made a difference */ diff --git a/unicodetools/src/main/java/org/unicode/text/utility/Settings.java b/unicodetools/src/main/java/org/unicode/text/utility/Settings.java index b5beb7ea4..8729fbe06 100644 --- a/unicodetools/src/main/java/org/unicode/text/utility/Settings.java +++ b/unicodetools/src/main/java/org/unicode/text/utility/Settings.java @@ -183,12 +183,15 @@ public static final class UnicodeTools { */ public static final String UNICODETOOLS_REPO_DIR = getRequiredPathAndFix("UNICODETOOLS_REPO_DIR"); + // TODO: Try to make this private; see // https://github.com/unicode-org/unicodetools/issues/159 // Call sites should use more specific paths. public static final String UNICODETOOLS_DIR = UNICODETOOLS_REPO_DIR + "unicodetools/"; + /** Use this for files such as org/unicode/Whatever.java */ public static final String UNICODETOOLS_JAVA_DIR = UNICODETOOLS_DIR + "src/main/java/"; + /** Use this for package-relative data, such as org/unicode/SomeData.txt */ public static final String UNICODETOOLS_RSRC_DIR = UNICODETOOLS_DIR + "src/main/resources/"; @@ -317,8 +320,10 @@ public static void ensureOutputDir(String dir) { public static final String SRC_DIR = Utility.fixFileName(UnicodeTools.UNICODETOOLS_RSRC_DIR + "org/unicode/text") + "/"; + /** Used for data files */ public static final String SRC_UCA_DIR = SRC_DIR + "UCA/"; + /** Used for data files */ public static final String SRC_UCD_DIR = SRC_DIR + "UCD/"; } diff --git a/unicodetools/src/main/java/org/unicode/text/utility/TestUtility.java b/unicodetools/src/main/java/org/unicode/text/utility/TestUtility.java index 25923bbbc..83fcb07a5 100644 --- a/unicodetools/src/main/java/org/unicode/text/utility/TestUtility.java +++ b/unicodetools/src/main/java/org/unicode/text/utility/TestUtility.java @@ -191,6 +191,7 @@ private static void testHanProp(int iterations, int total, String pname, String static String outdircore = Settings.Output.GEN_DIR + "UCD_Data/"; static String outdir = outdircore + "4.1.0/"; + /** * @param pname */ diff --git a/unicodetools/src/main/java/org/unicode/text/utility/UnicodeTransform.java b/unicodetools/src/main/java/org/unicode/text/utility/UnicodeTransform.java index 4b984cb43..63a979ff0 100644 --- a/unicodetools/src/main/java/org/unicode/text/utility/UnicodeTransform.java +++ b/unicodetools/src/main/java/org/unicode/text/utility/UnicodeTransform.java @@ -46,10 +46,12 @@ public static synchronized UnicodeTransform getInstance(Type type) { public boolean isTransformed(String source) { return source.equals(transform(source)); } + /** Can be overridden for performance. */ public String transform(int source) { return transform(UTF16.valueOf(source)); } + /** Can be overridden for performance. */ public boolean isTransformed(int source) { return isTransformed(UTF16.valueOf(source)); diff --git a/unicodetools/src/main/java/org/unicode/text/utility/Utility.java b/unicodetools/src/main/java/org/unicode/text/utility/Utility.java index d780ef2fb..2eee75f80 100644 --- a/unicodetools/src/main/java/org/unicode/text/utility/Utility.java +++ b/unicodetools/src/main/java/org/unicode/text/utility/Utility.java @@ -176,6 +176,7 @@ public static String getSkeleton(String source) { /** Sutton SignWriting really does want to be in CamelCase without underscore. */ private static final String Signwriting = "Signwriting"; + /** * @see Signwriting */ diff --git a/unicodetools/src/main/java/org/unicode/text/utility/XMLParse.java b/unicodetools/src/main/java/org/unicode/text/utility/XMLParse.java index 72c6963f0..812972468 100644 --- a/unicodetools/src/main/java/org/unicode/text/utility/XMLParse.java +++ b/unicodetools/src/main/java/org/unicode/text/utility/XMLParse.java @@ -365,6 +365,7 @@ public static String hex(long i, int places) { } return result; } + // =================== PRIVATES ================================= private static final char[] buf2 = new char[2]; diff --git a/unicodetools/src/main/java/org/unicode/tools/GeneratePickerData.java b/unicodetools/src/main/java/org/unicode/tools/GeneratePickerData.java index 832cbfeed..235d9d960 100644 --- a/unicodetools/src/main/java/org/unicode/tools/GeneratePickerData.java +++ b/unicodetools/src/main/java/org/unicode/tools/GeneratePickerData.java @@ -2415,6 +2415,7 @@ public static UnicodeSet flatten(UnicodeSet exemplar1) { + "-[:script=katakana:]" + "-[〇]" + "]"); // we'll alter + // below to remove // iicore diff --git a/unicodetools/src/main/java/org/unicode/tools/Ids.java b/unicodetools/src/main/java/org/unicode/tools/Ids.java index a10f20486..6980657b1 100644 --- a/unicodetools/src/main/java/org/unicode/tools/Ids.java +++ b/unicodetools/src/main/java/org/unicode/tools/Ids.java @@ -192,6 +192,7 @@ public int compare2(String o1, String o2) { return o1.length() - o2.length(); } }; + // private static final UnicodeMap totalStrokes = iup.load(UcdProperty.kTotalStrokes); /** @@ -1783,6 +1784,7 @@ private static String show(List data) { } return b.append("").toString(); } + // Confusable /* βΌ– U+2F16 KANGXI RADICAL HIDING ENCLOSURE diff --git a/unicodetools/src/main/java/org/unicode/tools/Segmenter.java b/unicodetools/src/main/java/org/unicode/tools/Segmenter.java index 20559b54a..f630b199e 100644 --- a/unicodetools/src/main/java/org/unicode/tools/Segmenter.java +++ b/unicodetools/src/main/java/org/unicode/tools/Segmenter.java @@ -60,6 +60,7 @@ public enum Target { * debugging. */ public static UnicodeSet DEBUG_REDUCE_SET_SIZE = null; // new + // UnicodeSet("[\\u0000-\\u00FF\\u0300-\\u03FF\\u2000-\\u20FF]"); // // new UnicodeSet("[\\u0000-\\u00FF\\u2000-\\u20FF]"); // // or null @@ -135,6 +136,7 @@ public static Builder make(UnicodeProperty.Factory propFactory, String type, Tar BREAK_SOT = 0.2, BREAK_EOT = 0.3, BREAK_ANY = 999; + /** Convenience for formatting doubles */ public static NumberFormat nf = NumberFormat.getInstance(ULocale.ENGLISH); diff --git a/unicodetools/src/main/java/org/unicode/tools/emoji/BirthInfo.java b/unicodetools/src/main/java/org/unicode/tools/emoji/BirthInfo.java index ad1d61c4e..bc41e8148 100644 --- a/unicodetools/src/main/java/org/unicode/tools/emoji/BirthInfo.java +++ b/unicodetools/src/main/java/org/unicode/tools/emoji/BirthInfo.java @@ -56,6 +56,7 @@ static void checkYears() { static final UnicodeMap birthYear = new UnicodeMap(); static Map yearToEmoji; static Map emojiVersionToEmoji; + // static final UnicodeMap birthYearWithVarians = new UnicodeMap(); public static BirthInfo getBirthInfo(String s) { @@ -201,6 +202,7 @@ private static synchronized void buildYears() { emojiVersionToEmoji = ImmutableMap.copyOf(_emojiVersionToEmoji2); } } + /** * Return the year values, from largest to smallest * diff --git a/unicodetools/src/main/java/org/unicode/tools/emoji/CountEmoji.java b/unicodetools/src/main/java/org/unicode/tools/emoji/CountEmoji.java index a6fbfd0ab..024a485dc 100644 --- a/unicodetools/src/main/java/org/unicode/tools/emoji/CountEmoji.java +++ b/unicodetools/src/main/java/org/unicode/tools/emoji/CountEmoji.java @@ -518,6 +518,7 @@ public String toString() { public String toStringPlain() { return displayName; } + /** added to make migration easier */ public static Category getType(String s) { return getBucket(s); diff --git a/unicodetools/src/main/java/org/unicode/tools/emoji/Emoji.java b/unicodetools/src/main/java/org/unicode/tools/emoji/Emoji.java index 0e49cae2a..2006d5ec2 100644 --- a/unicodetools/src/main/java/org/unicode/tools/emoji/Emoji.java +++ b/unicodetools/src/main/java/org/unicode/tools/emoji/Emoji.java @@ -72,6 +72,7 @@ public class Emoji { * can be used to do link-checks. */ static final boolean ABBR = CldrUtility.getProperty("emoji-abbr", false); + // static final boolean EMOJI_BUILD_VERSION = CldrUtility.getProperty("emoji-version", false); /** @@ -90,6 +91,7 @@ public class Emoji { */ public static final boolean USE_PROPOSED = true; // set to true between the release of Emoji 5.0 & Unicode 10.0. (or similar + // situation) // Constants for versions @@ -112,6 +114,7 @@ public class Emoji { public static final VersionInfo VERSION1 = VersionInfo.getInstance(1); public static final VersionInfo VERSION0_7 = VersionInfo.getInstance(0, 7); public static final VersionInfo VERSION0_6 = VersionInfo.getInstance(0, 6); + // lic static final VersionInfo VERSION0_5 = VersionInfo.getInstance(0, 5, 2); // ALSO fix VersionToAge.java! @@ -790,6 +793,7 @@ public static String getLabelFromLine(Output> newLabel, String origi } return line; } + // private static final Transform WINDOWS_URL = new Transform() // { // public String transform(String s) { diff --git a/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiAnnotations.java b/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiAnnotations.java index 7a680de72..798f497c2 100644 --- a/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiAnnotations.java +++ b/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiAnnotations.java @@ -52,6 +52,7 @@ public enum Status { public static final EmojiAnnotations ANNOTATIONS_TO_CHARS = new EmojiAnnotations("en", EmojiOrder.STD_ORDER.codepointCompare); + /** * @deprecated Use {@link #EmojiAnnotations(String,Comparator,String...)} instead */ diff --git a/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiData.java b/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiData.java index 954a360fb..72fd6442c 100644 --- a/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiData.java +++ b/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiData.java @@ -170,6 +170,7 @@ private enum EmojiProp { Emoji_Component, Extended_Pictographic } + // 0023 ; Emoji # [1] (#️) NUMBER SIGN // 231A..231B ; Emoji_Presentation # [2] (⌚️..βŒ›οΈ) WATCH..HOURGLASS // 1F3FB..1F3FF ; Emoji_Modifier diff --git a/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiFlagOrder.java b/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiFlagOrder.java index 43b1568f5..1c182ee4f 100644 --- a/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiFlagOrder.java +++ b/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiFlagOrder.java @@ -105,6 +105,7 @@ static class ImageInfo implements Comparable { private Set> colorDistribution; static int order = 0; private int currentOrder = ++order; + /** * returns hue, saturation, brightness * diff --git a/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiFrequency.java b/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiFrequency.java index 1f8111dc4..2ab55a4ce 100644 --- a/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiFrequency.java +++ b/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiFrequency.java @@ -416,6 +416,7 @@ public String getFile() { countIndex = 3, hexIndex = 4, limitIndex = 5; + // global: 1, ί˜Β‚ ,[128514] ,3354042, ['0x1F602'] // locale: ab_GE, ߘ£ ,[128547] ,24, ['0x1F623'] @@ -448,11 +449,13 @@ static class GBoardCounts { private static final String FREQ_SOURCE = DATA_DIR + "/frequency/emoji/"; // static Counter counts = new Counter<>(); static Map localeToCountInfo = new LinkedHashMap<>(); + // static Counter countsRaw = new Counter<>(); // static Counter countsWithoutFe0f = new Counter<>(); private static long toAddAdjusted(String term, Long countWithFe0f, Long countWithoutFe0f) { return HACK_FE0F.contains(term) ? countWithFe0f * 4 : countWithoutFe0f; } + // Android API Distribution // from sheet: static final Map yearToWeight = @@ -697,6 +700,7 @@ enum State { start, quote } + // ab,cd => -1,2,5 that is, point before each comma private String line; private List commaPoints = new ArrayList<>(); diff --git a/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiIterator.java b/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiIterator.java index db507cf59..d66af7cc5 100644 --- a/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiIterator.java +++ b/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiIterator.java @@ -23,6 +23,7 @@ public EmojiIterator(EmojiData data, boolean stripTrailingStyleVariants) { this.modifier = data.MODIFIERS; this.stripTrailingStyleVariants = stripTrailingStyleVariants; } + /** * Resets newLabel if there is a label. * diff --git a/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiMatcher.java b/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiMatcher.java index f5ff3d850..ac301b569 100644 --- a/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiMatcher.java +++ b/unicodetools/src/main/java/org/unicode/tools/emoji/EmojiMatcher.java @@ -21,6 +21,7 @@ public int getEnd() { static final UnicodeSet BASE = new UnicodeSet("[\\p{Emoji}-\\p{Emoji_Component}]"); static final UnicodeSet BASE2 = new UnicodeSet("[\\p{Emoji_Modifier}\uFE0F]"); static final UnicodeSet TAG_SPEC = new UnicodeSet("[\\x{E0020}-\\x{E007E}]"); + /** * Returns true if a possible emoji occurs at or after offset. If true, use getStart() to find * the start of the emoji, and getEnd() to get the end. diff --git a/unicodetools/src/main/java/org/unicode/tools/emoji/GenerateMissingAnnotations.java b/unicodetools/src/main/java/org/unicode/tools/emoji/GenerateMissingAnnotations.java index bc7c3bda0..b4ff79082 100644 --- a/unicodetools/src/main/java/org/unicode/tools/emoji/GenerateMissingAnnotations.java +++ b/unicodetools/src/main/java/org/unicode/tools/emoji/GenerateMissingAnnotations.java @@ -243,6 +243,7 @@ private static void generateMissing() throws IOException { static final class Counts { int emojiCount; + // int charCount; void add(String tts, Set keywords) { diff --git a/unicodetools/src/main/java/org/unicode/tools/emoji/ProposalData.java b/unicodetools/src/main/java/org/unicode/tools/emoji/ProposalData.java index 962eba10e..665d63a5b 100644 --- a/unicodetools/src/main/java/org/unicode/tools/emoji/ProposalData.java +++ b/unicodetools/src/main/java/org/unicode/tools/emoji/ProposalData.java @@ -318,6 +318,7 @@ public static Set cleanProposalString(String proposalString) { .put("πŸ§‘πŸΏβ€β€οΈβ€πŸ’‹β€πŸ§‘πŸΏ", "πŸ’πŸΏ") .put("πŸ§‘πŸΏβ€β€οΈβ€πŸ§‘πŸΏ", "πŸ’‘πŸΏ") .build(); + // static { // for (Entry entry : SHORTEST_SKELETON.entrySet()) { // System.out.println(".put(\"" + entry.getKey() + "\",\"" + entry.getValue() + "\")" @@ -356,6 +357,7 @@ public static String getSkeleton(String code) { String shorter = shortestForm(result); return shorter == null ? result : shorter; } + // parse a .. construction. // syntax = item ("," item) // item = cp (".." cp)? | string diff --git a/unicodetools/src/main/java/org/unicode/unused/CheckSystemFonts.java b/unicodetools/src/main/java/org/unicode/unused/CheckSystemFonts.java index 33d8231d1..cc16535f5 100644 --- a/unicodetools/src/main/java/org/unicode/unused/CheckSystemFonts.java +++ b/unicodetools/src/main/java/org/unicode/unused/CheckSystemFonts.java @@ -552,6 +552,7 @@ public Set make() { static UnicodeMap> invisibles = new UnicodeMap(); static Map, Set> equivalences = new TreeMap, Set>(NFCLowerR2); + // static Set SKIP_SHAPES = new HashSet(Arrays.asList( // "MT-Extra", // "JCsmPC", diff --git a/unicodetools/src/main/java/org/unicode/unused/DataInputCompressor.java b/unicodetools/src/main/java/org/unicode/unused/DataInputCompressor.java index c13178f2e..669b567dc 100644 --- a/unicodetools/src/main/java/org/unicode/unused/DataInputCompressor.java +++ b/unicodetools/src/main/java/org/unicode/unused/DataInputCompressor.java @@ -105,6 +105,7 @@ public long skip(long n) throws IOException { public String toString() { return dataInput.toString(); } + // ==== New Routines ==== public char readChar() throws IOException { diff --git a/unicodetools/src/main/java/org/unicode/unused/DataOutputCompressor.java b/unicodetools/src/main/java/org/unicode/unused/DataOutputCompressor.java index dec7449ee..d4151de8d 100644 --- a/unicodetools/src/main/java/org/unicode/unused/DataOutputCompressor.java +++ b/unicodetools/src/main/java/org/unicode/unused/DataOutputCompressor.java @@ -85,6 +85,7 @@ public String toString() { public void writeObject(Object obj) throws IOException { dataOutput.writeObject(obj); } + // ==== New Routines ==== public void writeChar(int v) throws IOException { diff --git a/unicodetools/src/main/java/org/unicode/unused/Implicit.java b/unicodetools/src/main/java/org/unicode/unused/Implicit.java index 762a477ea..3a35ed3ad 100644 --- a/unicodetools/src/main/java/org/unicode/unused/Implicit.java +++ b/unicodetools/src/main/java/org/unicode/unused/Implicit.java @@ -276,6 +276,7 @@ public Implicit( public static int divideAndRoundUp(int a, int b) { return 1 + (a - 1) / b; } + /** * Converts implicit CE into raw integer * @@ -388,6 +389,7 @@ public int getImplicitFromRaw(int cp) { return (last3 << 24) + (last2 << 16) + (last1 << 8) + last0; } } + /** * Gets an Implicit from a code point. Internally, swaps (which produces a raw value 0..220000, * then converts raw to implicit. diff --git a/unicodetools/src/main/java/org/unicode/unused/TransformTransliterator.java b/unicodetools/src/main/java/org/unicode/unused/TransformTransliterator.java index 9cd40bde6..774108462 100644 --- a/unicodetools/src/main/java/org/unicode/unused/TransformTransliterator.java +++ b/unicodetools/src/main/java/org/unicode/unused/TransformTransliterator.java @@ -4,6 +4,7 @@ * */ package org.unicode.unused; + // import java.util.*; abstract class TransformTransliterator { diff --git a/unicodetools/src/main/java/org/unicode/unused/UnicodePropertySource.java b/unicodetools/src/main/java/org/unicode/unused/UnicodePropertySource.java index c270569aa..587869a06 100644 --- a/unicodetools/src/main/java/org/unicode/unused/UnicodePropertySource.java +++ b/unicodetools/src/main/java/org/unicode/unused/UnicodePropertySource.java @@ -306,6 +306,7 @@ public String getPropertyValueAlias(String valueAlias, int nameChoice) { return getFixedValueAlias(valueAlias, -1, nameChoice); } } + // TODO file bug on getPropertyValueName for Canonical_Combining_Class public StringFilter getFilter() { diff --git a/unicodetools/src/main/java/org/unicode/utilities/UnicodeSetFormatter.java b/unicodetools/src/main/java/org/unicode/utilities/UnicodeSetFormatter.java index 7a8c8e0ba..5f7da9266 100644 --- a/unicodetools/src/main/java/org/unicode/utilities/UnicodeSetFormatter.java +++ b/unicodetools/src/main/java/org/unicode/utilities/UnicodeSetFormatter.java @@ -307,6 +307,7 @@ UnicodeSetFormatter appendQuoted(int codePoint) { UTF16.append(target, codePoint); return this; } + // Appender append(String s) { // target.append(s); // return this; diff --git a/unicodetools/src/test/java/org/unicode/draft/Test2.java b/unicodetools/src/test/java/org/unicode/draft/Test2.java index 59c9fefbe..a9f71ef50 100644 --- a/unicodetools/src/test/java/org/unicode/draft/Test2.java +++ b/unicodetools/src/test/java/org/unicode/draft/Test2.java @@ -327,6 +327,7 @@ public int hashCode() { return value; } } + /** * Verifies correct UTF-8. Uses Table 3-7 of the Unicode Standard. * diff --git a/unicodetools/src/test/java/org/unicode/idna/TestUts46.java b/unicodetools/src/test/java/org/unicode/idna/TestUts46.java index d66daa09e..ca040e750 100644 --- a/unicodetools/src/test/java/org/unicode/idna/TestUts46.java +++ b/unicodetools/src/test/java/org/unicode/idna/TestUts46.java @@ -150,6 +150,7 @@ private void checkErrors( } } } + /** * Return true if each rule is contained in at least one error. * diff --git a/unicodetools/src/test/java/org/unicode/propstest/PropertyAliases.java b/unicodetools/src/test/java/org/unicode/propstest/PropertyAliases.java index 89b74b222..0a03b302d 100644 --- a/unicodetools/src/test/java/org/unicode/propstest/PropertyAliases.java +++ b/unicodetools/src/test/java/org/unicode/propstest/PropertyAliases.java @@ -6,6 +6,7 @@ public interface PropertyAliases { public String getShortName(); public String getLongName(); + /** * Return a list of all the names, starting with the short name, then the long name, then others * (if any). diff --git a/unicodetools/src/test/java/org/unicode/propstest/XMLProperties.java b/unicodetools/src/test/java/org/unicode/propstest/XMLProperties.java index bf98ba91d..b89bd08c5 100644 --- a/unicodetools/src/test/java/org/unicode/propstest/XMLProperties.java +++ b/unicodetools/src/test/java/org/unicode/propstest/XMLProperties.java @@ -68,6 +68,7 @@ static class IntRange { int start; int end; } + // Unicode 6.1.0 // // leavesNotHandled = new LinkedHashSet(); + // Set leavesNotRecognized = new LinkedHashSet(); public XMLProperties(String folder, boolean includeUnihan, int maxLines) { diff --git a/unicodetools/src/test/java/org/unicode/tools/emoji/unittest/TestEmojiDataConsistency.java b/unicodetools/src/test/java/org/unicode/tools/emoji/unittest/TestEmojiDataConsistency.java index cb3f9aa61..5be5a14cb 100644 --- a/unicodetools/src/test/java/org/unicode/tools/emoji/unittest/TestEmojiDataConsistency.java +++ b/unicodetools/src/test/java/org/unicode/tools/emoji/unittest/TestEmojiDataConsistency.java @@ -196,6 +196,7 @@ public void checkFiles(VersionInfo oldVersionInfo, VersionInfo newVersionInfo) { "ONLY IN " + "main-props - fully-qualified"); } } + /* NEW # component β€” an Emoji_Component, @@ -215,6 +216,7 @@ private void logOrError(int logOrError, TempPrintWriter out, String message) { } Tabber tabber = new Tabber.MonoTabber().add(40, Tabber.LEFT).add(20, Tabber.LEFT); + // tabber.add(2, Tabber.LEFT) // hash // .add(4, Tabber.RIGHT) // version // .add(6, Tabber.RIGHT) // count diff --git a/unicodetools/src/test/java/org/unicode/unittest/LocaleCanonicalizer.java b/unicodetools/src/test/java/org/unicode/unittest/LocaleCanonicalizer.java index 7a4f1f4d6..c405e00ea 100644 --- a/unicodetools/src/test/java/org/unicode/unittest/LocaleCanonicalizer.java +++ b/unicodetools/src/test/java/org/unicode/unittest/LocaleCanonicalizer.java @@ -305,6 +305,7 @@ public ExceptionInfo(Datatype datatype, ULocale context, ULocale aliasTo, String ? _tVariant : _tVariant.isEmpty() ? null : _tVariant; } + /* Set the other fields of the result, and return the new datatype value */ public void setTarget(Datatype datatype, LocaleCanonicalizer.LSRV result) { if (tLang != null && (result.language.isEmpty() || datatype == Datatype.language)) { diff --git a/unicodetools/src/test/java/org/unicode/unittest/LocaleExtensions.java b/unicodetools/src/test/java/org/unicode/unittest/LocaleExtensions.java index c8cca88c3..330a01164 100644 --- a/unicodetools/src/test/java/org/unicode/unittest/LocaleExtensions.java +++ b/unicodetools/src/test/java/org/unicode/unittest/LocaleExtensions.java @@ -46,6 +46,7 @@ public int compare(String o1, String o2) { ukeyBucket = 4, vwyzBucket = 5, xBucket = 6; + // TODO maybe optimize to make complete mapping to integers. public static int getBucket(String o1) { char first; diff --git a/unicodetools/src/test/java/org/unicode/unittest/TestUnicodeSet.java b/unicodetools/src/test/java/org/unicode/unittest/TestUnicodeSet.java index 60b27ac89..ac8341413 100644 --- a/unicodetools/src/test/java/org/unicode/unittest/TestUnicodeSet.java +++ b/unicodetools/src/test/java/org/unicode/unittest/TestUnicodeSet.java @@ -76,6 +76,7 @@ public void TestHexParser() { } } } + // https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html // Unicode scripts, blocks, categories and binary properties are written with the \p and \P // constructs as in Perl.