Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wouterwisse/text-to-emoji

๐Ÿคทโ€โ™‚๏ธ Not sure why you'd need this.
https://github.com/wouterwisse/text-to-emoji

emoji ios swift swift-package text-to-emoji

Last synced: about 1 month ago
JSON representation

๐Ÿคทโ€โ™‚๏ธ Not sure why you'd need this.

Awesome Lists containing this project

README

        


text-to-emoji



text-to-๐Ÿคฉ

๐Ÿคทโ€โ™‚๏ธ Not sure why you'd need this.










## Installation
`Xcode` โ†’ `File` โ†’ `Add packages...` โ†’ enter url โ†’ `https://github.com/WouterWisse/text-to-emoji`

## How to use
#### Get an emoji
```swift
let emoji = await TextToEmoji.emoji(for: "tomato") // ๐Ÿ…
```
This is an `async` method that will `throw` the error `noMatchFound` if no emoji has been matched with the given text.

#### Get an emoji for a preferred category
```swift
let shrimp = TextToEmoji.emoji(for: "shrimp", preferredCategory: .foodAndDrink) // ๐Ÿค
```
```swift
let shrimp = TextToEmoji.emoji(for: "shrimp", preferredCategory: .animalsAndNature) // ๐Ÿฆ
```
With `preferredCategory` a certain emoji category can be given a higher priority. This can be very useful if the context of the search is known. For example, when looking for the word `shrimp`, two matching emoji's could be: `๐Ÿฆ` and `๐Ÿค`.

By passing `.foodAndDrink` as the `preferredCategory`, the first match will be `๐Ÿค`. Passing `.animalsAndNature` would result in `๐Ÿฆ`.

See `EmojiCategory.swift` for all categories.

## Localization
| Languages | Supported |
|--------------|-------------|
| ๐Ÿ‡ฌ๐Ÿ‡ง English | โœ… |
| ๐Ÿ‡ณ๐Ÿ‡ฑ Dutch | โœ… |
| ๐Ÿ‡ฉ๐Ÿ‡ช Deutsch | โณ |
| ๐Ÿ‡ช๐Ÿ‡ธ Espaรฑol | โณ |
| ๐Ÿ‡ซ๐Ÿ‡ท Franรงais | โณ |
| ๐Ÿ‡ฎ๐Ÿ‡น Italiano | โณ |
| ๐Ÿ‡ต๐Ÿ‡น Portuguรชs | โณ |

## Contribution
Feel free to help me out here, especially with the localization.

## Keep me caffeinated

Buy me a Coffee