## ๐งพ What is SubSlay?
**SubSlay** is a text-to-emoji transformer that turns plain text into expressive emoji sequences โ powered by semantic similarity (via GloVe vectors), direct keyword mappings, and fuzzy Levenshtein fallback.
> โจ `"Hello, world!"` โ `"๐ ๐"`
This crate is built entirely in Rust and is compatible with **native binaries** and **WebAssembly**, with no external files or setup required.
---
## ๐ Try It Live
๐ [SubSlay.app](https://subslay.app) โ Web demo powered by this crate
---
## ๐ Features
- ๐ฆ **Pure Rust** (no WASM bindings inside)
- ๐ฆ **No setup** โ GloVe + emoji mappings are embedded
- ๐ก **Keyword match**, **cosine similarity**, and **Levenshtein** fallback
- ๐งช Fully tested
- ๐ Easily used in WASM apps (via your own wrapper)
---
## โจ Usage
Add it to your project:
```toml
[dependencies]
subslay = "0.1.8"
````
Use it in Rust:
```rust
use subslay::EmojiStylist;
fn main() {
let stylist = EmojiStylist::new().unwrap();
let emojis = stylist.slay("Hello, world!");
println!("{:?}", emojis); // ["๐", "๐"]
}
```
---
## ๐ง How It Works
SubSlay internally loads:
* `emoji.json` โ maps emojis to keyword lists
* `glove.txt` โ GloVe-style word embeddings
Then it:
1. Matches input words to emoji keywords
2. Uses **cosine similarity** to suggest close matches
3. Falls back to **Levenshtein distance** if all else fails
All logic is pure Rust and runs without filesystem access โ ideal for embedded and WASM environments.
---
## ๐ Project Layout
```bash
subslay/
โโโ src/
โ โโโ lib.rs # Emoji transformer engine
โโโ static/
โ โโโ emoji.json # Emoji โ keywords (embedded)
โ โโโ glove.txt # GloVe embeddings (embedded)
โโโ Cargo.toml
โโโ README.md
```
---
## โ
Test
Run tests with:
```bash
cargo test
```
All embeddings and mappings are embedded, so no setup is needed.
---
## ๐ค Contribute
Feel free to open issues or pull requests for:
* New emoji suggestions
* Better embedding support
* Fallback improvements
* WASM wrappers or examples
---
## ๐ License
MIT ยฉ [AndriaK](mailto:hey@andriak.com)<br>
GitHub: [github.com/8ria/subslay](https://github.com/8ria/subslay)
---
> *"Built to slay, not obey."* ๐
๐ป