Skip to content

About

Real-time N'Ko/Arabic/Latin transliteration — PWA, browser extension, iOS keyboard

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ߛߓߊ߬ ߞߊ߲ ߛߓߍ (Cross-Script Bridge)

Real-time translation between N'Ko, Arabic, and Latin scripts.

Overview

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

Architecture

┌─────────────────────────────────────────────────────────┐
│                  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)                          │
└─────────────────────────────────────────────────────────┘

Installation

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 .

Web Interface (Gen 6)

Real-time translation in your browser:

source .venv/bin/activate
python web/app.py
# Open http://localhost:5001

Features:

  • 🔄 Real-time WebSocket conversion as you type
  • 🔍 Auto-detect input script
  • ⇄ Swap input/output with one click
  • 📊 Character analysis bar
  • 🌐 RTL/LTR auto-switching

Usage

CLI

# 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 latin

Linguistic Intelligence (Gen 6, Instance 18)

Beyond 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

Features

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

Python API

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

Content Types Detected

  • 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)

Translation Strategies

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

CLI Streaming Edition (Gen 7, Instance 18)

The CLI has been evolved with real-time streaming capabilities:

Watch Mode

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 latin

Clipboard Integration

Real-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 latin

HTTP Translation Server

Start a mini server for integration with other tools:

# Start server on default port 8080
csb --serve

# Custom port
csb --serve 3000

API endpoints:

GET  /translate?text=hello&target=nko
POST /translate  {"text": "hello", "target": "nko"}
GET  /detect?text=ߛߟߊߡ

Batch Processing

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

Streaming & JSON Output

# Stream mode (immediate flush per line)
cat large.txt | csb --stream -t nko

# JSON output for scripting
csb --json "hello world" -t nko

Python API

from 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)

Script Mappings

N'Ko ↔ Latin (IPA-based)

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

Tone Marks (N'Ko)

Mark Unicode Meaning
߬ U+07EC Falling tone
߭ U+07ED High tone
߯ U+07EF Long vowel

HEF Evolution

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

Voice Dictation Mode (Gen 6, Instance 18)

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.

CLI Voice Mode

# 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

Features

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

Web Voice Input

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 Architecture

┌─────────────────────────────────────────────────┐
│              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     │  ߛߟߊ߯ߡ ߊ߬ߟߊ߯ߌߞߎߡ          │
│  └─────────────────┘                            │
└─────────────────────────────────────────────────┘

Cultural Impact

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

Apple Shortcuts & Services (Gen 6, Instance 18)

Access translation from Siri, Shortcuts app, and right-click menus.

Quick Start

# 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-service

Siri Integration

After setting up a Shortcut:

"Hey Siri, translate to N'Ko"

Right-Click Translation

  1. Run python shortcuts/bridge_shortcuts.py install-service
  2. Select any text in any app
  3. Right-click → Services → "Translate with Cross-Script Bridge"

Available Commands

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.

Progressive Web App (Gen 10)

Mobile-first, offline-capable translation app.

Start PWA Server

cd pwa
python server.py
# Open http://localhost:5003

Features

  • 📱 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

Installation

Android/Chrome:

  1. Visit http://localhost:5003 in Chrome
  2. Tap "Add to Home Screen" prompt
  3. App icon appears on home screen

iOS/Safari:

  1. Visit http://localhost:5003 in Safari
  2. Tap Share → Add to Home Screen
  3. App appears as native icon

Offline Architecture

┌─────────────────────────────────────────────┐
│              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 Files

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

Cultural Impact

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

iOS Keyboard Extension (Gen 7, Instance 18)

Native iOS custom keyboard for system-wide N'Ko typing.

Location: ios-keyboard/

Features

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

Installation (Development)

cd ios-keyboard
open .  # Create Xcode project from files
  1. Create iOS App project in Xcode
  2. Add Keyboard Extension target
  3. Copy KeyboardViewController.swift to extension
  4. Build and run on device
  5. Enable in Settings → General → Keyboard → Add New Keyboard

Usage

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

Keyboard Layout

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 🌐 ߛߓߊ ⏎│
└──────────────┘     └──────────────┘

Cultural Impact

Enables N'Ko typing anywhere on iOS — Messages, Notes, Safari, social media. Brings script accessibility to the mobile-first generation.

Public API (Gen 9)

Start the API server:

source .venv/bin/activate
pip install flask-socketio flask-cors
python api/server.py
# Running on http://localhost:5002

Endpoints

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

Example Request

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
}

Rate Limits

Tier Requests/min Batch Size
Free 100 10
Pro 1000 100
Unlimited ∞ 1000

SDKs (Gen 9)

Python SDK

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'}
])

JavaScript SDK

