From f930b35c6522b906bad3785f474edbfcb61074a2 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Thu, 28 Nov 2024 02:47:30 +0100 Subject: [PATCH] Remove OldUnicodeMap (#978) --- .../data/ucd/dev/auxiliary/LineBreakTest.html | 4 +- .../unicode/text/UCD/GenerateBreakTest.java | 2 +- .../org/unicode/text/UCD/OldUnicodeMap.java | 111 ------------------ 3 files changed, 3 insertions(+), 114 deletions(-) delete mode 100644 unicodetools/src/main/java/org/unicode/text/UCD/OldUnicodeMap.java diff --git a/unicodetools/data/ucd/dev/auxiliary/LineBreakTest.html b/unicodetools/data/ucd/dev/auxiliary/LineBreakTest.html index 4c73d3253..557c683d7 100644 --- a/unicodetools/data/ucd/dev/auxiliary/LineBreakTest.html +++ b/unicodetools/data/ucd/dev/auxiliary/LineBreakTest.html @@ -7,8 +7,8 @@

Line_Break Chart

Unicode Version: 17.0.0

-

Date: 2024-11-27, 17:44:25 GMT

-

This page illustrates the application of the Line_Break specification. The material here is informative, not normative.

The first chart shows where breaks would appear between different sample characters or strings. The sample characters are chosen mechanically to represent the different properties used by the specification.

Each cell shows the break-status for the position between the character(s) in its row header and the character(s) in its column header. The symbol × indicates a prohibited break, even with intervening spaces; the ÷ symbol indicates a (direct) break; the symbol ∻ indicates a break only in the presence of an intervening space (an indirect break).The cells with × or ∹ are also shaded to make it easier to scan the table. For example, in the cell at the intersection of the row headed by “CR” and the column headed by “LF”, there is a × symbol, indicating that there is no break between CR and LF.

+

Date: 2024-11-28, 01:27:49 GMT

+

This page illustrates the application of the Line_Break specification. The material here is informative, not normative.

The first chart shows where breaks would appear between different sample characters or strings. The sample characters are chosen mechanically to represent the different properties used by the specification.

Each cell shows the break-status for the position between the character(s) in its row header and the character(s) in its column header. The symbol × indicates a prohibited break, even with intervening spaces; the ÷ symbol indicates a (direct) break; the symbol ∻ indicates a break only in the presence of an intervening space (an indirect break).The cells with × or ∻ are also shaded to make it easier to scan the table. For example, in the cell at the intersection of the row headed by “CR” and the column headed by “LF”, there is a × symbol, indicating that there is no break between CR and LF.

In the row and column headers of the Table, in the Rules, when hovering over characters in the Samples, and in the comments in the associated list of test cases LineBreakTest.txt:

  1. The following sets are used:
    • 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 9a0c036fe..81b29c395 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/GenerateBreakTest.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/GenerateBreakTest.java @@ -359,7 +359,7 @@ public void run() throws IOException { + " break only in the presence of an intervening space (an indirect break)." : "The × symbol indicates no break, while the ÷ symbol indicates a break. ") + "The cells with ×" - + (fileName.equals("Line") ? " or ∹ " : "") + + (fileName.equals("Line") ? " or ∻ " : "") + " are also shaded to make it easier to scan the table. " + "For example, in the cell at the intersection of the row headed by “CR” and the column headed by “LF”, there is a × symbol, " + "indicating that there is no break between CR and LF.

      "); diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/OldUnicodeMap.java b/unicodetools/src/main/java/org/unicode/text/UCD/OldUnicodeMap.java deleted file mode 100644 index 089f05a01..000000000 --- a/unicodetools/src/main/java/org/unicode/text/UCD/OldUnicodeMap.java +++ /dev/null @@ -1,111 +0,0 @@ -/** - * ****************************************************************************** Copyright (C) - * 1996-2001, International Business Machines Corporation and * others. All Rights Reserved. * - * ****************************************************************************** - * - *

      $Source: /home/cvsroot/unicodetools/org/unicode/text/UCD/OldUnicodeMap.java,v $ - * - *

      ****************************************************************************** - */ -package org.unicode.text.UCD; - -import com.ibm.icu.text.UnicodeSet; - -/** Class that maps from codepoints to an index, and optionally a label. */ -public class OldUnicodeMap { - UnicodeSet[] sets = new UnicodeSet[100]; - String[] labels = new String[100]; - int count = 0; - - public int add(String label, UnicodeSet set) { - return add(label, set, false, true); - } - - /** - * Add set - * - * @param removeOld true: remove any collisions from sets already in the map if false, remove - * any collisions from this set - * @param signal: print a warning when collisions occur - */ - public int add(String label, UnicodeSet set, boolean removeOld, boolean signal) { - // remove from any preceding!! - for (int i = 0; i < count; ++i) { - if (!set.containsSome(sets[i])) { - continue; - } - if (signal) { - showOverlap(label, set, i); - } - if (removeOld) { - sets[i] = sets[i].removeAll(set); - } else { - set = set.removeAll(sets[i]); - } - } - sets[count] = set; - labels[count++] = label; - return (short) (count - 1); - } - - public void showOverlap(String label, UnicodeSet set, int i) { - final UnicodeSet delta = new UnicodeSet(set).retainAll(sets[i]); - System.out.println("Warning! Overlap with " + label + " and " + labels[i] + ": " + delta); - } - - public int getIndex(int codepoint) { - for (int i = count - 1; i >= 0; --i) { - if (sets[i].contains(codepoint)) { - return i; - } - } - return -1; - } - - public int getIndexFromLabel(String label) { - for (int i = count - 1; i >= 0; --i) { - if (labels[i].equalsIgnoreCase(label)) { - return i; - } - } - return -1; - } - - public String getLabel(int codepoint) { - return getLabelFromIndex(getIndex(codepoint)); - } - - public String getLabelFromIndex(int index) { - if (index < 0 || index >= count) { - return null; - } - return labels[index]; - } - - public UnicodeSet getSetFromIndex(int index) { - if (index < 0 || index >= count) { - return null; - } - return new UnicodeSet(sets[index]); // protect from changes - } - - public int size() { - return count; - } - - public int setLabel(int index, String label) { - labels[index] = label; - return index; - } - - public int put(int codepoint, int index) { - if (sets[index] == null) { - sets[index] = new UnicodeSet(); - if (index >= count) { - count = index + 1; - } - } - sets[index].add(codepoint); - return index; - } -}