dawranliou / emoji

Emoji for Clojure
https://cljdoc.org/d/dawran6/emoji
MIT License
21 stars 2 forks source link

convert all keys to kebab case #2

Closed willspecht closed 4 years ago

dawranliou commented 4 years ago

Thanks for the PR! I want to discuss the use cases a bit more before merging this because two exception emojis, :e-mail: (:e-mail:) and :-1: (:-1:), put special meaning on the dash/hyphenation. If all keys use the kebab case, the hyphens become a bit ambiguous.

For example, it's pretty simple convert the emojis back to their shortcodes if we keep the snake case. I just need to create a new map that reverses the emoji key and values. Then I can do:

(def reversed (into {} (for [[k v] emoji] [v k])))
(-> (reversed "🌵") name)
"cactus"
(-> (reversed"🍠" ) name)
"sweet_potato"

But with the kebab case, I cannot simply change the hyphens to underscores because of the two exceptions.

willspecht commented 4 years ago

I see, could store shortcode in the map, but I get the issue

dawranliou commented 4 years ago

@willspecht check out issue #3. I decided that an emoji.json is the direction to go. Feel free to drop any comment there. Thanks again for the PR!