An Ada 2012 library to replace names between colons with emojis. Supports Emoji version 13.1.
Ada.Text_IO.Put_Line (Emojis.Replace ("Ada is :heart_eyes: <3"));
This will print to the terminal:
Ada is 😍 🧡
Some of the text emojis like :o
and :p
are a prefix of certain labels.
Use the Completions
parameter to avoid the last one being replaced if the
text is used in some input field (when the user is pressing the Tab key to
cycle through all the labels):
Ada.Text_IO.Put_Line
(Emojis.Replace ("XD :o :p", Completions => Emojis.Lower_Case_Text_Emojis));
Prints:
😆 😮 :p
The function Labels
returns a list of all the labels.
The default value for the parameter Mappings
is Emojis.Text_Emojis
and contains
the following:
Text | Emoji |
---|---|
:) | 🙂 |
;) | 😉 |
:D | 😀 |
:'D | 😅 |
:') | 😅 |
:") | 😂 |
XD | 😆 |
X'D | 🤣 |
:o | 😮 |
:O | 😮 |
>:( | 😠 |
:( | 🙁 |
-_- | 😒 |
:'( | 😢 |
:"( | 😭 |
:p | 😛 |
:P | 😛 |
;p | 😜 |
;P | 😜 |
B) | 😎 |
:+) | 🤡 |
:(= | 🥵 |
o_O | 🤨 |
O_o | 🤨 |
XO= | 🤮 |
<3 | 🧡 |
In order to build the library, you need to have:
-
An Ada 2012 compiler
Use the library in your crates as follows:
$ alr with emojis
Read the contributing guidelines if you want to add a bugfix or an improvement.
The Ada code and unit tests are licensed under the Apache License 2.0. The first line of each Ada file should contain an SPDX license identifier tag that refers to this license:
SPDX-License-Identifier: Apache-2.0
Names and Unicode codepoints in package Emojis
are from emoji-data
project.