kemoji
0.2.0indexedLibrary enhances applications with emoji support, offering character information, original emojis, and static search methods. Supports Emoji 14.0, features parsing, and removal functionalities.
Library enhances applications with emoji support, offering character information, original emojis, and static search methods. Supports Emoji 14.0, features parsing, and removal functionalities.
🛟 Kotlin Multiplatform Framework Emoji Support Library 🛟
kemoji is a library to add Emoji support to your Kotlin Application. This library contains character information about native emojis.
Inspired by vdurmont/emoji-java. The emoji data is based on the database files, unicode-emoji-test.txt and emoji.json from github/gemoji. However, emoji.json doesn't contain some necessary emojis, so kemoji adds the below original emojis.
kemoji supports until Emoji 14.0 characters. Because gemoji has never supported Emoji 15.* yet.
build.gradle.kts
implementation("io.github.seisuke:kemoji:0.2.0") //for common
implementation("io.github.seisuke:kemoji-jvm:0.2.0") //for JVM
implementation("io.github.seisuke:kemoji-js:0.2.0") //for Kotlin/JS
The EmojiManager provides several static methods to search through the emoji database:
getForTag returns all the emojis for a given taggetForAlias returns the emoji for an aliasisEmoji checks if a string is an emojiAn Emoji is a Data class, which provides the following properties:
data (
emoji: String,
description: String,
category: String,
aliases: List<String>,
tags: List<String>,
unicodeVersion: UnicodeVersion,
iosVersion: ,
fitzpatrickIndex: List<>,
vs16Index: List<>,
)
An EmojiList holds all Emoji. It is generated from EmojiGenerator#generateEmojiLists(), and it based on database files, unicode-emoji-test.txt and emoji.json.qjF
To replace all the emoji's unicodes found in a string by their aliases, use EmojiParser#parseToAliases(String).
For example:
val text = "An 😀awesome 😃string with a few 😉emojis!"
EmojiParser.parseToAliases(text)
// => "An :grinning:awesome :smiley:string with a few :wink:emojis!"
You can easily remove emojis from a string.
For example:
val text = "An 😀awesome 😃string with a few 😉emojis!";
EmojiParser.removeAllEmojis(text) // => "An awesome string with a few emojis!"
Coverage rate is over 95%.
EmojiTest#emojisGetByUnicodeTest and EmojiTest#emojisAlias pass tests of 4441 pattern emoji in unicode-emoji-test.txt expects unqualified them.
See a json file HERE.
getAllTags returns the available tagsgetAll returns all the emojiscontainsEmoji checks if a string contains any emojiisOnlyEmojis checks if a string is only emojiSurfaced from shared tags and platforms — no rankings paid for.