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

UNICODE_EMOJI_<language>? #282

Open
kubinka0505 opened this issue Feb 26, 2024 · 5 comments
Open

UNICODE_EMOJI_<language>? #282

kubinka0505 opened this issue Feb 26, 2024 · 5 comments

Comments

@kubinka0505
Copy link

Older versions used to have UNICODE_EMOJI_ENGLISH etc; but since it's gone, how can I make this available again?

@cvzi
Copy link
Contributor

cvzi commented Feb 27, 2024

Depends on what you want to do? Do you need a list of all names/emoji per language?

@kubinka0505
Copy link
Author

Depends on what you want to do? Do you need a list of all names/emoji per language?

Yes, like {":emoji:", "unicode_object", ...}

@cvzi
Copy link
Contributor

cvzi commented Feb 27, 2024

All the data is in emoji.EMOJI_DATA (see documentation: https://carpedm20.github.io/emoji/docs/api.html#emoji.EMOJI_DATA)

To get what you want you would need to do this:

data = { emoji.EMOJI_DATA[unicode_code]['en']: unicode_code for unicode_code in emoji.EMOJI_DATA }

Edit:
There may be duplicates though, that is one name can refer to multiple unicode_code

@kubinka0505
Copy link
Author

All the data is in emoji.EMOJI_DATA (see documentation: https://carpedm20.github.io/emoji/docs/api.html#emoji.EMOJI_DATA)

To get what you want you would need to do this:

data = { emoji.EMOJI_DATA[unicode_code]['en']: unicode_code for unicode_code in emoji.EMOJI_DATA }

Edit:
There may be duplicates though, that is one name can refer to multiple unicode_code

Assuming this works and i.e :fire: == :flame:, why would not bring those variables back?

@cvzi
Copy link
Contributor

cvzi commented Feb 27, 2024

They were used internally by the library and they were generated the same way as I posted. They are no longer used now, so there is no point to generate them every time the library is used.

The other thing is that it is difficult to deal with unicode codes and the idea of this library is that you don't have to deal with unicode yourself.

For example what I meant by duplicates is this:
:warning: refers to both \U000026A0\U0000FE0F and \U000026A0. But UNICODE_EMOJI_ENGLISH is a dict so it can only contain one of them.
It is unclear which one should be listed in UNICODE_EMOJI_ENGLISH and the average user of this library probably wouldn't be aware of this conflict.

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