EmojiToText 1.6.0

dotnet add package EmojiToText --version 1.6.0
                    
NuGet\Install-Package EmojiToText -Version 1.6.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EmojiToText" Version="1.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EmojiToText" Version="1.6.0" />
                    
Directory.Packages.props
<PackageReference Include="EmojiToText" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EmojiToText --version 1.6.0
                    
#r "nuget: EmojiToText, 1.6.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EmojiToText@1.6.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EmojiToText&version=1.6.0
                    
Install as a Cake Addin
#tool nuget:?package=EmojiToText&version=1.6.0
                    
Install as a Cake Tool

EmojiToText

.NET NuGet Nuget License

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

Donation

If you want to support me and my work, feel free to donate a coffee

Buy me a coffee

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.

Version Downloads Last Updated
1.6.0 238 10/18/2024
1.5.0 106 10/14/2024
1.4.0 117 10/9/2024
1.3.1 121 10/8/2024
1.3.0 115 10/8/2024