Real-time translation between N'Ko, Arabic, and Latin scripts.
The Cross-Script Bridge enables seamless transliteration and translation between three major writing systems:
| Script | Direction | Unicode Range | Speakers |
|---|---|---|---|
| N'Ko (ߒߞߏ) | RTL | U+07C0–U+07FF | ~10M (Manding) |
| Arabic (العربية) | RTL | U+0600–U+06FF | ~400M+ |
| Latin | LTR | Basic ASCII | Billions |
┌─────────────────────────────────────────────────────────┐
│ Cross-Script Bridge │
├─────────────────────────────────────────────────────────┤
│ ┌───────────┐ ┌───────────┐ ┌───────────┐ │
│ │ N'Ko │◄──►│ Bridge │◄──►│ Arabic │ │
│ │ ߒߞߏ │ │ Core │ │ العربية │ │
│ └─────┬─────┘ └─────┬─────┘ └─────┬─────┘ │
│ │ │ │ │
│ └────────────────┼────────────────┘ │
│ │ │
│ ┌─────▼─────┐ │
│ │ Latin │ │
│ │ (IPA) │ │
│ └───────────┘ │
├─────────────────────────────────────────────────────────┤
│ Features: │
│ • Phonetic mapping via IPA intermediary │
│ • Real-time streaming transliteration │
│ • Bidirectional conversion │
│ • Tone mark preservation (N'Ko) │
│ • Diacritic handling (Arabic) │
└─────────────────────────────────────────────────────────┘
cd ~/Desktop/cross-script-bridge
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
pip install -e .Real-time translation in your browser:
source .venv/bin/activate
python web/app.py
# Open http://localhost:5001Features:
- 🔄 Real-time WebSocket conversion as you type
- 🔍 Auto-detect input script
- ⇄ Swap input/output with one click
- 📊 Character analysis bar
- 🌐 RTL/LTR auto-switching
# N'Ko to Latin
csb transliterate "ߒߞߏ" --from nko --to latin
# Output: n'ko
# Latin to N'Ko
csb transliterate "salam" --from latin --to nko
# Output: ߛߟߊ߯ߡ
# Arabic to N'Ko
csb transliterate "سلام" --from arabic --to nko
# Output: ߛߟߊ߯ߡ
# Interactive mode
csb interactive --source nko --target latinBeyond character mapping: semantic awareness for culturally-informed translation.
# Analyze context before translating
python -m linguistic.cli analyze "i ni tile"
# Output: greeting detected, strategy=annotate
# Look up cultural terms
python -m linguistic.cli lookup "ߌ ߣߌ ߕߌ߲"
# Output: Good day (lit: you and the day)
# Parse Manding names
python -m linguistic.cli name "Mamadou Keita"
# Output: Given=mamadou, Jamu=keita, N'Ko: ߡߡߊߘߎ ߞߋߕߊ
# Explore proverbs
python -m linguistic.cli proverbs
# Get translation suggestions
python -m linguistic.cli suggest "ko te ta la" --target nko| Component | Description |
|---|---|
| ContextEngine | Detects content type (greeting, proverb, name, etc.) |
| CulturalDatabase | 21+ terms: proverbs, greetings, blessings, concepts |
| NameHandler | 30+ jamu, 40+ given names, honorifics with sanaku |
| SuggestionEngine | Intelligent alternatives when direct transliteration loses meaning |
from linguistic import ContextEngine, CulturalDatabase, NameHandler
# Analyze content before translating
engine = ContextEngine()
analysis = engine.analyze("i ni tile")
print(analysis.content_type) # greeting
print(analysis.strategy) # annotate
# Look up cultural context
db = CulturalDatabase()
term = db.lookup("ߌ ߣߌ ߕߌ߲")
print(term.meaning) # Good day (lit: you and the day)
print(term.usage) # Standard daytime greeting
# Handle names properly
handler = NameHandler()
nko, confidence = handler.to_nko("Mamadou Diomande")
print(nko) # ߡߡߊߘߎ ߖߏ߬ߡߊ߲߬ߘߋ
# Get jamu cultural info
info = handler.get_jamu_info("keita")
print(info["sanaku"]) # ['coulibaly'] - joking relationship- GREETING - Cultural greetings with proper responses
- PROVERB - Wisdom sayings needing semantic translation
- NAME - Personal names with jamu (clan) context
- BLESSING - Religious/traditional blessings
- KINSHIP - Family relationship terms (faden, baden)
- CONCEPT - Cultural concepts (sanaku, jamu, faso)
| Strategy | When Used |
|---|---|
| TRANSLITERATE | Plain text - direct character mapping |
| ANNOTATE | Cultural terms - transliterate + provide meaning |
| TRANSLATE | Proverbs/idioms - semantic translation preserves meaning |
| HYBRID | Mixed content - different strategies for different parts |
The CLI has been evolved with real-time streaming capabilities:
Monitor files/directories and auto-translate on changes:
# Watch a directory
csb --watch ~/notes/ -t nko
# Watch with custom output directory
csb --watch ~/docs/ --output-dir ~/docs/translated/ -t arabic
# Custom poll interval
csb --watch . --watch-interval 2.0 -t latinReal-time clipboard monitoring with auto-copy:
# Monitor clipboard continuously
csb --clipboard -t nko
# Translate clipboard once and copy back
csb --clipboard-once -t arabic
# Monitor without auto-copy
csb --clipboard --no-auto-copy -t latinStart a mini server for integration with other tools:
# Start server on default port 8080
csb --serve
# Custom port
csb --serve 3000API endpoints:
GET /translate?text=hello&target=nko
POST /translate {"text": "hello", "target": "nko"}
GET /detect?text=ߛߟߊߡ
Translate multiple files at once:
# All markdown files
csb --batch "*.md" -t nko
# Recursive with output directory
csb --batch "**/*.txt" --output-dir out/ -t arabic
# Custom suffix
csb --batch "*.md" --suffix ".nko" -t nko# Stream mode (immediate flush per line)
cat large.txt | csb --stream -t nko
# JSON output for scripting
csb --json "hello world" -t nkofrom cross_script_bridge import Bridge
bridge = Bridge()
# Single conversion
result = bridge.convert("ߒߞߏ", source="nko", target="latin")
print(result) # n'ko
# Stream mode (real-time)
async for char in bridge.stream("Hello", source="latin", target="nko"):
print(char, end="", flush=True)| N'Ko | IPA | Latin | Name |
|---|---|---|---|
| ߊ | /a/ | a | A |
| ߋ | /o/ | o | O |
| ߌ | /i/ | i | I |
| ߍ | /e/ | e | E |
| ߎ | /u/ | u | U |
| ߏ | /ɔ/ | ɔ/o | Open O |
| ߐ | /ə/ | ə | Schwa |
| ߓ | /b/ | b | Ba |
| ߘ | /d/ | d | Da |
| ߜ | /gb/ | gb | Gba |
| ߝ | /f/ | f | Fa |
| ߞ | /k/ | k | Ka |
| ߟ | /l/ | l | La |
| ߡ | /m/ | m | Ma |
| ߢ | /ɲ/ | ny | Nya |
| ߣ | /n/ | n | Na |
| ߤ | /h/ | h | Ha |
| ߥ | /w/ | w | Wa |
| ߦ | /j/ | y | Ya |
| ߧ | /ŋ/ | ng | Nga |
| ߨ | /p/ | p | Pa |
| ߩ | /r/ | r | Ra |
| ߪ | /s/ | s | Sa |
| Mark | Unicode | Meaning |
|---|---|---|
| ߬ | U+07EC | Falling tone |
| ߭ | U+07ED | High tone |
| ߯ | U+07EF | Long vowel |
Task: Cross-Script Bridge Instances:
- inst_20260131082128_773 (Gen 9)
- Instance 18 (Gen 6 - Telegram Bot)
Generation: 10 (PWA + Offline) / 6 (Instance 18 - Telegram Bot) Techniques Applied:
- G02 (Attribute Listing) - Script characteristics
- G05 (SCAMPER) - Adapt IPA as intermediary
- G08 (Combine) - Merge three script systems
- R03 (Simplify) - Minimal phonetic mapping
- R08 (Integrate) - Unified API
- G11 (Add Senses) - Audio/voice capabilities
- R05 (User Testing) - Practice mode with progress tracking
- D05 (Digital Deployment) - Browser extension for web-wide translation
- D14 (Universal Access) - Translate any text on any webpage
- D01 (API Distribution) - Public REST API for third-party integration
- D06 (SDK Packaging) - Python & JavaScript SDKs for developers
- D10 (Mobile Packaging) - PWA for mobile installation
- R12 (Backup Plan) - Offline-first architecture with Service Worker
- D15 (Desktop Integration) - Raycast extension for system-wide access
- R14 (Accessibility) - One-click translation via launcher
- D08 (Channel Distribution) - Telegram Bot for messaging platform integration
- D15 (Desktop Integration) - macOS Menu Bar for always-on access
- D14 (Universal Access) - Apple Shortcuts & Services for system-wide integration
- G11 (Add Senses) - Voice dictation mode with real-time transcription
Speak and get N'Ko output in real-time. Perfect for native Manding speakers who want to write in N'Ko without learning keyboard layouts.
# Single phrase dictation
csb --voice -t nko
# Continuous dictation (keeps listening)
csb --voice --voice-continuous
# Auto-copy results to clipboard
csb --voice --voice-auto-copy
# With Arabic output
csb --voice -t arabic| Feature | Description |
|---|---|
| 🎤 Real-time Transcription | Speech-to-text via Whisper or system APIs |
| ⚡ Instant Transliteration | Immediate conversion to N'Ko/Arabic |
| 📊 Visual Feedback | Waveform display during recording |
| 📋 Clipboard Integration | Auto-copy results |
| 🔄 Continuous Mode | Keep listening phrase after phrase |
| 🌐 Multi-backend | whisper.cpp, OpenAI API, or macOS native |
The web interface includes Web Speech API integration:
<script src="voice.js"></script>
<script>
const voiceBtn = new VoiceButton('#voice-container', bridge, {
targetScript: 'nko',
onResult: (result) => {
console.log('N\'Ko:', result.text);
console.log('Confidence:', result.confidence);
}
});
</script>┌─────────────────────────────────────────────────┐
│ Voice Pipeline │
├─────────────────────────────────────────────────┤
│ 🎤 Microphone Input │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Speech-to-Text │ │
│ │ • whisper.cpp │ │
│ │ • OpenAI API │ │
│ │ • macOS Native │ │
│ │ • Web Speech │ │
│ └────────┬────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Latin Text │ "salam alaikum" │
│ └────────┬────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Bridge Core │ │
│ │ Transliterate │ │
│ └────────┬────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ N'Ko Output │ ߛߟߊ߯ߡ ߊ߬ߟߊ߯ߌߞߎߡ │
│ └─────────────────┘ │
└─────────────────────────────────────────────────┘
Voice input addresses a critical accessibility gap:
- Oral Tradition: Manding languages have strong oral traditions; voice input feels natural
- Script Learning: Speakers can produce N'Ko text before mastering the script
- Literacy Bridge: Helps bridge oral fluency to written literacy
- Mobile Access: Easier than typing on small screens
ߞߊ߲ ߦߋ߫ ߣߎ߲߫ ߕߍ߫ — The language is between us
Access translation from Siri, Shortcuts app, and right-click menus.
# Translate via CLI
echo "hello" | python shortcuts/bridge_shortcuts.py translate
# Output: ߤߋߟߟߏ
# Translate to Arabic
python shortcuts/bridge_shortcuts.py translate --target arabic "peace"
# Detect script
python shortcuts/bridge_shortcuts.py detect "ߒߞߏ"
# {"script": "nko", "confidence": 0.9, "name": "ߒߞߏ (N'Ko)"}
# Install macOS Quick Action
python shortcuts/bridge_shortcuts.py install-serviceAfter setting up a Shortcut:
"Hey Siri, translate to N'Ko"
- Run
python shortcuts/bridge_shortcuts.py install-service - Select any text in any app
- Right-click → Services → "Translate with Cross-Script Bridge"
| Command | Description |
|---|---|
translate |
Translate text (stdin or argument) |
detect |
Identify script of text |
greeting |
Get greeting in script |
scripts |
List available scripts |
install-service |
Install macOS Quick Action |
See shortcuts/README.md for full documentation.
Mobile-first, offline-capable translation app.
cd pwa
python server.py
# Open http://localhost:5003- 📱 Installable - Add to home screen on iOS/Android
- ⚡ Offline Mode - Full translation works without internet
- 🔄 Auto-detect - Automatically detects input script
- 📋 Quick Copy - Tap output to copy
- 🔗 Share Target - Share text from other apps
- 🔔 Push Notifications - Learning reminders (optional)
- ⇄ Swap Scripts - One-tap source/target swap
Android/Chrome:
- Visit
http://localhost:5003in Chrome - Tap "Add to Home Screen" prompt
- App icon appears on home screen
iOS/Safari:
- Visit
http://localhost:5003in Safari - Tap Share → Add to Home Screen
- App appears as native icon
┌─────────────────────────────────────────────┐
│ Service Worker │
├─────────────────────────────────────────────┤
│ Cache Strategy: │
│ • Core Assets: Cache-first │
│ • API Calls: Network-first + cache fallback │
│ • Pages: Network-first + offline fallback │
├─────────────────────────────────────────────┤
│ Cached Resources: │
│ • HTML, CSS, JS │
│ • Script mapping data (JSON) │
│ • N'Ko & Arabic fonts │
│ • Translation engine (client-side) │
└─────────────────────────────────────────────┘
pwa/
├── manifest.json # PWA manifest
├── service-worker.js # Offline caching
├── index.html # Main app
├── offline.html # Offline fallback
├── server.py # Development server
├── js/
│ ├── bridge-core.js # Translation engine
│ └── app.js # App logic
├── css/
│ └── style.css # Styles
├── fonts/ # Cached fonts
└── icons/ # App icons
This PWA is designed for West African users where:
- Internet connectivity can be intermittent
- Mobile-first is essential
- N'Ko script preservation is culturally important
- Offline capability enables learning anywhere
Native iOS custom keyboard for system-wide N'Ko typing.
Location: ios-keyboard/
| Feature | Description |
|---|---|
| 🔄 Real-time Transliteration | Type in Latin, see N'Ko instantly |
| ⌨️ Dual Input Modes | Latin-to-N'Ko or direct N'Ko character input |
| 💡 Smart Suggestions | Common word predictions with meanings |
| 📱 System-wide | Works in any app - Messages, Notes, Safari |
| 🔢 N'Ko Numerals | Full digit support (߀-߉) |
| ⚡ Offline | No network required |
cd ios-keyboard
open . # Create Xcode project from files- Create iOS App project in Xcode
- Add Keyboard Extension target
- Copy KeyboardViewController.swift to extension
- Build and run on device
- Enable in Settings → General → Keyboard → Add New Keyboard
Latin Mode (Default):
- Type
salam→ ߛߟߊ߯ߡ - Type
nko→ ߒߞߏ - Digraphs:
ny→ ߢ,gb→ ߜ,ng→ ߣ
N'Ko Direct Mode:
- Tap ⇧ to switch to direct N'Ko input
- Double-tap ⇧ for caps lock
Latin Mode: N'Ko Mode (⇧):
┌──────────────┐ ┌──────────────┐
│q w e r t y u│ │ߊ ߓ ߔ ߕ ߖ ߗ ߘ│
│ a s d f g h │ │ ߜ ߝ ߞ ߟ ߠ ߡ│
│⇧ z x c v b ⌫│ │⇧ ߥ ߦ ߧ ߨ ߋ ⌫│
│123 🌐 space ⏎│ │ABC 🌐 ߛߓߊ ⏎│
└──────────────┘ └──────────────┘
Enables N'Ko typing anywhere on iOS — Messages, Notes, Safari, social media. Brings script accessibility to the mobile-first generation.
Start the API server:
source .venv/bin/activate
pip install flask-socketio flask-cors
python api/server.py
# Running on http://localhost:5002| Method | Endpoint | Description |
|---|---|---|
POST |
/v1/translate |
Translate between scripts |
POST |
/v1/detect |
Detect script type |
POST |
/v1/analyze |
Phonetic analysis |
POST |
/v1/batch |
Batch translation |
GET |
/v1/scripts |
List supported scripts |
WS |
/v1/stream |
Real-time streaming |
curl -X POST http://localhost:5002/v1/translate \
-H "Content-Type: application/json" \
-H "X-API-Key: demo-free-key" \
-d '{"text": "ߒߞߏ", "target": "latin"}'Response:
{
"success": true,
"input": "ߒߞߏ",
"output": "n'ko",
"source": "nko",
"target": "latin",
"detected": true
}| Tier | Requests/min | Batch Size |
|---|---|---|
| Free | 100 | 10 |
| Pro | 1000 | 100 |
| Unlimited | ∞ | 1000 |
cd sdk/python
pip install -e .from cross_script_bridge import CrossScriptBridge
csb = CrossScriptBridge(api_key='demo-free-key')
# Translate
result = csb.translate("ߒߞߏ", target='latin')
print(result.output) # n'ko
# Quick methods
nko = csb.to_nko("Hello") # ߤߋߟߏ
latin = csb.to_latin("ߒߞߏ") # n'ko
# Batch
results = csb.batch([
{'text': 'ߒߞߏ', 'target': 'latin'},
{'text': 'Hello', 'target': 'nko'}
])cd sdk/javascript
npm installimport { CrossScriptBridge } from 'cross-script-bridge';
const csb = new CrossScriptBridge({ apiKey: 'demo-free-key' });
// Translate
const result = await csb.translate('ߒߞߏ', { target: 'latin' });
console.log(result.output); // n'ko
// Quick methods
const nko = await csb.toNko('Hello'); // ߤߋߟߏ
const latin = await csb.toLatin('ߒߞߏ'); // n'koTranslate any text on any webpage with the Cross-Script Bridge extension.
- Open Chrome/Edge and go to
chrome://extensions/ - Enable "Developer mode" (top right)
- Click "Load unpacked"
- Select the
extension/folder
- 🔍 Auto-detect - Automatically identifies N'Ko, Arabic, or Latin text
- 🖱️ Right-click menu - Select text → Right-click → "Translate Script"
- 💬 Instant tooltip - Hover translation appears on selection
- ⌨️ Keyboard shortcut -
Alt+Shift+Ttranslates selected text - 📋 One-click copy - Copy translation to clipboard
- ⚙️ Customizable - Set default target script, toggle tooltip
Click the extension icon for a full translator interface:
- Enter text to translate
- Swap source/target with one click
- Quick phrase buttons for common greetings
- Settings panel for preferences
extension/
├── manifest.json # Extension manifest (v3)
├── background/
│ └── service-worker.js # Context menus & shortcuts
├── content/
│ ├── bridge-core.js # Translation engine (JS port)
│ ├── content-script.js # Selection handler
│ └── tooltip.css # Tooltip styles
├── popup/
│ ├── popup.html # Popup interface
│ ├── popup.css # Popup styles
│ └── popup.js # Popup logic
└── icons/
└── icon*.png # Extension icons
Command-line interface for translation, scripting, and automation.
# Direct translation (auto-detect source)
csb "ߛߊ߬ߟߊ߯ߡߎ߲" # → salaamun
# Specify target script
csb -t nko "salam" # → ߪߑߟߑߡ
csb -t arabic "peace" # → Arabic output
# Pipe support for scripting
echo "ߒ'ߞߏ ߞߊ߲" | csb # → n'ko kan
cat document.txt | csb -t nko > translated.txt
# File translation
csb -f input.txt -o output.txt -t nko
# Verbose mode (show source detection)
csb -v "ߛߊ߬ߟߊ߯ߡߎ߲" # → [ߒ'ߞߏ → Latin] salaamun
# Interactive REPL
csb -i╭─────────────────────────────────────────╮
│ ߞ Cross-Script Bridge ع A │
│ Real-time script transliteration │
╰─────────────────────────────────────────╯
Target script: Latin
Type text to translate. Commands: /nko /arabic /latin /quit
csb → Latin: ߒߞߏ
[ߒ'ߞߏ → Latin] n'ko
csb → Latin: /nko
Target set to ߒ'ߞߏ
csb → ߒ'ߞߏ: hello world
[Latin → ߒ'ߞߏ] ߤߋߟߏ ߥߏߙߟߘ
| Flag | Long | Description |
|---|---|---|
-t |
--target |
Target script: nko, arabic, latin |
-s |
--source |
Source script (auto-detect if omitted) |
-i |
--interactive |
Interactive REPL mode |
-f |
--file |
Input file to translate |
-o |
--output |
Output file (stdout if omitted) |
-v |
--verbose |
Show source/target info |
--no-color |
Disable colored output |
# Translate clipboard content (macOS)
pbpaste | csb -t nko | pbcopy
# Watch file for changes
fswatch -o input.txt | xargs -n1 -I{} csb -f input.txt -o output.txt
# Git hook: translate commit message
csb -t nko "$(git log -1 --format=%s)" >> nko_changelog.txtSystem-wide instant translation from your macOS launcher.
cd ~/Desktop/cross-script-bridge/raycast
npm install
npm run dev # Development mode| Command | Description |
|---|---|
| Translate Script | Full translation interface with real-time conversion |
| Translate Clipboard | One-shot clipboard translation (⌘C to copy result) |
| Quick N'Ko Input | Fast Latin → N'Ko with phrase suggestions |
- ⚡ Real-time translation as you type
- 🔍 Auto-detect source script
- 📋 Clipboard integration with auto-copy
- ⇄ Swap source/target with ⌘S
- 📖 Quick phrases library (10 common greetings)
- 🕐 Recent translations history
- 🖥️ Works offline — standalone TypeScript engine
| Shortcut | Action |
|---|---|
| ⌘C | Copy translation |
| ⌘⇧V | Paste translation |
| ⌘S | Swap scripts |
| ⌘P | Quick phrases |
| ⌘K | Clear |
Set preferences in Raycast → Extensions → Cross-Script Bridge:
- Default source/target scripts
- Auto-copy behavior
- Bridge server URL (for advanced translation)
Always-on translation from your menu bar. No browser needed.
source .venv/bin/activate
pip install rumps
./menubar/launch.sh ┌─────────────────────────────────────────┐
│ ߛ⟷ 📋 Translate Clipboard ⌘T │
│ ✏️ Type to Translate... ⌘N │
│ ───────────────────────── │
│ Source Script ▸ │
│ Target Script ▸ │
│ ⇄ Swap Source/Target ⌘S │
│ ───────────────────────── │
│ 📜 History ▸ │
│ 🗣️ Quick Phrases ▸ │
│ ───────────────────────── │
│ 🌐 Open Web Interface ⌘W │
│ ⚙️ Settings... │
└─────────────────────────────────────────┘
| Feature | Description |
|---|---|
| 📋 Clipboard Translation | ⌘T translates clipboard and copies result back |
| ✏️ Type to Translate | Quick input window for instant conversion |
| 🔍 Auto-detect | Automatically identifies N'Ko/Arabic/Latin |
| ⇄ Swap Scripts | One-click source/target swap |
| 📜 History | Last 10 translations saved |
| 🗣️ Quick Phrases | Common N'Ko greetings ready to copy |
| 🌐 Web Link | Jump to full web interface |
| Shortcut | Action |
|---|---|
| ⌘T | Translate clipboard |
| ⌘N | Type to translate |
| ⌘S | Swap source/target scripts |
| ⌘W | Open web interface |
| ⌘Q | Quit |
The icon shows your current translation direction:
ߛ⟷A— N'Ko to Latin?⟷ߛ— Auto-detect to N'Koع⟷ߛ— Arabic to N'Ko
- System Settings → General → Login Items
- Click + under "Open at Login"
- Add
~/Desktop/cross-script-bridge/menubar/launch.sh
source .venv/bin/activate
python web/app.py
# Open http://localhost:5001/pronunciationFeatures:
- 🔊 Text-to-speech for any script
- 📊 IPA phonetic transcription
- 🎯 Character-by-character breakdown
- 🏆 Spaced repetition practice mode
- 📈 Progress tracking with mastery levels
from audio.pronunciation import PronunciationEngine
from audio.phoneme import PhonemeMapper
from audio.tts import ScriptTTS
# Get pronunciation breakdown
engine = PronunciationEngine()
breakdown = engine.breakdown("ߒߞߏ")
print(breakdown['ipa']) # nko
print(breakdown['difficulty']) # beginner
# IPA transcription
mapper = PhonemeMapper()
ipa = mapper.to_ipa_string("سلام") # sla:m
# Text-to-speech (async)
import asyncio
tts = ScriptTTS()
audio = asyncio.run(tts.speak("ߒߞߏ"))# Get characters to practice
practice_set = engine.get_practice_set('nko', count=5)
# Record practice results
result = engine.practice_character('ߓ', was_correct=True)
print(result['mastery_level']) # 0-5
# Check learning stats
stats = engine.get_stats()Real-time translation in Telegram chats — highly impactful for West African communities.
cd telegram-bot
pip install -r requirements.txt
# Get token from @BotFather on Telegram
export TELEGRAM_BOT_TOKEN='your_token'
python bot.py| Feature | Description |
|---|---|
| 📝 Direct Translation | Send any text, get instant translation |
| ⚡ Inline Mode | @botname text works in any chat |
| 💬 Group Support | /translate command for groups |
| 🎯 Quick Commands | /nko, /arabic, /latin shortcuts |
| ⚙️ User Preferences | Set default target script with /target |
| 📖 Quick Phrases | Common N'Ko greetings via /phrases |
| 📊 Statistics | Track usage with /stats |
Direct message:
You: ߛߟߊ߯ߡ
Bot: 🇬🇳 N'Ko → 🔤 Latin: salam
Commands:
/nko hello → ߤߋߟߏ
/arabic peace → سلام
/latin ߒߞߏ → n'ko
Inline mode (any chat):
@your_bot_username ߌ ߣߌ ߞߍ
Telegram is widely used in West Africa. This bot:
- Enables N'Ko in everyday messaging
- Supports language communities in group chats
- Makes the script accessible without installing keyboards
- Works offline with standalone translation engine
This bridge serves multiple purposes:
- N'Ko Preservation - Making the script accessible to learners
- Cross-cultural Communication - Manding ↔ Arabic ↔ Western
- AI Training Data - Generating parallel corpora
- Digital Griot Tradition - Oral history in written form
cross-script-bridge/
├── README.md # This file
├── setup.py # Package setup
├── requirements.txt # Dependencies
├── core/
│ ├── __init__.py
│ ├── bridge.py # Main Bridge class
│ ├── nko.py # N'Ko handler
│ ├── arabic.py # Arabic handler
│ └── latin.py # Latin/IPA handler
├── audio/ # Gen 7
│ ├── __init__.py
│ ├── phoneme.py # PhonemeMapper - IPA transcription
│ ├── pronunciation.py # PronunciationEngine - Learning mode
│ └── tts.py # ScriptTTS - Text-to-speech
├── api/ # Gen 9 - Public REST API
│ └── server.py # Flask + SocketIO API server
├── sdk/ # Gen 9 - Developer SDKs
│ ├── python/ # Python SDK
│ │ ├── cross_script_bridge/
│ │ │ ├── __init__.py
│ │ │ └── client.py
│ │ ├── setup.py
│ │ └── README.md
│ └── javascript/ # JavaScript SDK
│ ├── index.js
│ ├── package.json
│ └── README.md
├── pwa/ # Gen 10 - Progressive Web App
│ ├── manifest.json # PWA manifest
│ ├── service-worker.js # Offline caching
│ ├── index.html # Main app UI
│ ├── offline.html # Offline fallback
│ ├── server.py # Development server
│ └── js/ # Client-side bridge
├── raycast/ # Gen 7 (Instance 18) - Raycast Extension
│ ├── package.json # Extension manifest
│ ├── tsconfig.json # TypeScript config
│ └── src/
│ ├── lib/bridge.ts # Standalone translation engine
│ ├── translate.tsx # Full translation UI
│ ├── clipboard-translate.tsx # One-shot clipboard
│ └── quick-nko.tsx # Fast Latin → N'Ko
├── telegram-bot/ # Gen 6 (Instance 18) - Telegram Bot
│ ├── bot.py # Main Telegram bot
│ ├── bridge_core.py # Standalone translation fallback
│ ├── requirements.txt # Bot dependencies
│ └── README.md # Bot documentation
├── extension/ # Gen 8 - Browser Extension
│ ├── manifest.json # Chrome/Edge manifest v3
│ ├── background/ # Service worker
│ ├── content/ # Content scripts & styles
│ ├── popup/ # Extension popup UI
│ └── icons/ # Extension icons
├── web/
│ ├── app.py # Flask + SocketIO server
│ └── templates/
│ ├── index.html # Real-time translator
│ └── pronunciation.html # Pronunciation learning UI
├── data/
│ ├── nko_map.json # N'Ko ↔ IPA mappings
│ ├── arabic_map.json # Arabic ↔ IPA mappings
│ └── cognates.json # Cross-language cognates
├── cli/ # Gen 7 (Instance 18) - Streaming CLI
│ ├── __init__.py
│ └── csb.py # CLI with watch/clipboard/server modes
├── cache/ # Audio cache (generated)
├── scripts/ # Utility scripts
└── tests/
└── test_bridge.py # Unit tests
MIT - For the preservation of N'Ko and cross-cultural understanding.
ߊ߬ ߣߌ߫ ߛߓߍ ߕߐ߭ ߓߍ߯ ߦߋ߫ - "The word and all writing are one"
Real-time multi-user translation sessions for language learning and cultural preservation.
source .venv/bin/activate
python collab/server.py
# Open http://localhost:5002| Feature | Description |
|---|---|
| 🔴 Live Sessions | Multiple users contribute text simultaneously |
| ⚡ Real-time Sync | See translations as others type |
| 🔄 Script Auto-detect | Input in any script, get all translations |
| ✅ Verification | Moderators can verify contributions |
| 📚 Phrase Libraries | Build shared vocabulary in Rooms |
| 🔗 Invite Links | Share session/room access |
| 💾 Corpus Export | Generate parallel corpora for AI training |
┌─────────────────────────────────────────────────────────┐
│ Collaborative Translation │
├─────────────────────────────────────────────────────────┤
│ ┌─────────────────────────────────────────────────┐ │
│ │ CollaborativeSession │ │
│ │ • Multiple participants │ │
│ │ • Real-time contributions │ │
│ │ • Auto-translate to all scripts │ │
│ └─────────────────────────────────────────────────┘ │
│ │ │
│ ┌───────────┐ ┌─────▼─────┐ ┌───────────────┐ │
│ │BridgeRoom │ │ScriptSync │ │ConflictResolve│ │
│ │(persistent)│ │(real-time)│ │(merge logic) │ │
│ └───────────┘ └───────────┘ └───────────────┘ │
│ │ │
│ ┌─────────────────────▼───────────────────────────┐ │
│ │ WebSocket Server │ │
│ │ • Socket.IO real-time events │ │
│ │ • HTTP REST API │ │
│ │ • Web UI at localhost:5002 │ │
│ └─────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
from collab import CollaborativeSession, BridgeRoom, MemberRole
# Create a translation session
session = CollaborativeSession("N'Ko Learning Group")
# Add participants
host = session.add_participant("Moussa", preferred_script="nko", is_moderator=True)
learner = session.add_participant("David", preferred_script="latin")
# Contribute text (auto-translated to all scripts)
contribution = session.contribute(host.id, "ߒ ߕߐ߯ߞߏ ߦߋ߫ ߡߎߛߊ")
print(contribution.translations["latin"]) # "n tooko ye musa"
# Create persistent room for ongoing collaboration
room = BridgeRoom("West African Languages Circle")
admin = room.add_member("Aissata", role=MemberRole.ADMIN)
# Build shared phrase library
room.add_phrase(
nko="ߌ ߣߌ ߕߌ߲",
arabic="إي ني تيل",
latin="i ni tile",
meaning="Good day",
category="greeting",
contributor_id=admin.id,
cultural_note="Daytime greeting in Manding languages"
)
# Export corpus for AI training
corpus = session.export_corpus("training_data.json")from collab import ScriptSyncEngine, ConflictResolver
# Create sync engine for a session
sync = ScriptSyncEngine()
# Register participants
sync.register("user_1", "Moussa")
sync.register("user_2", "Fatou")
# Operations are synchronized with vector clocks
op1 = sync.insert("user_1", "doc_1", 0, "Hello")
op2 = sync.insert("user_2", "doc_1", 0, "Hi") # Potential conflict!
# Auto-resolve conflicts
resolver = ConflictResolver()
for conflict in sync.get_pending_conflicts():
suggestion = resolver.suggest_resolution(
conflict.operation_a.content,
conflict.operation_b.content,
script="latin"
)
print(f"Suggested: {suggestion['strategy']} @ {suggestion['confidence']*100}%")- Language Learning Groups - Students practice N'Ko together with instant feedback
- Digital Preservation - Communities collaboratively document oral traditions
- AI Training Data - Generate verified parallel corpora for translation models
- Cross-cultural Communication - Bridge Manding ↔ Arabic ↔ Western languages
This collaborative system enables:
- Distributed N'Ko teaching - Teachers can work with students remotely
- Community phrase building - Preserve regional vocabulary and proverbs
- Verified translations - Moderator approval ensures quality
- Living corpora - Continuously growing datasets for AI
ߒߞߏ ߓߍ߯ ߦߋ߫ ߓߏ߲߬ ߞߋߟߋ߲ ߘߐ߫ — "All N'Ko speakers are one family"