Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detecting gender-neutral emoji #36

Closed
dbrgn opened this issue Dec 3, 2019 · 6 comments
Closed

Detecting gender-neutral emoji #36

dbrgn opened this issue Dec 3, 2019 · 6 comments

Comments

@dbrgn
Copy link
Contributor

dbrgn commented Dec 3, 2019

There are a few emoji that are available both with a gender and in a neutral version:

  {
    "annotation": "genie",
    "name": "GENIE",
    "hexcode": "1F9DE",
    "shortcodes": [
      "genie"
    ],
    "tags": [
      "djinn"
    ],
    "emoji": "🧞",
    "text": "",
    "type": 1,
    "order": 1507,
    "group": 1,
    "subgroup": 25,
    "version": 5
  },
  {
    "annotation": "man genie",
    "name": "GENIE, MALE SIGN",
    "hexcode": "1F9DE-200D-2642-FE0F",
    "shortcodes": [
      "man_genie"
    ],
    "tags": [
      "djinn"
    ],
    "emoji": "🧞‍♂️",
    "text": "",
    "type": 1,
    "order": 1508,
    "group": 1,
    "subgroup": 25,
    "version": 5,
    "gender": 1
  },
  {
    "annotation": "woman genie",
    "name": "GENIE, FEMALE SIGN",
    "hexcode": "1F9DE-200D-2640-FE0F",
    "shortcodes": [
      "woman_genie"
    ],
    "tags": [
      "djinn"
    ],
    "emoji": "🧞‍♀️",
    "text": "",
    "type": 1,
    "order": 1510,
    "group": 1,
    "subgroup": 25,
    "version": 5,
    "gender": 0
  },

It would be fantastic, if you could mark emoji that have gendered versions available, but are neutral. For skintones, that's possible by checking whether a skins field is present (if there is, it's the neutral version), but for genders that's not possible.

Regarding notation, I'm unsure what would be best. Maybe "gender": null, "gender": -1 or "gender_neutral": true?

@dbrgn
Copy link
Contributor Author

dbrgn commented Dec 3, 2019

Ah, this seems to be a duplicate of #18. Would be nice if this could be automated somehow and integrated into this library, but I haven't found a clean way to do so so far.

The most-effort case would be maintaining a manual list of such "gender-neutral" emoji, that would need to be updated for every new emoji version. Maybe there's no clean way around that.

@dbrgn
Copy link
Contributor Author

dbrgn commented Dec 3, 2019

Here's some hacky Python code that seems to work okay-ish:

gender_neutral = []
for category in categories.values():
    for emoji in category:
        if ', FEMALE SIGN' in emoji['name']:
            gender_neutral.append(emoji['name'].split(', FEMALE SIGN')[0])
for category in categories.values():
    for emoji in category:
        if emoji['name'] in gender_neutral:
            print('NEUTRAL: ', emoji['name'])

It results in this list:

NEUTRAL:  PERSON WITH BLOND HAIR
NEUTRAL:  PERSON FROWNING
NEUTRAL:  PERSON WITH POUTING FACE
NEUTRAL:  FACE WITH NO GOOD GESTURE
NEUTRAL:  FACE WITH OK GESTURE
NEUTRAL:  INFORMATION DESK PERSON
NEUTRAL:  HAPPY PERSON RAISING ONE HAND
NEUTRAL:  DEAF PERSON
NEUTRAL:  PERSON BOWING DEEPLY
NEUTRAL:  FACE PALM
NEUTRAL:  SHRUG
NEUTRAL:  POLICE OFFICER
NEUTRAL:  SLEUTH OR SPY
NEUTRAL:  GUARDSMAN
NEUTRAL:  CONSTRUCTION WORKER
NEUTRAL:  MAN WITH TURBAN
NEUTRAL:  SUPERHERO
NEUTRAL:  SUPERVILLAIN
NEUTRAL:  MAGE
NEUTRAL:  FAIRY
NEUTRAL:  VAMPIRE
NEUTRAL:  MERPERSON
NEUTRAL:  ELF
NEUTRAL:  GENIE
NEUTRAL:  ZOMBIE
NEUTRAL:  FACE MASSAGE
NEUTRAL:  HAIRCUT
NEUTRAL:  PEDESTRIAN
NEUTRAL:  STANDING PERSON
NEUTRAL:  KNEELING PERSON
NEUTRAL:  RUNNER
NEUTRAL:  WOMAN WITH BUNNY EARS
NEUTRAL:  PERSON IN STEAMY ROOM
NEUTRAL:  PERSON CLIMBING
NEUTRAL:  GOLFER
NEUTRAL:  SURFER
NEUTRAL:  ROWBOAT
NEUTRAL:  SWIMMER
NEUTRAL:  PERSON WITH BALL
NEUTRAL:  WEIGHT LIFTER
NEUTRAL:  BICYCLIST
NEUTRAL:  MOUNTAIN BICYCLIST
NEUTRAL:  PERSON DOING CARTWHEEL
NEUTRAL:  WRESTLERS
NEUTRAL:  WATER POLO
NEUTRAL:  HANDBALL
NEUTRAL:  JUGGLING
NEUTRAL:  PERSON IN LOTUS POSITION

This seems to result all emoji that are available in a gender-modifier variant as well.

However, there are also some special cases. For example "couple with heart". There are 4 variants:

  • Couple with heart (single codepoint)
  • Couple with heart, man + woman (woman + heart + man)
  • Couple with heart, man + man (man + heart + man)
  • Couple with heart, woman + woman (woman + heart + woman)

Since those don't use the gender modifiers, there is no "gender" field in the data. Strictly speaking, those are gender-neutral emoji that are also available as gendered versions.

I'm not sure how to proceed. However, this is something that every person implementing an emoji picker will face, and it would be great if we could do the work only once in this library, instead of reinventing the wheel over and over again.

@milesj
Copy link
Owner

milesj commented Dec 3, 2019

I don't want to add additional properties to the dataset if they're not required, as it will increase the filesize. I'd much prefer helper functions that operate on the dataset.

An easier way would be to reverse the list and search that way. If you find FEMALE SIGN or MALE SIGN, you'll know a gender neutral version is following.

The couple with heart emoji (and some others) are super complicated. They even have special rules in the specification. It would be better to just hardcode them.

@dbrgn
Copy link
Contributor Author

dbrgn commented Dec 3, 2019

Is the ordering (neutral, male, female) guaranteed? Is there always a neutral emoji after a gendered one?

@milesj
Copy link
Owner

milesj commented Dec 3, 2019

Neutral always comes first before the male and female variants, according to the unicode data files. However, I don't believe all names with FEMALE SIGN and MALE SIGN have a neutral variant.

@dbrgn
Copy link
Contributor Author

dbrgn commented Dec 4, 2019

Ok, maybe we should leave this to the developers. Since some fonts may render "person" differently than "man" or "woman", it probably depends on the application whether they should be displayed or not.

I ended up using something like that Python script up there (although I also needed to apply the flag to all skintone variants).

@dbrgn dbrgn closed this as completed Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants