A REST API for Tifinagh script transliteration and Amazigh dictionary lookup. Built with Bun + Hono.
# Omniversify Tifinagh Dictionary API
A REST API for Tifinagh script transliteration and Amazigh dictionary lookup. Built with Bun + Hono.
## Features
- **Transliteration** — convert between Arabic, Latin, and Tifinagh scripts
- **Dictionary lookup** — search for word meanings across Arabic, English, and Tamazight
- **Auto-detection** — automatically detects input script when not specified
- **Fuzzy search** — matches exact, prefix, and contains queries
## Prerequisites
- Bun >= 1.0
## Quick Start
```bash
# Install dependencies
bun install
# Download the dictionary dataset (required for /translate)
bun run download-dataset
# Start the server
bun run start
```
The server will start on `
localhost` (or `$PORT` if set).
## Endpoints
### `GET /help`
Returns a JSON description of all available endpoints with examples.
### `POST /retype`
Convert text between Arabic, Latin, and Tifinagh scripts.
**Request body:**
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `text` | string | yes | The text to convert |
| `from` | string | no | Source script: `"arabic"`, `"latin"`, or `"tifinagh"` (auto-detected if omitted) |
| `to` | string | no | Target script: `"arabic"`, `"latin"`, or `"tifinagh"` (auto-detected if omitted) |
**Examples:**
```bash
# Arabic → Tifinagh
curl -X POST
localhost \
-H "Content-Type: application/json" \
-d '{"text": "مرحبا", "from": "arabic", "to": "tifinagh"}'
# Response:
# {
# "input": { "text": "مرحبا", "script": "arabic" },
# "output": { "text": "ⵎⵔⵃⴱⴰ", "script": "tifinagh" }
# }
# Tifinagh → Latin (auto-detect)
curl -X POST
localhost \
-H "Content-Type: application/json" \
-d '{"text": "ⵜⴰⵎⴰⵣⵉⵖⵜ"}'
# Response:
# {
# "input": { "text": "ⵜⴰⵎⴰⵣⵉⵖⵜ", "script": "auto-detected" },
# "output": { "text": "tamaziɣt", "script": "auto-detected" }
# }
# Latin → Tifinagh
curl -X POST
localhost \
-H "Content-Type: application/json" …