From f930b35c6522b906bad3785f474edbfcb61074a2 Mon Sep 17 00:00:00 2001
From: Robin Leroy 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:Line_Break Chart
$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; - } -}