Repository: kcthota/emoji4j Branch: master Commit: e32015b3f938 Files: 12 Total size: 381.6 KB Directory structure: gitextract_g7txfonb/ ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── pom.xml └── src/ ├── main/ │ ├── java/ │ │ └── emoji4j/ │ │ ├── AbstractEmoji.java │ │ ├── Emoji.java │ │ ├── EmojiManager.java │ │ └── EmojiUtils.java │ └── resources/ │ └── emoji.json └── test/ └── java/ └── emoji4j/ ├── EmojiTest.java └── EmoticonTest.java ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ .classpath .settings .project target deploypom.xml .idea ================================================ FILE: .travis.yml ================================================ language: java jdk: - openjdk9 env: global: # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created # via the "travis encrypt" command using the project repo's public key - secure: "c3aSegQHJkgnplVVyaFTMzJB0uo6nvP4MTZZRzC1Nqyj+/PupObtC/sHCZuy6atKi3c2ZNRpFfKByXIjF162qKWMXVfLlTyDejtu97D7TChsfKwq+odaMj4mGp7bEClwRvH5wNimkmrrSyBEC8+3/51RIsl6WYr7SqiE87RS6tv/sTSzkiLuMP25RQ5HUG38VRBieLgHbStE5T3kO3gpyk+tLoq2NNcPhSsK/6G+pmqeqkTYViNjH2yOIxO3KUqVO0nlG0PdwQ8m4DEWLGebsg1JXD3kMTnMdXxxPstI4zX2y2RgoVoLDwh7Nfm/S2+RP6eZHpxpsZRUBeCqK+lGLNBSq0HFSQtGoUdwu3bbWWddhPHvLO0P5kIgAi2OB6I1WURIbfIJugKpSZCh7uajBD2WRHpD1Wo/0DOn87i5QbyKHjQHC04P/HlITnyR8MI0gddrmigGGTm2RP33Ji+m/A8OBVu62kDpx3XXLOe5nnoaT3yckACxGWj5l6m+sL6nAdrl6LsHu/9Qrv7oXRlCf2402QjhFpNHWvvG+LalftlvwAQSzYVyRYkEfxhz92sSx4CDKcvkwraQ6D/s10v7ZhKaDwpLxGuFs33ZW/JzEBLECCPdavRnmZJh7924qaiMIElBX7SFPmEVlmZQKXpBYmq8en728Ac0kEwhx2CpCi8=" addons: coverity_scan: project: name: "kcthota/emoji4j" description: "Build submitted via Travis CI" notification_email: kcthota@gmail.com build_command_prepend: "mvn clean" build_command: "mvn -DskipTests=true compile" branch_pattern: coverity after_success: - mvn clean cobertura:cobertura coveralls:report ================================================ FILE: LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: README.md ================================================ emoji4j ============= [![Build Status](https://img.shields.io/travis/kcthota/emoji4j/master.svg)](https://travis-ci.org/kcthota/emoji4j) [![Coverage Status](https://img.shields.io/coveralls/kcthota/emoji4j/master.svg)](https://coveralls.io/r/kcthota/emoji4j?branch=master) [![Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg)](http://www.apache.org/licenses/LICENSE-2.0) [![Maven Central](https://img.shields.io/badge/Maven-Central-blue.svg)](https://maven-badges.herokuapp.com/maven-central/com.kcthota/emoji4j) [![Java Doc](https://img.shields.io/badge/JavaDoc-5.0-brightgreen.svg)](https://www.javadoc.io/doc/com.kcthota/emoji4j) [WARNING]: This project is not actively being maintainted. You may use [vdurmont/emoji-java](https://github.com/vdurmont/emoji-java) as an alternative. Java library to convert short codes, html entities to emojis and vice-versa. Also supports parsing emoticons, surrogate html entities. Inspired by [vdurmont/emoji-java](https://github.com/vdurmont/emoji-java), emoji4j adds more goodies and helpers to deal with emojis. The emoji data is based on the database from [github/gemoji](https://github.com/github/gemoji) and ASCII emoticons data from [wooorm/emoticon](https://github.com/wooorm/emoticon). # Usage Stable: ``` com.kcthota emoji4j 6.0 ``` # Examples: ## getEmoji Get emoji by unicode, short code, decimal or hexadecimal html entity ``` Emoji emoji = EmojiUtils.getEmoji("🐭"); //get emoji by unicode character EmojiUtils.getEmoji("blue_car").getEmoji(); //returns 🚙 EmojiUtils.getEmoji(":blue_car:").getEmoji(); //also returns 🚙 EmojiUtils.getEmoji("🐭").getEmoji(); //returns 🐭 EmojiUtils.getEmoji("🐭").getEmoji(); //also returns 🐭 EmojiUtils.getEmoji(":)").getEmoji(); //returns 😃 EmojiUtils.getEmoji("��").getEmoji(); //returns 😁 ``` ## The Emoji Object Conversion from unicode, short code, hexadecimal and decimal html entities is pretty easy. ``` Emoji emoji = EmojiUtils.getEmoji("🐭"); emoji.getEmoji(); //returns 🐭 emoji.getDecimalHtml(); //returns 🐭 emoji.getHexHtml(); //return 🐭 emoji.getAliases(); //returns a collection of aliases. ["mouse"] ``` ## isEmoji Verifies if the passed string is an emoji character ``` EmojiUtils.isEmoji("🐭"); //returns true EmojiUtils.isEmoji("blue_car"); //returns true EmojiUtils.isEmoji(":coyote:"); //returns false EmojiUtils.isEmoji("🐭"); //returns true EmojiUtils.isEmoji("🐭"); //returns true ``` ## emojify Emojifies the passed string ``` String text = "A :cat:, :dog: and a :mouse: became friends<3. For :dog:'s birthday party, they all had :hamburger:s, :fries:s, :cookie:s and :cake:."; EmojiUtils.emojify(text); //returns A 🐱, 🐶 and a 🐭 became friends❤️. For 🐶's birthday party, they all had 🍔s, 🍟s, 🍪s and 🍰. String text = "A 🐱, 🐶 and a :mouse: became friends. For the :dog:'s birthday party, they all had :hamburger:s, :fries:s, :cookie:s and :cake:." EmojiUtils.emojify(text); //returns A 🐱, 🐶 and a 🐭 became friends. For the 🐶's birthday party, they all had 🍔s, 🍟s, 🍪s and 🍰. String text=":):-),:-):-]:-xP=*:*<3:P:p,=-)"; EmojiUtils.emojify(text); //returns 😃😃😅😃😶😝😗😗❤️😛😛😅 ``` ## htmlify Converts unicode characters in text to corresponding decimal html entities ``` String text = "A :cat:, :dog: and a :mouse: became friends. For the :dog:'s birthday party, they all had :hamburger:s, :fries:s, :cookie:s and :cake:."; EmojiUtils.htmlify(text); //returns A 🐱, 🐶 and a 🐭 became friends. For the 🐶's birthday party, they all had 🍔s, 🍟s, 🍪s and 🍰. String text = "A 🐱, 🐶 and a 🐭 became friends. For the 🐶's birthday party, they all had 🍔s, 🍟s, 🍪s and 🍰." EmojiUtils.htmlify(text); //also returns A 🐱, 🐶 and a 🐭 became friends. For the 🐶's birthday party, they all had 🍔s, 🍟s, 🍪s and 🍰. ``` ## hexHtmlify Converts unicode characters in text to corresponding decimal hexadecimal html entities ``` String text = "A :cat:, :dog: and a :mouse: became friends. For the :dog:'s birthday party, they all had :hamburger:s, :fries:s, :cookie:s and :cake:."; EmojiUtils.hexHtmlify(text); //returns A 🐱, 🐶 and a 🐭 became friends. For the 🐶's birthday party, they all had 🍔s, 🍟s, 🍪s and 🍰. String text = "A 🐱, 🐶 and a 🐭 became friends. For the 🐶's birthday party, they all had 🍔s, 🍟s, 🍪s and 🍰." EmojiUtils.hexHtmlify(text); //returns A 🐱, 🐶 and a 🐭 became friends. For the 🐶's birthday party, they all had 🍔s, 🍟s, 🍪s and 🍰. ``` ## htmlify as Surrogate Entities Converts unicode characters in text to corresponding decimal surrogate html entities ``` String text = "😃"; EmojiUtils.htmlify(text, true); //returns �� ``` ##shortCodify ``` String text = "A 🐱, 🐶 and a 🐭 became friends❤️. For 🐶's birthday party, they all had 🍔s, 🍟s, 🍪s and 🍰."; EmojiUtils.shortCodify(text); //returns A :cat:, :dog: and a :mouse: became friends:heart:. For :dog:'s birthday party, they all had :hamburger:s, :fries:s, :cookie:s and :cake:. text = ":):-),:-):-]:-xP=*:*<3:P:p,=-)"; EmojiUtils.shortCodify(text); //returns :smiley::smiley::sweat_smile::smiley::no_mouth::stuck_out_tongue_closed_eyes::kissing::kissing::heart::stuck_out_tongue::stuck_out_tongue::sweat_smile: ``` ## RemoveAllEmojis Removes unicode emoji characters from the passed string ``` String emojiText = "A 🐱, 🐱 and a 🐭 became friends❤️. For 🐶's birthday party, they all had 🍔s, 🍟s, 🍪s and 🍰."; EmojiUtils.removeAllEmojis(emojiText);//"A , and a became friends. For 's birthday party, they all had s, s, s and . ``` ## countEmojis Counts emojis in a String ``` String text = "A 🐱, 🐶, :coyote: and a :mouse: became friends. For :dog:'s birthday party, they all had 🍔s, :fries:s, :cookie:s and :cake:."; EmojiUtils.countEmojis(text); //returns 8 ``` ## Stop words support Add stop words to filter out certain words from emoji conversion ``` String text = "http://www.github.com and https://www.google.com are awesome :-)."; EmojiManager.addStopWords("http://", "https://"); EmojiUtils.emojify(userText) //returns http://www.github.com and https://www.google.com are awesome 😃. ``` ## License: Copyright 2016 Krishna Chaitanya Thota (kcthota@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at: http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. [github/gemoji's](https://github.com/github/gemoji) license: octocat, squirrel, shipit Copyright (c) 2013 GitHub Inc. All rights reserved. bowtie, neckbeard, fu Copyright (c) 2013 37signals, LLC. All rights reserved. feelsgood, finnadie, goberserk, godmode, hurtrealbad, rage 1-4, suspect Copyright (c) 2013 id Software. All rights reserved. trollface Copyright (c) 2013 whynne@deviantart. All rights reserved. All other images Copyright (c) 2013 Apple Inc. All rights reserved. [wooorm/emoticon's](https://github.com/wooorm/emoticon) license: Copyright (c) 2014 Titus Wormer [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/kcthota/emoji4j/trend.png)](https://bitdeli.com/free "Bitdeli Badge") ================================================ FILE: pom.xml ================================================ 4.0.0 com.kcthota emoji4j 6.1-SNAPSHOT Emoji4j https://github.com/kcthota/emoji4j Java library to convert short codes, html entities to emojis and vice-versa 2015 kcthota Krishna Chaitanya Thota kcthota at gmail dot com https://github.com/kcthota Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0.txt scm:git:git://github.com/kcthota/emoji4j.git scm:git:git@github.com:kcthota/emoji4j.git https://github.com/kcthota/emoji4j UTF-8 2.10.2 4.13 com.fasterxml.jackson.core jackson-core ${jackson.version} com.fasterxml.jackson.core jackson-databind ${jackson.version} junit junit ${junit.version} test org.assertj assertj-core 3.14.0 test com.googlecode.lambdaj lambdaj 2.3.3 org.apache.maven.plugins maven-surefire-plugin 3.0.0-M4 org.apache.maven.plugins maven-compiler-plugin 3.8.1 1.9 1.9 1.9 1.9 org.eluder.coveralls coveralls-maven-plugin 4.3.0 org.codehaus.mojo cobertura-maven-plugin 2.7 xml 256m true maven-resources-plugin 3.1.0 default-testResources process-test-resources testResources default-resources process-resources resources ossrh https://oss.sonatype.org/content/repositories/snapshots ossrh https://oss.sonatype.org/service/local/staging/deploy/maven2/ ================================================ FILE: src/main/java/emoji4j/AbstractEmoji.java ================================================ package emoji4j; import java.util.regex.Pattern; /** * * @author Krishna Chaitanya Thota * */ public abstract class AbstractEmoji { protected static final Pattern shortCodePattern = Pattern.compile(":(\\w+):"); protected static final Pattern htmlEntityPattern = Pattern.compile("&#\\w+;"); protected static final Pattern htmlSurrogateEntityPattern = Pattern.compile("(?&#\\w+;)(?&#\\w+;)"); protected static final Pattern htmlSurrogateEntityPattern2 = Pattern.compile("&#\\w+;&#\\w+;&#\\w+;&#\\w+;"); protected static final Pattern shortCodeOrHtmlEntityPattern = Pattern.compile(":\\w+:|(?

