Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/wouterwisse/text-to-emoji
- Owner: WouterWisse
- License: mit
- Created: 2022-08-08T20:20:13.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-16T17:06:15.000Z (about 2 years ago)
- Last Synced: 2024-11-15T16:17:46.457Z (about 1 month ago)
- Topics: emoji, ios, swift, swift-package, text-to-emoji
- Language: Swift
- Homepage:
- Size: 3.16 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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.