Lines Matching +full:range +full:- +full:double

2 # SPDX-License-Identifier: GPL-2.0
11 # python3 gen_ucs_fallback_table.py -o FILE # Specify output file
33 # Define the range marker value
40 # Process BMP characters (0x0000 - 0xFFFF) to keep table size manageable
41 for cp in range(0x0080, 0x10000): # Skip ASCII range (0x00-0x7F)
69 # Multi-character unidecode output
70 # These map to single chars instead of unidecode's multiple-char mappings
72 overrides[0x00C6] = ord('E') # Æ LATIN CAPITAL LETTER AE -> E (unidecode: "AE")
73 overrides[0x00E6] = ord('e') # æ LATIN SMALL LETTER AE -> e (unidecode: "ae")
74 overrides[0x0152] = ord('E') # Œ LATIN CAPITAL LIGATURE OE -> E (unidecode: "OE")
75 overrides[0x0153] = ord('e') # œ LATIN SMALL LETTER LIGATURE OE -> e (unidecode: "oe")
76 overrides[0x00DF] = ord('s') # ß LATIN SMALL LETTER SHARP S -> s (unidecode: "ss")
79 overrides[0x2264] = ord('<') # ≤ LESS-THAN OR EQUAL TO -> < (unidecode: "<=")
80 overrides[0x2265] = ord('>') # ≥ GREATER-THAN OR EQUAL TO -> > (unidecode: ">=")
83 overrides[0x2260] = ord('#') # ≠ NOT EQUAL TO -> # (unidecode: empty string)
86 for cp in range(0x2596, 0x259F+1):
87 overrides[cp] = ord('#') # ▖ ▗ ▘ ▙ etc. - map to # (unidecode: empty string)
91 overrides[0x2192] = ord('>') # → RIGHTWARDS ARROW -> > (unidecode: "-")
92 overrides[0x2190] = ord('<') # ← LEFTWARDS ARROW -> < (unidecode: "-")
93 overrides[0x2191] = ord('^') # ↑ UPWARDS ARROW -> ^ (unidecode: "|")
94 overrides[0x2193] = ord('v') # ↓ DOWNWARDS ARROW -> v (unidecode: "|")
96 # Double arrows with their directional semantic mappings
97 overrides[0x21D0] = ord('<') # ⇐ LEFTWARDS DOUBLE ARROW -> <
98 overrides[0x21D1] = ord('^') # ⇑ UPWARDS DOUBLE ARROW -> ^
99 overrides[0x21D2] = ord('>') # ⇒ RIGHTWARDS DOUBLE ARROW -> >
100 overrides[0x21D3] = ord('v') # ⇓ DOWNWARDS DOUBLE ARROW -> v
103 # These need the same treatment as their normal-width counterparts
104 overrides[0xFFE9] = ord('<') # ← HALFWIDTH LEFTWARDS ARROW -> < (unidecode: "-")
105 overrides[0xFFEA] = ord('^') # ↑ HALFWIDTH UPWARDS ARROW -> ^ (unidecode: "|")
106 overrides[0xFFEB] = ord('>') # → HALFWIDTH RIGHTWARDS ARROW -> > (unidecode: "-")
107 overrides[0xFFEC] = ord('v') # ↓ HALFWIDTH DOWNWARDS ARROW -> v (unidecode: "|")
109 # Currency symbols - each mapped to a representative letter
110 overrides[0x00A2] = ord('c') # ¢ CENT SIGN -> c
111 overrides[0x00A3] = ord('L') # £ POUND SIGN -> L
112 overrides[0x00A5] = ord('Y') # ¥ YEN SIGN -> Y
113 overrides[0x20AC] = ord('E') # € EURO SIGN -> E
116 overrides[0x00A7] = ord('S') # § SECTION SIGN -> S
117 overrides[0x00A9] = ord('C') # © COPYRIGHT SIGN -> C
118 overrides[0x00AE] = ord('R') # ® REGISTERED SIGN -> R
119 overrides[0x2122] = ord('T') # ™ TRADE MARK SIGN -> T
121 # Degree-related symbols
122 overrides[0x00B0] = ord('o') # ° DEGREE SIGN -> o
123 overrides[0x2103] = ord('C') # ℃ DEGREE CELSIUS -> C
124 overrides[0x2109] = ord('F') # ℉ DEGREE FAHRENHEIT -> F
127 overrides[0x00AB] = ord('<') # « LEFT-POINTING DOUBLE ANGLE QUOTATION MARK -> <
128 overrides[0x00BB] = ord('>') # » RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -> >
131 overrides[0x2218] = ord('o') # ∘ RING OPERATOR -> o
132 overrides[0x2219] = ord('.') # ∙ BULLET OPERATOR -> .
137 overrides[cp] = ord('!') # Negated math symbols -> ! (not)
141 overrides[cp] = ord('#') # Negated equality symbols -> # (not equal)
143 # Negated arrows - all mapped to exclamation mark
145 overrides[cp] = ord('!') # Negated arrows -> ! (not)
149 overrides[cp] = ord('-') # Dashes and hyphens -> -
153 overrides[cp] = ord('?') # Question marks -> ?
157 overrides[cp] = ord('!') # Exclamation marks -> !
159 # Asterisk-like symbols
164 overrides[0x201E] = ord('"') # „ DOUBLE LOW-9 QUOTATION MARK
167 overrides[0x2033] = ord('"') # ″ DOUBLE PRIME
178 # X marks - lowercase for regular, uppercase for heavy
180 overrides[cp] = ord('x') # Regular X marks -> x
182 overrides[cp] = ord('X') # Heavy X marks -> X
184 # Stars and asterisk-like symbols mapped to '*'
186 overrides[cp] = ord('*') # All star and asterisk symbols -> *
187 for cp in range(0x2721, 0x2746+1):
188 overrides[cp] = ord('*') # All star and asterisk symbols -> *
189 for cp in range(0x2749, 0x274B+1):
190 overrides[cp] = ord('*') # Last set of asterisk symbols -> *
192 overrides[cp] = ord('*') # Star operators -> *
200 # Full-width to ASCII mapping (covering all printable ASCII 33-126)
201 # 0xFF01 (!) to 0xFF5E (~) -> ASCII 33 (!) to 126 (~)
205 for cp in range(0xFF01, 0xFF5E + 1):
206 overrides[cp] = 0 # Double-width ASCII characters
231 A range is only compressed if it contains 3 or more consecutive entries."""
244 entries[j][0] == entries[j-1][0] + 1 and # consecutive offsets
248 # Calculate the range end
249 end_offset = entries[j-1][0]
251 # If we found a range with 3 or more entries (worth compressing)
252 if j - i >= 3:
253 # Add a range entry
258 for k in range(i, j):
292 /* SPDX-License-Identifier: GPL-2.0 */
294 * {out_file} - Unicode character fallback table
296 * Auto-generated by {this_file}
343 comment = f"{cp_name(codepoint)} -> ..."
345 comment = f"{cp_name(codepoint)} -> '{chr(fallback)}'"
356 parser.add_argument("-o", "--output", dest="output_file", default=DEFAULT_OUT_FILE,