Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

ruleset.py created by create_ruleset.py doesn't include 'diversity' category #628

Open
ogreverse opened this issue Nov 1, 2018 · 0 comments

Comments

@ogreverse
Copy link

ogreverse commented Nov 1, 2018

HI.

When I integrated new emojione into my project, I noticed that emojis related to the category of diversity were not displayed.
Apparently there was a problem in create_ruleset.py and I fixed it like below.

    shortcode_replace[shortname] = unicode_hex
    category_replace[shortname] = value['category']

+   if value['diversity']:
+      category_replace[shortname] = 'diversity'
+
    if '-' not in unicode_hex:
        unicode_char = chr(int(unicode_hex, 16))
        unicode_replace[unicode_char.encode('utf-8')] = shortname

I'd like to get ruleset.py to be compatible with old emoji's shortnames besides.
I added the codes like below.

        unicode_char = ''.join(chr(int(part, 16)) for part in parts)
        unicode_replace[unicode_char.encode('utf-8')] = shortname

+  if value['shortname_alternates']:
+      for shortname_alternate in value['shortname_alternates']:
+          shortcode_replace[shortname_alternate] = shortcode_replace[shortname]
+          category_replace[shortname_alternate] = category_replace[shortname]
+
print(unicode_replace)
print(shortcode_replace)
print(ascii_replace)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant