#emoji #search #unicode

no-std emojis

✨ Lookup, iterate over, and fuzzy search for emojis

4 releases

0.1.2 Apr 7, 2021
0.1.1 Mar 29, 2021
0.1.0 Mar 12, 2021
0.0.0 Mar 6, 2021

#206 in Text processing

29 downloads per month

MIT/Apache

350KB
2K SLoC

emojis

Crates.io Version Docs.rs Latest Build Status

✨ Lookup, iterate over, and fuzzy search for emojis.

Features

  • Lookup up emoji by Unicode value.
  • Lookup up emoji by GitHub shortcode.
  • Iterate over emojis in recommended order.
  • Iterate over emojis in an emoji group. E.g. "Smileys & Emotion" or "Flags".
  • Fuzzy search all emojis.
  • Based on the latest Unicode emoji spec (v13.1).

Examples

// lookup any emoji by Unicode value
let face = emojis::lookup("🤨").unwrap();
// or GitHub shortcode
let face = emojis::lookup("raised_eyebrow").unwrap();

assert_eq!(face.as_str(), "\u{1F928}");
assert_eq!(face.name(), "face with raised eyebrow");
assert_eq!(face.group(), emojis::Group::SmileysAndEmotion);
assert_eq!(face.shortcode().unwrap(), "raised_eyebrow");

// iterate over all the emojis.
let emoji = emojis::iter().next().unwrap();
assert_eq!(emoji, "😀");

// iterate over all the emojis in a group.
let emoji = emojis::Group::FoodAndDrink.emojis().next().unwrap();
assert_eq!(emoji, "🍇");

// fuzzy search for emojis.
let emoji = emojis::search("rket").next().unwrap();
assert_eq!(emoji, "🚀");

License

Licensed under either of

at your option.

Dependencies