ssb: Avoid unqualified emojis. I noticed the red heart was missing ever since I reprocessed the list.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 16m42s

This commit is contained in:
Cory McWilliams 2024-12-22 14:19:28 -05:00
parent e5279b4827
commit 6563f8c738
2 changed files with 8 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -18,13 +18,15 @@ with open('out/emoji-test.txt', 'r') as f:
elif line.startswith('# subgroup: '):
subgroup = line[len('# subgroup: '):]
else:
m = re.match(r'((?:\s?[0-9A-F]+)+)\s+;.*#.*E\d+\.\d+ (.*)', line)
m = re.match(r'((?:\s?[0-9A-F]+)+)\s+; (\S+).*#.*E\d+\.\d+ (.*)', line)
if m:
emoji = ''.join(chr(int(g, 16)) for g in m.group(1).split(' '))
name = m.group(2)
if not group in doc:
doc[group] = {}
doc[group][name] = emoji
qualified = m.group(2)
if qualified == 'fully-qualified':
name = m.group(3)
if not group in doc:
doc[group] = {}
doc[group][name] = emoji
with open('apps/ssb/emojis.json', 'w') as f:
json.dump(doc, f, ensure_ascii = False)