vdurmont / emoji-java

The missing emoji library for Java :heart:
MIT License
2.62k stars 513 forks source link

EmojiManager.getForTag - CaseInsensitive #167

Open ccostin93 opened 3 years ago

ccostin93 commented 3 years ago

Currently, the method EmojiManager.getForTag(String) is case sensitive. I would say this is quite restrictive.

Sure, one can do a call for EmojiManager.getAllTags(), but then one would have to search though all the tags and find what he wants.

A simple improvement would be to make the Map storing the emojis by tag to be case insensitive. This can be achieved by changing the HashMap to a TreeMap(CASE_INSENSITIVE) - see https://www.baeldung.com/java-map-with-case-insensitive-keys

@vdurmont WDYT?