mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Simplify a bit the special rules generating unaccent.rules
As noted by Thomas Munro, CLDR 36 has added SOUND RECORDING COPYRIGHT (U+2117), and we use CLDR 41, so this can be removed from the set of special cases. The set of regression tests is expanded for degree signs, which are two of the special cases, and a fancy case with U+210C in Latin-ASCII.xml that we have discovered about when diving into what could be done for Cyrillic characters (this last part is material for a future patch, not tackled yet). While on it, some of the assertions of generate_unaccent_rules.py are expanded to report the codepoint on which a failure is found, something useful for debugging. Extracted from a larger patch by the same author. Author: Przemysław Sztoch Discussion: https://postgr.es/m/8478da0d-3b61-d24f-80b4-ce2f5e971c60@sztoch.pl
This commit is contained in:
@ -134,12 +134,12 @@ def get_plain_letter(codepoint, table):
|
||||
return table[codepoint.combining_ids[0]]
|
||||
|
||||
# Should not come here
|
||||
assert(False)
|
||||
assert False, 'Codepoint U+%0.2X' % codepoint.id
|
||||
elif is_plain_letter(codepoint):
|
||||
return codepoint
|
||||
|
||||
# Should not come here
|
||||
assert(False)
|
||||
assert False, 'Codepoint U+%0.2X' % codepoint.id
|
||||
|
||||
|
||||
def is_ligature(codepoint, table):
|
||||
@ -212,7 +212,6 @@ def special_cases():
|
||||
# Symbols of "Letterlike Symbols" Unicode Block (U+2100 to U+214F)
|
||||
charactersSet.add((0x2103, "\xb0C")) # DEGREE CELSIUS
|
||||
charactersSet.add((0x2109, "\xb0F")) # DEGREE FAHRENHEIT
|
||||
charactersSet.add((0x2117, "(P)")) # SOUND RECORDING COPYRIGHT
|
||||
|
||||
return charactersSet
|
||||
|
||||
|
Reference in New Issue
Block a user