EmojiToText 1.6.0
dotnet add package EmojiToText --version 1.6.0
NuGet\Install-Package EmojiToText -Version 1.6.0
<PackageReference Include="EmojiToText" Version="1.6.0" />
<PackageVersion Include="EmojiToText" Version="1.6.0" />
<PackageReference Include="EmojiToText" />
paket add EmojiToText --version 1.6.0
#r "nuget: EmojiToText, 1.6.0"
#:package EmojiToText@1.6.0
#addin nuget:?package=EmojiToText&version=1.6.0
#tool nuget:?package=EmojiToText&version=1.6.0
EmojiToText
Features
- Convert emojis to descriptive text.
- Convert text back into emojis.
- XUnit tests are implemented
- Supports the latest Unicode version 16.0
Installation
Install the package via NuGet:
dotnet add package EmojiToText
Or install it via Visual Studio NuGet package manager
Usage
Example usecases
- Accessibility: Convert emojis to text for screen readers, improving content accessibility.
- Text Processing: Enhance sentiment analysis or content moderation by converting emojis to readable text.
- Debugging: Simplify logs with emojis by converting them to descriptive text for easier analysis.
Emoji to Text
using EmojiToText;
class Program
{
static void Main(string[] args)
{
// Use this if your console does not support UTF-8
Console.OutputEncoding = System.Text.Encoding.UTF8;
string input = "Hello 😀!";
string result = EmojiConverter.ToText(input);
Console.WriteLine(result); // Output: Hello grinning face!
}
}
Text To Emoji
using EmojiToText;
class Program
{
static void Main(string[] args)
{
// Use this if your console does not support UTF-8
Console.OutputEncoding = System.Text.Encoding.UTF8;
string text = "grinning face";
string emoji = EmojiConverter.ToEmoji(text);
Console.WriteLine(emoji); // Output: 😀
}
}
Running Tests
First clone the repository:
git clone https://github.com/MeritonAliu/EmojiToText.git
To run the tests for this project, use the following command:
dotnet test
Roadmap
The roadmap can be fount at: ROADMAP
Benchmarks
The following benchmarks apply to the current EmojiConverter methods. The mutlitple benchmarks are done with 1000 emojis/texts.
Method | Mean | Error | StdDev | Allocated |
---|---|---|---|---|
ConvertSingleEmojiToText | 14.04 us | 0.111 us | 0.066 us | 48 B |
ConvertSingleTextToEmoji | 10.61 us | 0.307 us | 0.203 us | 32 B |
ConvertMultipleEmojiToText | 172.42 us | 0.436 us | 0.288 us | - |
ConvertMultipleTextToEmoji | 500.84 us | 1.132 us | 0.749 us | 6032 B |
If you want to benchmark it yourself, clone the repo and use:
dotnet run --project Benchmark/EmojiToText.Benchmarks.csproj -c Release
References
Author
@MeritonAliu - 2024
Contributing
Bug reports and contributions are welcome! Feel free to submit pull requests or file issues.
License
- The main project is licensed under the MIT License.
- Emoji data is governed by the Unicode License.
Donation
If you want to support me and my work, feel free to donate a coffee
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.