&#\\w+;)(?

&#\\w+;)(?&#\\w+;)(?&#\\w+;)|(?&#\\w+;)(?&#\\w+;)|&#\\w+;"); /** * Helper to convert emoji characters to html entities in a string * * @param text String to htmlify * @param isHex isHex * @return htmlified string */ protected static String htmlifyHelper(String text, boolean isHex, boolean isSurrogate) { StringBuffer sb = new StringBuffer(); for (int i = 0; i < text.length(); i++) { int ch = text.codePointAt(i); if (ch <= 128) { sb.appendCodePoint(ch); } else if (ch > 128 && (ch < 159 || (ch >= 55296 && ch <= 57343))) { // don't write illegal html characters // refer // http://en.wikipedia.org/wiki/Character_encodings_in_HTML // Illegal characters section continue; } else { if (isHex) { sb.append("&#x" + Integer.toHexString(ch) + ";"); } else { if(isSurrogate) { double H = Math.floor((ch - 0x10000) / 0x400) + 0xD800; double L = ((ch - 0x10000) % 0x400) + 0xDC00; sb.append("&#"+String.format("%.0f", H)+";&#"+String.format("%.0f", L)+";"); } else { sb.append("&#" + ch + ";"); } } } } return sb.toString(); } } ================================================ FILE: src/main/java/emoji4j/Emoji.java ================================================ package emoji4j; import java.util.List; import java.util.regex.Matcher; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; /** * Emoji * @author Krishna Chaitanya Thota * */ @JsonIgnoreProperties(ignoreUnknown = true) public class Emoji extends AbstractEmoji { private String emoji; private List aliases; private String hexHtml; private String decimalHtml; private String decimalHtmlShort; private String hexHtmlShort; private String decimalSurrogateHtml; private List emoticons; /** * Gets the unicode emoji character * @return Emoji String */ public String getEmoji() { return emoji; } public void setEmoji(String emoji) { setDecimalHtml(EmojiUtils.htmlifyHelper(emoji,false, false)); setHexHtml(EmojiUtils.htmlifyHelper(emoji,true, false)); setDecimalSurrogateHtml(EmojiUtils.htmlifyHelper(emoji,false, true)); this.emoji = emoji; } /** * Gets the list of all shortcodes for the emoji. shortcode is not enclosed in colons. * @return List of all aliases */ public List getAliases() { return aliases; } public void setAliases(List aliases) { this.aliases = aliases; } /** * Gets the hexadecimal html entity for the emoji * @return the hexadecimal html string */ public String getHexHtml() { return hexHtml; } public void setHexHtml(String hexHtml) { this.hexHtml = hexHtml; Matcher matcher = htmlSurrogateEntityPattern.matcher(hexHtml); if(matcher.find()) { String signifiantHtmlEntity = matcher.group("H"); this.setHexHtmlShort(signifiantHtmlEntity); } else { this.setHexHtmlShort(hexHtml); } } /** * Gets the decimal html entity for the emoji * @return the decimal html string */ public String getDecimalHtml() { return decimalHtml; } public void setDecimalHtml(String decimalHtml) { this.decimalHtml = decimalHtml; Matcher matcher = htmlSurrogateEntityPattern.matcher(decimalHtml); if(matcher.find()) { String signifiantHtmlEntity = matcher.group("H"); this.setDecimalHtmlShort(signifiantHtmlEntity); } else { this.setDecimalHtmlShort(decimalHtml); } } /** * Gets the list of emoticons associated with the emoji * @return List of all emoticons associated with the emoji */ public List getEmoticons() { return emoticons; } public void setEmoticons(List emoticons) { //for(String emoticon:emoticons) { //EmojiManager.addEmoticon(emoticon); //} this.emoticons = emoticons; } public String getDecimalSurrogateHtml() { return decimalSurrogateHtml; } public void setDecimalSurrogateHtml(String decimalSurrogateHtml) { this.decimalSurrogateHtml = decimalSurrogateHtml; } public String getDecimalHtmlShort() { return decimalHtmlShort; } public void setDecimalHtmlShort(String decimalHtmlShort) { this.decimalHtmlShort = decimalHtmlShort; } public String getHexHtmlShort() { return hexHtmlShort; } public void setHexHtmlShort(String hexHtmlShort) { this.hexHtmlShort = hexHtmlShort; } } ================================================ FILE: src/main/java/emoji4j/EmojiManager.java ================================================ package emoji4j; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.type.TypeFactory; /** * Loads emojis from resource bundle * @author Krishna Chaitanya Thota * */ public class EmojiManager { private static Pattern emoticonRegexPattern; private static List emojiData; static { try { ObjectMapper mapper = new ObjectMapper(); InputStream stream = EmojiManager.class.getResourceAsStream("/emoji.json"); emojiData = mapper.readValue(stream, TypeFactory.defaultInstance().constructCollectionType(List.class, Emoji.class)); stream.close(); processEmoticonsToRegex(); } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } } /** * Returns the complete emoji data * @return List of emoji objects */ public static List data() { return emojiData; } /** * Returns the Regex which can match all emoticons in a string * @return regex pattern for emoticons */ public static Pattern getEmoticonRegexPattern() { return emoticonRegexPattern; } /** * Processes the Emoji data to emoticon regex */ private static void processEmoticonsToRegex() { List emoticons=new ArrayList(); for(Emoji e: emojiData) { if(e.getEmoticons()!=null) { emoticons.addAll(e.getEmoticons()); } } //List of emotions should be pre-processed to handle instances of subtrings like :-) :- //Without this pre-processing, emoticons in a string won't be processed properly for(int i=0;i emojiList) { StringBuilder sb=new StringBuilder(); for(String emoticon: emojiList) { if(sb.length() !=0) { sb.append("|"); } sb.append(Pattern.quote(emoticon)); } return Pattern.compile(sb.toString()); } } ================================================ FILE: src/main/java/emoji4j/EmojiUtils.java ================================================ package emoji4j; import org.hamcrest.Matchers; import static ch.lambdaj.Lambda.having; import static ch.lambdaj.Lambda.on; import static ch.lambdaj.Lambda.selectFirst; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Utils to deal with emojis * * @author Krishna Chaitanya Thota * */ public class EmojiUtils extends AbstractEmoji { /** * Get emoji by unicode, short code, decimal html entity or hexadecimal html * entity * * @param code unicode, short code, decimal html entity or hexadecimal html * @return Emoji */ public static Emoji getEmoji(String code) { Matcher m = shortCodePattern.matcher(code); // test for shortcode with colons if (m.find()) { code = m.group(1); } Emoji emoji = selectFirst( EmojiManager.data(), having(on(Emoji.class).getEmoji(), Matchers.equalTo(code)).or(having(on(Emoji.class).getEmoji(), Matchers.equalTo(code))) .or(having(on(Emoji.class).getHexHtml(), Matchers.equalToIgnoringCase(code))) .or(having(on(Emoji.class).getDecimalHtml(), Matchers.equalToIgnoringCase(code))) .or(having(on(Emoji.class).getDecimalSurrogateHtml(), Matchers.equalToIgnoringCase(code))) .or(having(on(Emoji.class).getHexHtmlShort(), Matchers.equalToIgnoringCase(code))) .or(having(on(Emoji.class).getDecimalHtmlShort(), Matchers.equalToIgnoringCase(code))) .or(having(on(Emoji.class).getAliases(), Matchers.hasItem(code))) .or(having(on(Emoji.class).getEmoticons(), Matchers.hasItem(code)))); return emoji; } /** * Checks if an Emoji exists for the unicode, short code, decimal or * hexadecimal html entity * * @param code unicode, short code, decimal html entity or hexadecimal html * @return is emoji */ public static boolean isEmoji(String code) { return getEmoji(code) == null ? false : true; } /** * Converts emoji short codes or html entities in string with emojis * * @param text String to emojify * @return emojified String */ public static String emojify(String text) { return emojify(text, 0); } private static String emojify(String text, int startIndex) { text = processStringWithRegex(text, shortCodeOrHtmlEntityPattern, startIndex, true); // emotions should be processed in second go. // this will avoid conflicts with shortcodes. For Example: :p:p should // not // be processed as shortcode, but as emoticon text = processStringWithRegex(text, EmojiManager.getEmoticonRegexPattern(), startIndex, true); return text; } /** * Common method used for processing the string to replace with emojis * * @param text * @param regex * @return */ private static String processStringWithRegex(String text, Pattern pattern, int startIndex, boolean recurseEmojify) { Matcher matcher = pattern.matcher(text); StringBuffer sb = new StringBuffer(); int resetIndex = 0; if(startIndex > 0) { matcher.region(startIndex, text.length()); } while (matcher.find()) { String emojiCode = matcher.group(); Emoji emoji = getEmoji(emojiCode); // replace matched tokens with emojis if(emoji!=null) { matcher.appendReplacement(sb, emoji.getEmoji()); } else { if(htmlSurrogateEntityPattern2.matcher(emojiCode).matches()) { String highSurrogate1 = matcher.group("H1"); String highSurrogate2 = matcher.group("H2"); String lowSurrogate1 = matcher.group("L1"); String lowSurrogate2 = matcher.group("L2"); matcher.appendReplacement(sb, processStringWithRegex(highSurrogate1+highSurrogate2, shortCodeOrHtmlEntityPattern, 0, false)); //basically this handles &#junk1;❤️&#junk2; scenario //verifies if &#junk1;❤ or &#junk1; are valid emojis via recursion //if not move past &#junk1; and reset the cursor to ❤ if(sb.toString().endsWith(highSurrogate2)) { resetIndex = sb.length() - highSurrogate2.length(); } else { resetIndex = sb.length(); } sb.append(lowSurrogate1); sb.append(lowSurrogate2); break; } else if(htmlSurrogateEntityPattern.matcher(emojiCode).matches()) { //could be individual html entities assumed as surrogate pair String highSurrogate = matcher.group("H"); String lowSurrogate = matcher.group("L"); matcher.appendReplacement(sb, processStringWithRegex(highSurrogate, htmlEntityPattern, 0, true)); resetIndex = sb.length(); sb.append(lowSurrogate); break; } else { matcher.appendReplacement(sb, emojiCode); } } } matcher.appendTail(sb); //do not recurse emojify when coming here through htmlSurrogateEntityPattern2..so we get a chance to check if the tail //is part of a surrogate entity if(recurseEmojify && resetIndex > 0) { return emojify(sb.toString(), resetIndex); } return sb.toString(); } /** * Counts valid emojis passed string * * @param text String to count emoji characters in. * @return returns count of emojis */ public static int countEmojis(String text) { String htmlifiedText = htmlify(text); // regex to identify html entitities in htmlified text Matcher matcher = htmlEntityPattern.matcher(htmlifiedText); int counter = 0; while (matcher.find()) { String emojiCode = matcher.group(); if (isEmoji(emojiCode)) { counter++; } } return counter; } /** * Converts unicode characters in text to corresponding decimal html * entities * * @param text String to htmlify * @return htmlified String */ public static String htmlify(String text) { String emojifiedStr = emojify(text); return htmlifyHelper(emojifiedStr, false, false); } public static String htmlify(String text, boolean asSurrogate) { String emojifiedStr = emojify(text); return htmlifyHelper(emojifiedStr, false, asSurrogate); } /** * Converts unicode characters in text to corresponding hexadecimal html * entities * * @param text String to hexHtmlify * @return hexadecimal htmlified string */ public static String hexHtmlify(String text) { String emojifiedStr = emojify(text); return htmlifyHelper(emojifiedStr, true, false); } /** * Converts emojis, hex, decimal htmls, emoticons in a string to short codes * * @param text String to shortcodify * @return shortcodified string */ public static String shortCodify(String text) { String emojifiedText = emojify(text); // TODO - this approach is ugly, need to find an optimal way to replace // the emojis // could not find an ideal way to identify emojis in the passed string // characters like <3 has multiple characters, but doesn't have // surrogate pairs // so at this point, we iterate through all the emojis and replace with // short codes for (Emoji emoji : EmojiManager.data()) { StringBuilder shortCodeBuilder = new StringBuilder(); shortCodeBuilder.append(":").append(emoji.getAliases().get(0)).append(":"); emojifiedText = emojifiedText.replace(emoji.getEmoji(), shortCodeBuilder.toString()); } return emojifiedText; } /** * Removes all emoji characters from the passed string. This method does not remove html characters, shortcodes. * To remove all shortcodes, html characters, emojify and then pass the emojified string to this method. * @param emojiText String to remove emoji's from. * @return emoji stripped string */ public static String removeAllEmojis(String emojiText) { for (Emoji emoji : EmojiManager.data()) { emojiText = emojiText.replace(emoji.getEmoji(), ""); } return emojiText; } } ================================================ FILE: src/main/resources/emoji.json ================================================ [ { "emoji": "😀" , "description": "grinning face" , "category": "Smileys & Emotion" , "aliases": [ "grinning" ] , "tags": [ "smile" , "happy" ] , "unicode_version": "6.1" , "ios_version": "6.0" } , { "emoji": "😃" , "description": "grinning face with big eyes" , "category": "Smileys & Emotion" , "aliases": [ "smiley" ] , "tags": [ "happy" , "joy" , "haha" ] , "emoticons": [ ":)", ":]", ":-)", ":-]", "=)", "=]", "=-)", "=-]" ], "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😄" , "description": "grinning face with smiling eyes" , "category": "Smileys & Emotion" , "aliases": [ "smile" ] , "tags": [ "happy" , "joy" , "laugh" , "pleased" ] , "emoticons": [ ":D", ":-D", "=D", "=-D" ], "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😁" , "description": "beaming face with smiling eyes" , "category": "Smileys & Emotion" , "aliases": [ "grin" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😆" , "description": "grinning squinting face" , "category": "Smileys & Emotion" , "aliases": [ "laughing" , "satisfied" ] , "tags": [ "happy" , "haha" ] , "emoticons": [ "x)", "x]", "xD", "x-)", "x-]", "x-D", "X)", "X]", "X-)", "X-]", "X-D" ], "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😅" , "description": "grinning face with sweat" , "category": "Smileys & Emotion" , "aliases": [ "sweat_smile" ] , "tags": [ "hot" ] , "emoticons": [ ",:)", ",:]", ",:D", ",:-)", ",:-]", ",:-D", ",=)", ",=]", ",=D", ",=-)", ",=-]", ",=-D", "':)", "':]", "':D", "':-)", "':-]", "':-D", "'=)", "'=]", "'=D", "'=-)", "'=-]", "'=-D" ], "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🤣" , "description": "rolling on the floor laughing" , "category": "Smileys & Emotion" , "aliases": [ "rofl" ] , "tags": [ "lol" , "laughing" ] , "unicode_version": "9.0" , "ios_version": "10.2" } , { "emoji": "😂" , "description": "face with tears of joy" , "category": "Smileys & Emotion" , "aliases": [ "joy" ] , "tags": [ "tears" ] ,"emoticons": [ ":,)", ":,]", ":,D", ":,-)", ":,-]", ":,-D", ":')", ":']", ":'D", ":'-)", ":'-]", ":'-D", "=,)", "=,]", "=,D", "=,-)", "=,-]", "=,-D", "=')", "=']", "='D", "='-)", "='-]", "='-D" ], "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🙂" , "description": "slightly smiling face" , "category": "Smileys & Emotion" , "aliases": [ "slightly_smiling_face" ] , "tags": [ ] , "unicode_version": "7.0" , "ios_version": "9.1" } , { "emoji": "🙃" , "description": "upside-down face" , "category": "Smileys & Emotion" , "aliases": [ "upside_down_face" ] , "tags": [ ] , "unicode_version": "8.0" , "ios_version": "9.1" } , { "emoji": "😉" , "description": "winking face" , "category": "Smileys & Emotion" , "aliases": [ "wink" ] , "tags": [ "flirt" ] , "emoticons": [ ";)", ";]", ";D", ";-)", ";-]", ";-D" ], "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😊" , "description": "smiling face with smiling eyes" , "category": "Smileys & Emotion" , "aliases": [ "blush" ] , "tags": [ "proud" ] ,"emoticons": [ ":\")", ":\"]", ":\"D", ":-\")", ":-\"]", ":-\"D", "=\")", "=\"]", "=\"D", "=-\")", "=-\"]", "=-\"D" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😇" , "description": "smiling face with halo" , "category": "Smileys & Emotion" , "aliases": [ "innocent" ] , "tags": [ "angel" ] ,"emoticons": [ "o:)", "o:]", "o:D", "o:-)", "o:-]", "o:-D", "o=)", "o=]", "o=D", "o=-)", "o=-]", "o=-D", "O:)", "O:]", "O:D", "O:-)", "O:-]", "O:-D", "O=)", "O=]", "O=D", "O=-)", "O=-]", "O=-D", "0:)", "0:]", "0:D", "0:-)", "0:-]", "0:-D", "0=)", "0=]", "0=D", "0=-)", "0=-]", "0=-D" ], "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🥰" , "description": "smiling face with hearts" , "category": "Smileys & Emotion" , "aliases": [ "smiling_face_with_three_hearts" ] , "tags": [ "love" ] , "unicode_version": "11.0" , "ios_version": "12.1" } , { "emoji": "😍" , "description": "smiling face with heart-eyes" , "category": "Smileys & Emotion" , "aliases": [ "heart_eyes" ] , "tags": [ "love" , "crush" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🤩" , "description": "star-struck" , "category": "Smileys & Emotion" , "aliases": [ "star_struck" ] , "tags": [ "eyes" ] , "unicode_version": "11.0" , "ios_version": "12.1" } , { "emoji": "😘" , "description": "face blowing a kiss" , "category": "Smileys & Emotion" , "aliases": [ "kissing_heart" ] , "tags": [ "flirt" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😗" , "description": "kissing face" , "category": "Smileys & Emotion" , "aliases": [ "kissing" ] , "tags": [ ] ,"emoticons": [ ":*", ":-*", "=*", "=-*" ], "unicode_version": "6.1" , "ios_version": "6.0" } , { "emoji": "☺️" , "description": "smiling face" , "category": "Smileys & Emotion" , "aliases": [ "relaxed" ] , "tags": [ "blush" , "pleased" ] , "unicode_version": "" , "ios_version": "6.0" } , { "emoji": "😚" , "description": "kissing face with closed eyes" , "category": "Smileys & Emotion" , "aliases": [ "kissing_closed_eyes" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😙" , "description": "kissing face with smiling eyes" , "category": "Smileys & Emotion" , "aliases": [ "kissing_smiling_eyes" ] , "tags": [ ] , "unicode_version": "6.1" , "ios_version": "6.0" } , { "emoji": "😋" , "description": "face savoring food" , "category": "Smileys & Emotion" , "aliases": [ "yum" ] , "tags": [ "tongue" , "lick" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😛" , "description": "face with tongue" , "category": "Smileys & Emotion" , "aliases": [ "stuck_out_tongue" ] , "tags": [ ] , "emoticons": [ ":p", ":P", ":d", ":-p", ":-P", ":-d", "=p", "=P", "=d", "=-p", "=-P", "=-d" ], "unicode_version": "6.1" , "ios_version": "6.0" } , { "emoji": "😜" , "description": "winking face with tongue" , "category": "Smileys & Emotion" , "aliases": [ "stuck_out_tongue_winking_eye" ] , "tags": [ "prank" , "silly" ] ,"emoticons": [ ";p", ";P", ";d", ";-p", ";-P", ";-d" ], "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🤪" , "description": "zany face" , "category": "Smileys & Emotion" , "aliases": [ "zany_face" ] , "tags": [ "goofy" , "wacky" ] , "unicode_version": "11.0" , "ios_version": "12.1" } , { "emoji": "😝" , "description": "squinting face with tongue" , "category": "Smileys & Emotion" , "aliases": [ "stuck_out_tongue_closed_eyes" ] , "tags": [ "prank" ] ,"emoticons": [ "xP", "x-p", "x-P", "x-d", "Xp", "Xd", "X-p", "X-P", "X-d" ], "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🤑" , "description": "money-mouth face" , "category": "Smileys & Emotion" , "aliases": [ "money_mouth_face" ] , "tags": [ "rich" ] , "unicode_version": "8.0" , "ios_version": "9.1" } , { "emoji": "🤗" , "description": "hugging face" , "category": "Smileys & Emotion" , "aliases": [ "hugs" ] , "tags": [ ] , "unicode_version": "8.0" , "ios_version": "9.1" } , { "emoji": "🤭" , "description": "face with hand over mouth" , "category": "Smileys & Emotion" , "aliases": [ "hand_over_mouth" ] , "tags": [ "quiet" , "whoops" ] , "unicode_version": "11.0" , "ios_version": "12.1" } , { "emoji": "🤫" , "description": "shushing face" , "category": "Smileys & Emotion" , "aliases": [ "shushing_face" ] , "tags": [ "silence" , "quiet" ] , "unicode_version": "11.0" , "ios_version": "12.1" } , { "emoji": "🤔" , "description": "thinking face" , "category": "Smileys & Emotion" , "aliases": [ "thinking" ] , "tags": [ ] , "unicode_version": "8.0" , "ios_version": "9.1" } , { "emoji": "🤐" , "description": "zipper-mouth face" , "category": "Smileys & Emotion" , "aliases": [ "zipper_mouth_face" ] , "tags": [ "silence" , "hush" ] , "unicode_version": "8.0" , "ios_version": "9.1" } , { "emoji": "🤨" , "description": "face with raised eyebrow" , "category": "Smileys & Emotion" , "aliases": [ "raised_eyebrow" ] , "tags": [ "suspicious" ] , "unicode_version": "11.0" , "ios_version": "12.1" } , { "emoji": "😐" , "description": "neutral face" , "category": "Smileys & Emotion" , "aliases": [ "neutral_face" ] , "tags": [ "meh" ] ,"emoticons": [ ":|", ":-|", "=|", "=-|" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😑" , "description": "expressionless face" , "category": "Smileys & Emotion" , "aliases": [ "expressionless" ] , "tags": [ ] , "unicode_version": "6.1" , "ios_version": "6.0" } , { "emoji": "😶" , "description": "face without mouth" , "category": "Smileys & Emotion" , "aliases": [ "no_mouth" ] , "tags": [ "mute" , "silence" ] ,"emoticons": [ ":-" ], "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😏" , "description": "smirking face" , "category": "Smileys & Emotion" , "aliases": [ "smirk" ] , "tags": [ "smug" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😒" , "description": "unamused face" , "category": "Smileys & Emotion" , "aliases": [ "unamused" ] , "tags": [ "meh" ] , "emoticons": [ ":$", ":s", ":z", ":S", ":Z", ":-$", ":-s", ":-z", ":-S", ":-Z", "=$", "=s", "=z", "=S", "=Z", "=-$", "=-s", "=-z", "=-S", "=-Z" ], "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🙄" , "description": "face with rolling eyes" , "category": "Smileys & Emotion" , "aliases": [ "roll_eyes" ] , "tags": [ ] , "unicode_version": "8.0" , "ios_version": "9.1" } , { "emoji": "😬" , "description": "grimacing face" , "category": "Smileys & Emotion" , "aliases": [ "grimacing" ] , "tags": [ ] , "unicode_version": "6.1" , "ios_version": "6.0" } , { "emoji": "🤥" , "description": "lying face" , "category": "Smileys & Emotion" , "aliases": [ "lying_face" ] , "tags": [ "liar" ] , "unicode_version": "9.0" , "ios_version": "10.2" } , { "emoji": "😌" , "description": "relieved face" , "category": "Smileys & Emotion" , "aliases": [ "relieved" ] , "tags": [ "whew" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😔" , "description": "pensive face" , "category": "Smileys & Emotion" , "aliases": [ "pensive" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😪" , "description": "sleepy face" , "category": "Smileys & Emotion" , "aliases": [ "sleepy" ] , "tags": [ "tired" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🤤" , "description": "drooling face" , "category": "Smileys & Emotion" , "aliases": [ "drooling_face" ] , "tags": [ ] , "unicode_version": "9.0" , "ios_version": "10.2" } , { "emoji": "😴" , "description": "sleeping face" , "category": "Smileys & Emotion" , "aliases": [ "sleeping" ] , "tags": [ "zzz" ] , "unicode_version": "6.1" , "ios_version": "6.0" } , { "emoji": "😷" , "description": "face with medical mask" , "category": "Smileys & Emotion" , "aliases": [ "mask" ] , "tags": [ "sick" , "ill" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🤒" , "description": "face with thermometer" , "category": "Smileys & Emotion" , "aliases": [ "face_with_thermometer" ] , "tags": [ "sick" ] , "unicode_version": "8.0" , "ios_version": "9.1" } , { "emoji": "🤕" , "description": "face with head-bandage" , "category": "Smileys & Emotion" , "aliases": [ "face_with_head_bandage" ] , "tags": [ "hurt" ] , "unicode_version": "8.0" , "ios_version": "9.1" } , { "emoji": "🤢" , "description": "nauseated face" , "category": "Smileys & Emotion" , "aliases": [ "nauseated_face" ] , "tags": [ "sick" , "barf" , "disgusted" ] , "unicode_version": "9.0" , "ios_version": "10.2" } , { "emoji": "🤮" , "description": "face vomiting" , "category": "Smileys & Emotion" , "aliases": [ "vomiting_face" ] , "tags": [ "barf" , "sick" ] , "unicode_version": "11.0" , "ios_version": "12.1" } , { "emoji": "🤧" , "description": "sneezing face" , "category": "Smileys & Emotion" , "aliases": [ "sneezing_face" ] , "tags": [ "achoo" , "sick" ] , "unicode_version": "9.0" , "ios_version": "10.2" } , { "emoji": "🥵" , "description": "hot face" , "category": "Smileys & Emotion" , "aliases": [ "hot_face" ] , "tags": [ "heat" , "sweating" ] , "unicode_version": "11.0" , "ios_version": "12.1" } , { "emoji": "🥶" , "description": "cold face" , "category": "Smileys & Emotion" , "aliases": [ "cold_face" ] , "tags": [ "freezing" , "ice" ] , "unicode_version": "11.0" , "ios_version": "12.1" } , { "emoji": "🥴" , "description": "woozy face" , "category": "Smileys & Emotion" , "aliases": [ "woozy_face" ] , "tags": [ "groggy" ] , "unicode_version": "11.0" , "ios_version": "12.1" } , { "emoji": "😵" , "description": "dizzy face" , "category": "Smileys & Emotion" , "aliases": [ "dizzy_face" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🤯" , "description": "exploding head" , "category": "Smileys & Emotion" , "aliases": [ "exploding_head" ] , "tags": [ "mind" , "blown" ] , "unicode_version": "11.0" , "ios_version": "12.1" } , { "emoji": "🤠" , "description": "cowboy hat face" , "category": "Smileys & Emotion" , "aliases": [ "cowboy_hat_face" ] , "tags": [ ] , "unicode_version": "9.0" , "ios_version": "10.2" } , { "emoji": "🥳" , "description": "partying face" , "category": "Smileys & Emotion" , "aliases": [ "partying_face" ] , "tags": [ "celebration" , "birthday" ] , "unicode_version": "11.0" , "ios_version": "12.1" } , { "emoji": "😎" , "description": "smiling face with sunglasses" , "category": "Smileys & Emotion" , "aliases": [ "sunglasses" ] , "tags": [ "cool" ] , "emoticons": [ "8)", "8]", "8D", "8-)", "8-]", "8-D", "B)", "B]", "B-)", "B-]", "B-D" ], "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🤓" , "description": "nerd face" , "category": "Smileys & Emotion" , "aliases": [ "nerd_face" ] , "tags": [ "geek" , "glasses" ] , "unicode_version": "8.0" , "ios_version": "9.1" } , { "emoji": "🧐" , "description": "face with monocle" , "category": "Smileys & Emotion" , "aliases": [ "monocle_face" ] , "tags": [ ] , "unicode_version": "11.0" , "ios_version": "12.1" } , { "emoji": "😕" , "description": "confused face" , "category": "Smileys & Emotion" , "aliases": [ "confused" ] , "tags": [ ] , "emoticons": [ ":/", ":\\", ":-/", ":-\\", "=/", "=\\", "=-/", "=-\\" ] , "unicode_version": "6.1" , "ios_version": "6.0" } , { "emoji": "😟" , "description": "worried face" , "category": "Smileys & Emotion" , "aliases": [ "worried" ] , "tags": [ "nervous" ] , "unicode_version": "6.1" , "ios_version": "6.0" } , { "emoji": "🙁" , "description": "slightly frowning face" , "category": "Smileys & Emotion" , "aliases": [ "slightly_frowning_face" ] , "tags": [ ] , "unicode_version": "7.0" , "ios_version": "9.1" } , { "emoji": "☹️" , "description": "frowning face" , "category": "Smileys & Emotion" , "aliases": [ "frowning_face" ] , "tags": [ ] , "unicode_version": "" , "ios_version": "9.1" } , { "emoji": "😮" , "description": "face with open mouth" , "category": "Smileys & Emotion" , "aliases": [ "open_mouth" ] , "tags": [ "surprise" , "impressed" , "wow" ] , "emoticons": [ ":o", ":O", ":0", ":-o", ":-O", ":-0", "=o", "=O", "=0", "=-o", "=-O", "=-0" ], "unicode_version": "6.1" , "ios_version": "6.0" } , { "emoji": "😯" , "description": "hushed face" , "category": "Smileys & Emotion" , "aliases": [ "hushed" ] , "tags": [ "silence" , "speechless" ] , "unicode_version": "6.1" , "ios_version": "6.0" } , { "emoji": "😲" , "description": "astonished face" , "category": "Smileys & Emotion" , "aliases": [ "astonished" ] , "tags": [ "amazed" , "gasp" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😳" , "description": "flushed face" , "category": "Smileys & Emotion" , "aliases": [ "flushed" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🥺" , "description": "pleading face" , "category": "Smileys & Emotion" , "aliases": [ "pleading_face" ] , "tags": [ "puppy" , "eyes" ] , "unicode_version": "11.0" , "ios_version": "12.1" } , { "emoji": "😦" , "description": "frowning face with open mouth" , "category": "Smileys & Emotion" , "aliases": [ "frowning" ] , "tags": [ ] , "emoticons": [ ":(", ":[", ":-(", ":-[", "=(", "=[", "=-(", "=-[" ] , "unicode_version": "6.1" , "ios_version": "6.0" } , { "emoji": "😧" , "description": "anguished face" , "category": "Smileys & Emotion" , "aliases": [ "anguished" ] , "tags": [ "stunned" ] , "unicode_version": "6.1" , "ios_version": "6.0" } , { "emoji": "😨" , "description": "fearful face" , "category": "Smileys & Emotion" , "aliases": [ "fearful" ] , "tags": [ "scared" , "shocked" , "oops" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😰" , "description": "anxious face with sweat" , "category": "Smileys & Emotion" , "aliases": [ "cold_sweat" ] , "tags": [ "nervous" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😥" , "description": "sad but relieved face" , "category": "Smileys & Emotion" , "aliases": [ "disappointed_relieved" ] , "tags": [ "phew" , "sweat" , "nervous" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😢" , "description": "crying face" , "category": "Smileys & Emotion" , "aliases": [ "cry" ] , "tags": [ "sad" , "tear" ] , "emoticons": [ ":,(", ":,[", ":,|", ":,-(", ":,-[", ":,-|", ":'(", ":'[", ":'|", ":'-(", ":'-[", ":'-|", "=,(", "=,[", "=,|", "=,-(", "=,-[", "=,-|", "='(", "='[", "='|", "='-(", "='-[", "='-|" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😭" , "description": "loudly crying face" , "category": "Smileys & Emotion" , "aliases": [ "sob" ] , "tags": [ "sad" , "cry" , "bawling" ] , "emoticons": [ ":,'(", ":,'[", ":,'-(", ":,'-[", ":',(", ":',[", ":',-(", ":',-[", "=,'(", "=,'[", "=,'-(", "=,'-[", "=',(", "=',[", "=',-(", "=',-[" ], "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😱" , "description": "face screaming in fear" , "category": "Smileys & Emotion" , "aliases": [ "scream" ] , "tags": [ "horror" , "shocked" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😖" , "description": "confounded face" , "category": "Smileys & Emotion" , "aliases": [ "confounded" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😣" , "description": "persevering face" , "category": "Smileys & Emotion" , "aliases": [ "persevere" ] , "tags": [ "struggling" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😞" , "description": "disappointed face" , "category": "Smileys & Emotion" , "aliases": [ "disappointed" ] , "tags": [ "sad" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😓" , "description": "downcast face with sweat" , "category": "Smileys & Emotion" , "aliases": [ "sweat" ] , "tags": [ ] , "emoticons": [ ",:(", ",:[", ",:-(", ",:-[", ",=(", ",=[", ",=-(", ",=-[", "':(", "':[", "':-(", "':-[", "'=(", "'=[", "'=-(", "'=-[" ], "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😩" , "description": "weary face" , "category": "Smileys & Emotion" , "aliases": [ "weary" ] , "tags": [ "tired" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😫" , "description": "tired face" , "category": "Smileys & Emotion" , "aliases": [ "tired_face" ] , "tags": [ "upset" , "whine" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🥱" , "description": "yawning face" , "category": "Smileys & Emotion" , "aliases": [ "yawning_face" ] , "tags": [ ] , "unicode_version": "12.0" , "ios_version": "13.0" } , { "emoji": "😤" , "description": "face with steam from nose" , "category": "Smileys & Emotion" , "aliases": [ "triumph" ] , "tags": [ "smug" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😡" , "description": "pouting face" , "category": "Smileys & Emotion" , "aliases": [ "rage" , "pout" ] , "tags": [ "angry" ] , "emoticons": [ ":@", ":-@", "=@", "=-@" ], "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😠" , "description": "angry face" , "category": "Smileys & Emotion" , "aliases": [ "angry" ] , "tags": [ "mad" , "annoyed" ] , "emoticons": [ ">:(", ">:[", ">:-(", ">:-[", ">=(", ">=[", ">=-(", ">=-[" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🤬" , "description": "face with symbols on mouth" , "category": "Smileys & Emotion" , "aliases": [ "cursing_face" ] , "tags": [ "foul" ] , "unicode_version": "11.0" , "ios_version": "12.1" } , { "emoji": "😈" , "description": "smiling face with horns" , "category": "Smileys & Emotion" , "aliases": [ "smiling_imp" ] , "tags": [ "devil" , "evil" , "horns" ] , "emoticons": [ "]:)", "]:]", "]:D", "]:-)", "]:-]", "]:-D", "]=)", "]=]", "]=D", "]=-)", "]=-]", "]=-D" ], "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "👿" , "description": "angry face with horns" , "category": "Smileys & Emotion" , "aliases": [ "imp" ] , "tags": [ "angry" , "devil" , "evil" , "horns" ] , "emoticons": [ "]:(", "]:[", "]:-(", "]:-[", "]=(", "]=[", "]=-(", "]=-[" ], "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "💀" , "description": "skull" , "category": "Smileys & Emotion" , "aliases": [ "skull" ] , "tags": [ "dead" , "danger" , "poison" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "☠️" , "description": "skull and crossbones" , "category": "Smileys & Emotion" , "aliases": [ "skull_and_crossbones" ] , "tags": [ "danger" , "pirate" ] , "unicode_version": "" , "ios_version": "9.1" } , { "emoji": "💩" , "description": "pile of poo" , "category": "Smileys & Emotion" , "aliases": [ "hankey" , "poop" , "shit" ] , "tags": [ "crap" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🤡" , "description": "clown face" , "category": "Smileys & Emotion" , "aliases": [ "clown_face" ] , "tags": [ ] , "unicode_version": "9.0" , "ios_version": "10.2" } , { "emoji": "👹" , "description": "ogre" , "category": "Smileys & Emotion" , "aliases": [ "japanese_ogre" ] , "tags": [ "monster" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "👺" , "description": "goblin" , "category": "Smileys & Emotion" , "aliases": [ "japanese_goblin" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "👻" , "description": "ghost" , "category": "Smileys & Emotion" , "aliases": [ "ghost" ] , "tags": [ "halloween" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "👽" , "description": "alien" , "category": "Smileys & Emotion" , "aliases": [ "alien" ] , "tags": [ "ufo" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "👾" , "description": "alien monster" , "category": "Smileys & Emotion" , "aliases": [ "space_invader" ] , "tags": [ "game" , "retro" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🤖" , "description": "robot" , "category": "Smileys & Emotion" , "aliases": [ "robot" ] , "tags": [ ] , "unicode_version": "8.0" , "ios_version": "9.1" } , { "emoji": "😺" , "description": "grinning cat" , "category": "Smileys & Emotion" , "aliases": [ "smiley_cat" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😸" , "description": "grinning cat with smiling eyes" , "category": "Smileys & Emotion" , "aliases": [ "smile_cat" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😹" , "description": "cat with tears of joy" , "category": "Smileys & Emotion" , "aliases": [ "joy_cat" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😻" , "description": "smiling cat with heart-eyes" , "category": "Smileys & Emotion" , "aliases": [ "heart_eyes_cat" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😼" , "description": "cat with wry smile" , "category": "Smileys & Emotion" , "aliases": [ "smirk_cat" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😽" , "description": "kissing cat" , "category": "Smileys & Emotion" , "aliases": [ "kissing_cat" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🙀" , "description": "weary cat" , "category": "Smileys & Emotion" , "aliases": [ "scream_cat" ] , "tags": [ "horror" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😿" , "description": "crying cat" , "category": "Smileys & Emotion" , "aliases": [ "crying_cat_face" ] , "tags": [ "sad" , "tear" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "😾" , "description": "pouting cat" , "category": "Smileys & Emotion" , "aliases": [ "pouting_cat" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🙈" , "description": "see-no-evil monkey" , "category": "Smileys & Emotion" , "aliases": [ "see_no_evil" ] , "tags": [ "monkey" , "blind" , "ignore" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🙉" , "description": "hear-no-evil monkey" , "category": "Smileys & Emotion" , "aliases": [ "hear_no_evil" ] , "tags": [ "monkey" , "deaf" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "🙊" , "description": "speak-no-evil monkey" , "category": "Smileys & Emotion" , "aliases": [ "speak_no_evil" ] , "tags": [ "monkey" , "mute" , "hush" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "💋" , "description": "kiss mark" , "category": "Smileys & Emotion" , "aliases": [ "kiss" ] , "tags": [ "lipstick" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "💌" , "description": "love letter" , "category": "Smileys & Emotion" , "aliases": [ "love_letter" ] , "tags": [ "email" , "envelope" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "💘" , "description": "heart with arrow" , "category": "Smileys & Emotion" , "aliases": [ "cupid" ] , "tags": [ "love" , "heart" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "💝" , "description": "heart with ribbon" , "category": "Smileys & Emotion" , "aliases": [ "gift_heart" ] , "tags": [ "chocolates" ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "💖" , "description": "sparkling heart" , "category": "Smileys & Emotion" , "aliases": [ "sparkling_heart" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "💗" , "description": "growing heart" , "category": "Smileys & Emotion" , "aliases": [ "heartpulse" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "💓" , "description": "beating heart" , "category": "Smileys & Emotion" , "aliases": [ "heartbeat" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "💞" , "description": "revolving hearts" , "category": "Smileys & Emotion" , "aliases": [ "revolving_hearts" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "💕" , "description": "two hearts" , "category": "Smileys & Emotion" , "aliases": [ "two_hearts" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "💟" , "description": "heart decoration" , "category": "Smileys & Emotion" , "aliases": [ "heart_decoration" ] , "tags": [ ] , "unicode_version": "6.0" , "ios_version": "6.0" } , { "emoji": "❣️" , "description": "heart exclamation" , "category": "Smileys & Emotion" , "aliases": [ "heavy_heart_exclamation" ] , "tags": [ ] , "unicode_version": "" , "ios_version": "9.1" } , { "emoji": "💔" , "description": "broken heart" , "category": "Smileys & Emotion" , "aliases": [ "broken_heart" ] , "tags": [ ] , "emoticons": [ "<\\3", "