cd sdk/javascript
npm install
import { 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'ko

Browser Extension (Gen 8)

Translate any text on any webpage with the Cross-Script Bridge extension.

Installation

  1. Open Chrome/Edge and go to chrome://extensions/
  2. Enable "Developer mode" (top right)
  3. Click "Load unpacked"
  4. Select the extension/ folder

Features

  • 🔍 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+T translates selected text
  • 📋 One-click copy - Copy translation to clipboard
  • ⚙️ Customizable - Set default target script, toggle tooltip

Popup Translator

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

Files

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

CLI Tool (Gen 6 - Instance 18)

Command-line interface for translation, scripting, and automation.

Usage

# 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

Interactive REPL

╭─────────────────────────────────────────╮
│ ߞ 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 → ߒ'ߞߏ] ߤߋߟߏ ߥߏߙߟߘ

Options

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

Integration Examples

# 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.txt

Raycast Extension (Gen 7, Instance 18)

System-wide instant translation from your macOS launcher.

Installation

cd ~/Desktop/cross-script-bridge/raycast
npm install
npm run dev  # Development mode

Commands

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

Features

  • ⚡ 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

Keyboard Shortcuts

Shortcut Action
⌘C Copy translation
⌘⇧V Paste translation
⌘S Swap scripts
⌘P Quick phrases
⌘K Clear

Configuration

Set preferences in Raycast → Extensions → Cross-Script Bridge:

  • Default source/target scripts
  • Auto-copy behavior
  • Bridge server URL (for advanced translation)

macOS Menu Bar App (Gen 6.1, Instance 18)

Always-on translation from your menu bar. No browser needed.

Installation

source .venv/bin/activate
pip install rumps
./menubar/launch.sh

Menu

 ┌─────────────────────────────────────────┐
 │  ߛ⟷  📋 Translate Clipboard     ⌘T    │
 │       ✏️ Type to Translate...   ⌘N    │
 │       ─────────────────────────       │
 │       Source Script        ▸          │
 │       Target Script        ▸          │
 │       ⇄ Swap Source/Target  ⌘S       │
 │       ─────────────────────────       │
 │       📜 History           ▸          │
 │       🗣️ Quick Phrases     ▸          │
 │       ─────────────────────────       │
 │       🌐 Open Web Interface ⌘W       │
 │       ⚙️ Settings...                  │
 └─────────────────────────────────────────┘

Features

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

Keyboard Shortcuts

Shortcut Action
⌘T Translate clipboard
⌘N Type to translate
⌘S Swap source/target scripts
⌘W Open web interface
⌘Q Quit

Menu Bar Icon

The icon shows your current translation direction:

  • ߛ⟷A — N'Ko to Latin
  • ?⟷ߛ — Auto-detect to N'Ko
  • ع⟷ߛ — Arabic to N'Ko

Launch at Login

  1. System Settings → General → Login Items
  2. Click + under "Open at Login"
  3. Add ~/Desktop/cross-script-bridge/menubar/launch.sh

Audio & Pronunciation (Gen 7)

Pronunciation Guide Web UI

source .venv/bin/activate
python web/app.py
# Open http://localhost:5001/pronunciation

Features:

  • 🔊 Text-to-speech for any script
  • 📊 IPA phonetic transcription
  • 🎯 Character-by-character breakdown
  • 🏆 Spaced repetition practice mode
  • 📈 Progress tracking with mastery levels

Python API

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("ߒߞߏ"))

Practice Mode

# 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()

Telegram Bot (Gen 6, Instance 18)

Real-time translation in Telegram chats — highly impactful for West African communities.

Setup

cd telegram-bot
pip install -r requirements.txt

# Get token from @BotFather on Telegram
export TELEGRAM_BOT_TOKEN='your_token'
python bot.py

Features

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

Usage

Direct message:

You: ߛߟߊ߯ߡ
Bot: 🇬🇳 N'Ko → 🔤 Latin: salam

Commands:

/nko hello        → ߤߋߟߏ
/arabic peace     → سلام
/latin ߒߞߏ       → n'ko

Inline mode (any chat):

@your_bot_username ߌ ߣߌ ߞߍ

Cultural Impact

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

Cultural Context

This bridge serves multiple purposes:

  1. N'Ko Preservation - Making the script accessible to learners
  2. Cross-cultural Communication - Manding ↔ Arabic ↔ Western
  3. AI Training Data - Generating parallel corpora
  4. Digital Griot Tradition - Oral history in written form

Files

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

License

MIT - For the preservation of N'Ko and cross-cultural understanding.


ߊ߬ ߣߌ߫ ߛߓߍ ߕߐ߭ ߓߍ߯ ߦߋ߫ - "The word and all writing are one"


Collaborative Translation (Gen 6, Instance 18)

Real-time multi-user translation sessions for language learning and cultural preservation.

Quick Start

source .venv/bin/activate
python collab/server.py
# Open http://localhost:5002

Features

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

Architecture

┌─────────────────────────────────────────────────────────┐
│               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                      │   │
│  └─────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────┘

Python API

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")

Real-time Sync

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}%")

Use Cases

  1. Language Learning Groups - Students practice N'Ko together with instant feedback
  2. Digital Preservation - Communities collaboratively document oral traditions
  3. AI Training Data - Generate verified parallel corpora for translation models
  4. Cross-cultural Communication - Bridge Manding ↔ Arabic ↔ Western languages

Cultural Impact

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"

About

Real-time N'Ko/Arabic/Latin transliteration — PWA, browser extension, iOS keyboard

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages