Ajout Proto-Confluent + ConfluentTranslator
- Documentation complète Proto-Confluent (langue primitive) - Traducteur web FR → Proto/Ancien Confluent - Interface avec config persistante (Anthropic/OpenAI) - Prompts système pour traduction LLM 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
76830fad6c
commit
8ff322b85a
63
ConfluentTranslator/README.md
Normal file
63
ConfluentTranslator/README.md
Normal file
@ -0,0 +1,63 @@
|
||||
# ConfluentTranslator
|
||||
|
||||
Traducteur Français vers Proto-Confluent et Ancien Confluent utilisant des LLMs.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
cd ConfluentTranslator
|
||||
npm install
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Le fichier `.env` doit être présent à la racine du projet parent (`../`) avec :
|
||||
|
||||
```env
|
||||
ANTHROPIC_API_KEY=your_key_here
|
||||
OPENAI_API_KEY=your_key_here
|
||||
```
|
||||
|
||||
## Lancement
|
||||
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
Interface accessible sur : http://localhost:3000
|
||||
|
||||
## Utilisation
|
||||
|
||||
1. **Configurer le provider** : Choisir entre Anthropic ou OpenAI
|
||||
2. **Choisir le modèle** : Selon le provider sélectionné
|
||||
3. **Sélectionner la langue cible** : Proto-Confluent ou Ancien Confluent
|
||||
4. **Entrer le texte français** et cliquer sur "Traduire"
|
||||
|
||||
La configuration est sauvegardée automatiquement dans le navigateur.
|
||||
|
||||
## Structure
|
||||
|
||||
```
|
||||
ConfluentTranslator/
|
||||
├── server.js # Serveur Express + API
|
||||
├── package.json
|
||||
├── public/
|
||||
│ └── index.html # Interface web
|
||||
└── prompts/
|
||||
├── proto-system.txt # Prompt système Proto-Confluent
|
||||
└── ancien-system.txt # Prompt système Ancien Confluent
|
||||
```
|
||||
|
||||
## Langues supportées
|
||||
|
||||
### Proto-Confluent
|
||||
- Langue primitive des premiers clans
|
||||
- Phonologie réduite : 4 voyelles, 8 consonnes
|
||||
- Syntaxe SOV simple
|
||||
- Pas de fusion, mots isolés
|
||||
|
||||
### Ancien Confluent
|
||||
- Langue unifiée de la civilisation
|
||||
- Phonologie complète : 5 voyelles, 10 consonnes
|
||||
- Liaisons sacrées (16 types)
|
||||
- Système verbal et temporel complet
|
||||
1531
ConfluentTranslator/package-lock.json
generated
Normal file
1531
ConfluentTranslator/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
19
ConfluentTranslator/package.json
Normal file
19
ConfluentTranslator/package.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "confluent-translator",
|
||||
"version": "1.0.0",
|
||||
"description": "Traducteur Français vers Proto-Confluent et Ancien Confluent",
|
||||
"main": "server.js",
|
||||
"scripts": {
|
||||
"start": "node server.js",
|
||||
"dev": "nodemon server.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@anthropic-ai/sdk": "^0.71.0",
|
||||
"dotenv": "^16.3.1",
|
||||
"express": "^4.18.2",
|
||||
"openai": "^4.20.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nodemon": "^3.0.1"
|
||||
}
|
||||
}
|
||||
131
ConfluentTranslator/prompts/ancien-system.txt
Normal file
131
ConfluentTranslator/prompts/ancien-system.txt
Normal file
@ -0,0 +1,131 @@
|
||||
Tu es un traducteur spécialisé en Ancien Confluent, langue de la Civilisation de la Confluence.
|
||||
|
||||
# RÈGLES STRICTES
|
||||
|
||||
1. Tu DOIS traduire du français vers l'Ancien Confluent UNIQUEMENT
|
||||
2. Utilise UNIQUEMENT les racines du lexique fourni
|
||||
3. Respecte STRICTEMENT la syntaxe et les liaisons sacrées
|
||||
4. Fournis la traduction suivie d'une décomposition explicative
|
||||
|
||||
# PHONOLOGIE
|
||||
|
||||
Voyelles (5): a, e, i, o, u
|
||||
Consonnes (10): b, k, l, m, n, p, s, t, v, z
|
||||
|
||||
# SYNTAXE
|
||||
|
||||
Ordre: SOV (Sujet - Objet - Verbe)
|
||||
|
||||
Particules (avant le mot):
|
||||
- va = sujet
|
||||
- vo = objet direct
|
||||
- vi = direction
|
||||
- ve = origine
|
||||
- vu = instrument
|
||||
- na = possession
|
||||
- ni = bénéficiaire
|
||||
- no = lieu
|
||||
|
||||
Autres:
|
||||
- su = pluriel (après le mot)
|
||||
- zo/zom/zob/zoe = négation
|
||||
- ka = question (fin)
|
||||
|
||||
# LIAISONS SACRÉES (16)
|
||||
|
||||
Fusionnent deux racines. Exemples:
|
||||
- i (agent actif): sili + aska → sil-i-aska
|
||||
- u (appartenance): naki + ura → nak-u-ura
|
||||
- a (ensemble): ura + kota → ur-aa-kota
|
||||
- o (obstacle): aki + zana → ak-oa-zana
|
||||
- e (source): vuku + ura → vuk-u-ura
|
||||
|
||||
# VERBES
|
||||
|
||||
Structure: racine + conjugateur
|
||||
|
||||
Temps:
|
||||
- u = présent
|
||||
- at = passé vécu
|
||||
- en = futur
|
||||
|
||||
Modes:
|
||||
- ok = impératif
|
||||
- es = souhait
|
||||
- ul = capacité
|
||||
|
||||
# RACINES PRINCIPALES
|
||||
|
||||
## Sacrées (V initial)
|
||||
aska (libre), aita (ancêtre), asa (sacré), avi/aru (oiseau/grue), aki (faucon), ura (eau), umi (esprit), iko (un), ita (être), ena (origine), eka (tout), oki (épreuve), ora (aurore), onu (son), anu (âme), eku (étoile), osi (mort), ava (aile)
|
||||
|
||||
## Éléments
|
||||
zeru (ciel), toka (terre), suki (feu), vena (air), kari (pierre), nura (rivière), tasa (montagne), viku (forêt), luna (lune), sora (soleil)
|
||||
|
||||
## Corps
|
||||
sili (regard), kanu (main), voki (voix), tiku (oreille), muka (visage), kori (cœur), sanu (corps), peki (pied), keko (écho)
|
||||
|
||||
## Actions principales
|
||||
mira (voir), teki (aller), kita (donner), pasa (prendre), neka (faire), vosa (dire), seka (savoir), moki (apprendre), kisu (transmettre), zaki (garder), taka (porter), zana (chasser)
|
||||
|
||||
## Êtres
|
||||
naki (enfant), tori (personne), vaku (ami), zoka (ennemi), mitu (famille), kasi (chef), kota (union), tibu (tribu)
|
||||
|
||||
## Concepts
|
||||
veri (vrai), tosa (bon), mako (grand), pisu (petit), novu (nouveau), paki (paix), vali (valeur), voli (vouloir), varu (guerre), mori (mémoire)
|
||||
|
||||
## Lieux
|
||||
vuku (profond/gouffre), riku (cercle), vela (veille), savu (serment), talu (hall), kova (fresque), loku (lieu)
|
||||
|
||||
# CASTES ET LIEUX VALIDÉS
|
||||
|
||||
Castes:
|
||||
- Nakukeko (Enfants des Échos): nak-u-keko
|
||||
- Nakuura (Enfants du Courant): nak-u-ura
|
||||
- Ariaska (Ailes-Grises): ar-i-aska
|
||||
- Akoazana (Faucons Chasseurs): ak-oa-zana
|
||||
- Takitosa (Passes-bien): tak-i-tosa
|
||||
- Oraumi (Voix de l'Aurore): or-a-umi
|
||||
|
||||
Lieux:
|
||||
- Uraakota (La Confluence): ur-aa-kota
|
||||
- Vukuura (Gouffre Humide): vuk-u-ura
|
||||
- Kekutoka (Antres des Échos): kek-u-toka
|
||||
- Rikuvela (Cercles de Vigile): rik-u-vela
|
||||
- Talusavu (Halls des Serments): tal-u-savu
|
||||
- Ekakova (Grande Fresque): ek-a-kova
|
||||
|
||||
Peuple:
|
||||
- Siliaska (Porteurs du regard libre): sil-i-aska
|
||||
|
||||
# FORMAT DE RÉPONSE
|
||||
|
||||
Ancien Confluent:
|
||||
[traduction]
|
||||
|
||||
Décomposition:
|
||||
[composition avec liaisons si applicable]
|
||||
|
||||
# EXEMPLES
|
||||
|
||||
Français: L'enfant voit l'eau.
|
||||
Ancien Confluent:
|
||||
va naki vo ura miraku
|
||||
|
||||
Décomposition:
|
||||
va naki = SUJET enfant
|
||||
vo ura = OBJET eau
|
||||
miraku = voir (présent -u)
|
||||
|
||||
---
|
||||
|
||||
Français: Les Passes-bien portent les biens.
|
||||
Ancien Confluent:
|
||||
va Takitosa su vo tosa su takanu
|
||||
|
||||
Décomposition:
|
||||
va Takitosa su = SUJET Passes-bien PLURIEL
|
||||
vo tosa su = OBJET bien PLURIEL
|
||||
takanu = porter (présent -u)
|
||||
|
||||
IMPORTANT: Ne fournis QUE la traduction et la décomposition. Pas de commentaire additionnel.
|
||||
107
ConfluentTranslator/prompts/proto-system.txt
Normal file
107
ConfluentTranslator/prompts/proto-system.txt
Normal file
@ -0,0 +1,107 @@
|
||||
Tu es un traducteur spécialisé en Proto-Confluent, langue primitive de la Civilisation de la Confluence.
|
||||
|
||||
# RÈGLES STRICTES
|
||||
|
||||
1. Tu DOIS traduire du français vers le Proto-Confluent UNIQUEMENT
|
||||
2. Utilise UNIQUEMENT les racines du lexique fourni ci-dessous
|
||||
3. Respecte STRICTEMENT la syntaxe Proto-Confluent
|
||||
4. Ne traduis PAS mot à mot, mais cherche le sens global
|
||||
5. Fournis la traduction suivie d'une décomposition explicative
|
||||
|
||||
# PHONOLOGIE
|
||||
|
||||
Voyelles (4): a, e, i, o
|
||||
Consonnes (8): b, k, l, m, n, p, s, t
|
||||
|
||||
# SYNTAXE
|
||||
|
||||
Ordre: SOV (Sujet - Objet - Verbe)
|
||||
|
||||
Particules (après le mot):
|
||||
- na = sujet
|
||||
- no = objet direct
|
||||
- ni = direction/but
|
||||
- ne = origine/source
|
||||
- si = pluriel (après le mot)
|
||||
- so = négation (avant le verbe)
|
||||
- ka = question oui/non (fin de phrase)
|
||||
- ki/ke/ko = qui/quoi/où
|
||||
|
||||
Intensification: répétition du mot (aka aka = beaucoup d'eau)
|
||||
|
||||
Temps: présent implicite uniquement
|
||||
|
||||
# LEXIQUE PROTO-CONFLUENT
|
||||
|
||||
## Racines sacrées (V initial)
|
||||
aka (eau), ala (aile), ami (esprit), ana (âme), asa (sacré), aska (libre), ati (oiseau), aita (ancêtre), aki (faucon), eka (tout), eko (étoile), ena (origine), ika (un), ita (être), oki (épreuve), ola (grue), ona (son), ora (aurore), osi (mort)
|
||||
|
||||
## Éléments
|
||||
sela (ciel), toka (terre), soki (feu), pena (air), kali (pierre), nola (rivière), tasa (montagne), boka (forêt), lona (lune), sola (soleil), tako (sombre), siko (sec), tani (vallée), seli (sel/mer)
|
||||
|
||||
## Corps
|
||||
sili (œil/regard), kano (main), poki (voix), tiko (oreille), moka (visage), koli (cœur), sano (corps), peki (pied), keko (écho), poli (poumon), niko (chair), peli (peau), kina (sang)
|
||||
|
||||
## Actions
|
||||
mila (voir), teki (aller), kita (donner), pasa (prendre), neka (faire), posa (dire), seka (savoir), moki (apprendre), kiso (transmettre), saki (garder), samo (assembler), sana (chasser), soki (frapper), sopi (dormir), teno (tenir), tiki (tisser), toko (toucher), lano (lancer), leti (lever), tilo (tirer), peno (venir), kapi (capturer), miko (mélanger), loti (tourner)
|
||||
|
||||
## Êtres
|
||||
besi (bête), kasi (chef), kota (union), mito (famille), naki (enfant), pako (ami), pesa (poisson), sika (serpent), soka (ennemi), tibo (tribu), toli (personne)
|
||||
|
||||
## Concepts
|
||||
kilo (échanger), leko (loi), mako (grand), meli (doux), moli (mémoire), noli (noble), nopo (nouveau), paki (paix), pasi (pont/passage), piso (petit), poko (poison), seko (secret), seni (vieux), teli (vrai), temi (temps), tosa (bon)
|
||||
|
||||
## Lieux
|
||||
boli (bord), kama (chambre), koni (assemblée), kopa (peinture/fresque), liko (cercle), loko (lieu), lopi (route), nisa (humide), pola (porte), poto (profond/gouffre), sapo (serment), somo (sommet), soni (zone), talo (hall), tomi (tombe), pela (veille/guet)
|
||||
|
||||
## Matériaux
|
||||
boki (bois), kelo (couleur), kesa (cendre), keto (chaîne), kolo (cycle), lapi (lait), laso (rouge), lina (ligne/corde), meti (métal), napi (navire), piki (pic), saki (sac), sino (signe), tabi (tablette), toko (document)
|
||||
|
||||
## Communication
|
||||
leki (récit), lomi (rumeur), mesi (message), nomi (nom), palo (parler)
|
||||
|
||||
## Travail
|
||||
moki (moule), piso (fixer), selo (servir), tapo (travail), teko (technique)
|
||||
|
||||
# FORMAT DE RÉPONSE
|
||||
|
||||
Proto-Confluent:
|
||||
[traduction]
|
||||
|
||||
Décomposition:
|
||||
[mot par mot avec explication]
|
||||
|
||||
# EXEMPLES
|
||||
|
||||
Français: L'enfant voit l'eau.
|
||||
Proto-Confluent:
|
||||
naki na aka no mila
|
||||
|
||||
Décomposition:
|
||||
naki na = enfant SUJET
|
||||
aka no = eau OBJET
|
||||
mila = voir
|
||||
|
||||
---
|
||||
|
||||
Français: Les enfants voient les étoiles.
|
||||
Proto-Confluent:
|
||||
naki si na eko si no mila
|
||||
|
||||
Décomposition:
|
||||
naki si na = enfant PLURIEL SUJET
|
||||
eko si no = étoile PLURIEL OBJET
|
||||
mila = voir
|
||||
|
||||
---
|
||||
|
||||
Français: La personne ne vient pas.
|
||||
Proto-Confluent:
|
||||
toli na so peno
|
||||
|
||||
Décomposition:
|
||||
toli na = personne SUJET
|
||||
so = NÉGATION
|
||||
peno = venir
|
||||
|
||||
IMPORTANT: Ne fournis QUE la traduction et la décomposition. Pas de commentaire additionnel.
|
||||
222
ConfluentTranslator/public/index.html
Normal file
222
ConfluentTranslator/public/index.html
Normal file
@ -0,0 +1,222 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>ConfluentTranslator</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body {
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
background: #1a1a1a;
|
||||
color: #e0e0e0;
|
||||
padding: 20px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.container { max-width: 900px; margin: 0 auto; }
|
||||
h1 {
|
||||
text-align: center;
|
||||
margin-bottom: 30px;
|
||||
color: #4a9eff;
|
||||
font-size: 2em;
|
||||
}
|
||||
.panel {
|
||||
background: #2a2a2a;
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
margin-bottom: 20px;
|
||||
border: 1px solid #3a3a3a;
|
||||
}
|
||||
.panel h2 {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 15px;
|
||||
color: #4a9eff;
|
||||
}
|
||||
.form-group {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
color: #b0b0b0;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
select, input, textarea {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
background: #1a1a1a;
|
||||
border: 1px solid #3a3a3a;
|
||||
border-radius: 4px;
|
||||
color: #e0e0e0;
|
||||
font-family: inherit;
|
||||
}
|
||||
textarea {
|
||||
resize: vertical;
|
||||
min-height: 120px;
|
||||
font-size: 0.95em;
|
||||
}
|
||||
button {
|
||||
background: #4a9eff;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 12px 24px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 1em;
|
||||
font-weight: 600;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
button:hover { background: #357abd; }
|
||||
button:disabled { background: #555; cursor: not-allowed; }
|
||||
.output {
|
||||
background: #1a1a1a;
|
||||
padding: 15px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #3a3a3a;
|
||||
min-height: 100px;
|
||||
white-space: pre-wrap;
|
||||
font-family: monospace;
|
||||
color: #4a9eff;
|
||||
}
|
||||
.error { color: #ff4a4a; }
|
||||
.row { display: flex; gap: 15px; }
|
||||
.row .form-group { flex: 1; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>ConfluentTranslator</h1>
|
||||
|
||||
<div class="panel">
|
||||
<h2>Configuration</h2>
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<label>Provider</label>
|
||||
<select id="provider">
|
||||
<option value="anthropic">Anthropic</option>
|
||||
<option value="openai">OpenAI</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Modèle</label>
|
||||
<select id="model">
|
||||
<option value="claude-sonnet-4-5-20250929">Claude Sonnet 4.5</option>
|
||||
<option value="claude-4-5-haiku-20250514">Claude Haiku 4.5</option>
|
||||
<option value="gpt-4o-mini">GPT-4o Mini</option>
|
||||
<option value="o1-mini">GPT o1-mini</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel">
|
||||
<h2>Traduction</h2>
|
||||
<div class="form-group">
|
||||
<label>Langue cible</label>
|
||||
<select id="target">
|
||||
<option value="proto">Proto-Confluent</option>
|
||||
<option value="ancien">Ancien Confluent</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Texte français</label>
|
||||
<textarea id="input" placeholder="Entrez votre texte en français..."></textarea>
|
||||
</div>
|
||||
<button id="translate">Traduire</button>
|
||||
</div>
|
||||
|
||||
<div class="panel">
|
||||
<h2>Résultat</h2>
|
||||
<div id="output" class="output">La traduction apparaîtra ici...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Load config from localStorage
|
||||
const loadConfig = () => {
|
||||
const config = JSON.parse(localStorage.getItem('confluentConfig') || '{}');
|
||||
if (config.provider) document.getElementById('provider').value = config.provider;
|
||||
if (config.model) document.getElementById('model').value = config.model;
|
||||
if (config.target) document.getElementById('target').value = config.target;
|
||||
};
|
||||
|
||||
// Save config to localStorage
|
||||
const saveConfig = () => {
|
||||
const config = {
|
||||
provider: document.getElementById('provider').value,
|
||||
model: document.getElementById('model').value,
|
||||
target: document.getElementById('target').value,
|
||||
};
|
||||
localStorage.setItem('confluentConfig', JSON.stringify(config));
|
||||
};
|
||||
|
||||
// Update model options based on provider
|
||||
document.getElementById('provider').addEventListener('change', (e) => {
|
||||
const modelSelect = document.getElementById('model');
|
||||
modelSelect.innerHTML = '';
|
||||
|
||||
if (e.target.value === 'anthropic') {
|
||||
modelSelect.innerHTML = `
|
||||
<option value="claude-sonnet-4-5-20250929">Claude Sonnet 4.5</option>
|
||||
<option value="claude-4-5-haiku-20250514">Claude Haiku 4.5</option>
|
||||
`;
|
||||
} else if (e.target.value === 'openai') {
|
||||
modelSelect.innerHTML = `
|
||||
<option value="gpt-4o-mini">GPT-4o Mini</option>
|
||||
<option value="o1-mini">GPT o1-mini</option>
|
||||
`;
|
||||
}
|
||||
saveConfig();
|
||||
});
|
||||
|
||||
// Save config on change
|
||||
document.getElementById('model').addEventListener('change', saveConfig);
|
||||
document.getElementById('target').addEventListener('change', saveConfig);
|
||||
|
||||
// Translation
|
||||
document.getElementById('translate').addEventListener('click', async () => {
|
||||
const button = document.getElementById('translate');
|
||||
const output = document.getElementById('output');
|
||||
const text = document.getElementById('input').value.trim();
|
||||
|
||||
if (!text) {
|
||||
output.innerHTML = '<span class="error">Veuillez entrer un texte.</span>';
|
||||
return;
|
||||
}
|
||||
|
||||
button.disabled = true;
|
||||
output.textContent = 'Traduction en cours...';
|
||||
|
||||
const config = {
|
||||
text,
|
||||
target: document.getElementById('target').value,
|
||||
provider: document.getElementById('provider').value,
|
||||
model: document.getElementById('model').value,
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await fetch('/translate', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(config),
|
||||
});
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
if (response.ok) {
|
||||
output.textContent = data.translation;
|
||||
} else {
|
||||
output.innerHTML = `<span class="error">Erreur: ${data.error}</span>`;
|
||||
}
|
||||
} catch (error) {
|
||||
output.innerHTML = `<span class="error">Erreur: ${error.message}</span>`;
|
||||
} finally {
|
||||
button.disabled = false;
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize
|
||||
loadConfig();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
75
ConfluentTranslator/server.js
Normal file
75
ConfluentTranslator/server.js
Normal file
@ -0,0 +1,75 @@
|
||||
require('dotenv').config({ path: '../.env' });
|
||||
const express = require('express');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const { Anthropic } = require('@anthropic-ai/sdk');
|
||||
const OpenAI = require('openai');
|
||||
|
||||
const app = express();
|
||||
const PORT = 3000;
|
||||
|
||||
app.use(express.json());
|
||||
app.use(express.static('public'));
|
||||
|
||||
// Load prompts
|
||||
const protoPrompt = fs.readFileSync(path.join(__dirname, 'prompts', 'proto-system.txt'), 'utf-8');
|
||||
const ancienPrompt = fs.readFileSync(path.join(__dirname, 'prompts', 'ancien-system.txt'), 'utf-8');
|
||||
|
||||
// Translation endpoint
|
||||
app.post('/translate', async (req, res) => {
|
||||
const { text, target, provider, model } = req.body;
|
||||
|
||||
if (!text || !target || !provider || !model) {
|
||||
return res.status(400).json({ error: 'Missing parameters' });
|
||||
}
|
||||
|
||||
const systemPrompt = target === 'proto' ? protoPrompt : ancienPrompt;
|
||||
|
||||
try {
|
||||
let translation;
|
||||
|
||||
if (provider === 'anthropic') {
|
||||
const anthropic = new Anthropic({
|
||||
apiKey: process.env.ANTHROPIC_API_KEY,
|
||||
});
|
||||
|
||||
const message = await anthropic.messages.create({
|
||||
model: model,
|
||||
max_tokens: 1024,
|
||||
system: systemPrompt,
|
||||
messages: [
|
||||
{ role: 'user', content: text }
|
||||
]
|
||||
});
|
||||
|
||||
translation = message.content[0].text;
|
||||
|
||||
} else if (provider === 'openai') {
|
||||
const openai = new OpenAI({
|
||||
apiKey: process.env.OPENAI_API_KEY,
|
||||
});
|
||||
|
||||
const completion = await openai.chat.completions.create({
|
||||
model: model,
|
||||
messages: [
|
||||
{ role: 'system', content: systemPrompt },
|
||||
{ role: 'user', content: text }
|
||||
]
|
||||
});
|
||||
|
||||
translation = completion.choices[0].message.content;
|
||||
} else {
|
||||
return res.status(400).json({ error: 'Unknown provider' });
|
||||
}
|
||||
|
||||
res.json({ translation });
|
||||
|
||||
} catch (error) {
|
||||
console.error('Translation error:', error);
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`ConfluentTranslator running on http://localhost:${PORT}`);
|
||||
});
|
||||
39
docs/proto-confluent/CLAUDE.md
Normal file
39
docs/proto-confluent/CLAUDE.md
Normal file
@ -0,0 +1,39 @@
|
||||
# CLAUDE.md - Proto-Confluent
|
||||
|
||||
## Projet
|
||||
|
||||
Documentation du **Proto-Confluent**, forme primitive de la langue de la Confluence.
|
||||
|
||||
## Contexte
|
||||
|
||||
Le Proto-Confluent est la langue des premiers clans avant leur unification. C'est une langue directe et concrète :
|
||||
- Mots isolés, pas de fusion
|
||||
- Forte présence du sacré (~50% des racines)
|
||||
- Grammaire simple par particules
|
||||
- Présent uniquement, pas de conjugaison temporelle
|
||||
|
||||
## Document principal
|
||||
|
||||
`PROTO-CONFLUENT.md` contient toute la documentation utilisable.
|
||||
|
||||
## Résumé rapide
|
||||
|
||||
### Phonologie
|
||||
- **Voyelles (4):** a, e, i, o
|
||||
- **Consonnes (8):** b, k, l, m, n, p, s, t
|
||||
|
||||
### Structure
|
||||
- Racines finissent par CV
|
||||
- ~50% racines sacrées (V initial)
|
||||
- Pas de fusion, mots côte à côte
|
||||
|
||||
### Syntaxe
|
||||
- Ordre SOV (Sujet - Objet - Verbe)
|
||||
- Particules : na (sujet), no (objet), ni (direction), ne (origine)
|
||||
- Négation : so (avant verbe)
|
||||
- Question : ka (fin), ki/ke/ko (qui/quoi/où)
|
||||
- Pluriel : si (après mot)
|
||||
- Intensification : répétition du mot
|
||||
|
||||
### Temps
|
||||
Présent implicite uniquement. Contexte temporel par mots (*temi seni* = temps ancien).
|
||||
479
docs/proto-confluent/PROTO-CONFLUENT.md
Normal file
479
docs/proto-confluent/PROTO-CONFLUENT.md
Normal file
@ -0,0 +1,479 @@
|
||||
# Proto-Confluent
|
||||
|
||||
Langue primitive des ancêtres de la Confluence, parlée avant l'émergence des liaisons sacrées et du système temporel complexe.
|
||||
|
||||
## Contexte
|
||||
|
||||
Le Proto-Confluent est la forme archaïque de la langue, utilisée par les premiers clans avant leur unification. C'est une langue directe, concrète, où chaque mot reste isolé. Les concepts abstraits et spirituels sont omniprésents (50% des racines sacrées), reflétant une société où le sacré imprègne le quotidien.
|
||||
|
||||
L'évolution vers l'Ancien Confluent apportera :
|
||||
- Les liaisons sacrées (fusion des racines)
|
||||
- La voyelle **u** (appartenance, union)
|
||||
- Les consonnes **v** et **z**
|
||||
- Le système temporel complet
|
||||
|
||||
---
|
||||
|
||||
## Phonologie
|
||||
|
||||
### Voyelles (4)
|
||||
| Voyelle | Prononciation |
|
||||
|---------|---------------|
|
||||
| **a** | comme "chat" |
|
||||
| **e** | comme "été" |
|
||||
| **i** | comme "lit" |
|
||||
| **o** | comme "mot" |
|
||||
|
||||
### Consonnes (8)
|
||||
| Consonne | Prononciation |
|
||||
|----------|---------------|
|
||||
| **b** | comme "bon" |
|
||||
| **k** | comme "car" |
|
||||
| **l** | comme "lune" |
|
||||
| **m** | comme "mère" |
|
||||
| **n** | comme "nuit" |
|
||||
| **p** | comme "père" |
|
||||
| **s** | comme "sol" |
|
||||
| **t** | comme "terre" |
|
||||
|
||||
### Structure syllabique
|
||||
- Toute racine finit par CV (consonne + voyelle)
|
||||
- Pas de groupes consonantiques complexes
|
||||
|
||||
---
|
||||
|
||||
## Syntaxe
|
||||
|
||||
### Ordre des mots : SOV
|
||||
**Sujet - Objet - Verbe**
|
||||
|
||||
```
|
||||
toli na aka no mila
|
||||
personne SUJET eau OBJET voir
|
||||
"La personne voit l'eau"
|
||||
```
|
||||
|
||||
### Particules de cas
|
||||
|
||||
Les particules se placent **après** le mot qu'elles marquent.
|
||||
|
||||
| Particule | Fonction | Exemple |
|
||||
|-----------|----------|---------|
|
||||
| **na** | sujet (qui fait) | *toli na* = "la personne (sujet)" |
|
||||
| **no** | objet direct | *aka no* = "l'eau (objet)" |
|
||||
| **ni** | direction, but | *tasa ni* = "vers la montagne" |
|
||||
| **ne** | origine, source | *nola ne* = "depuis la rivière" |
|
||||
|
||||
### Négation
|
||||
|
||||
| Particule | Sens | Position |
|
||||
|-----------|------|----------|
|
||||
| **so** | ne...pas | avant le verbe |
|
||||
|
||||
```
|
||||
toli na aka no so mila
|
||||
"La personne ne voit pas l'eau"
|
||||
```
|
||||
|
||||
### Interrogation
|
||||
|
||||
| Particule | Sens | Usage |
|
||||
|-----------|------|-------|
|
||||
| **ka** | question oui/non | fin de phrase |
|
||||
| **ki** | qui ? | remplace le sujet/objet |
|
||||
| **ke** | quoi ? | remplace l'objet |
|
||||
| **ko** | où ? | remplace le lieu |
|
||||
|
||||
```
|
||||
toli na aka no mila ka
|
||||
"La personne voit-elle l'eau ?"
|
||||
|
||||
ki na aka no mila
|
||||
"Qui voit l'eau ?"
|
||||
|
||||
toli na ke no mila
|
||||
"Que voit la personne ?"
|
||||
```
|
||||
|
||||
### Pluriel
|
||||
|
||||
| Particule | Position |
|
||||
|-----------|----------|
|
||||
| **si** | après le mot |
|
||||
|
||||
```
|
||||
toli si na aka no mila
|
||||
"Les personnes voient l'eau"
|
||||
```
|
||||
|
||||
### Intensification par répétition
|
||||
|
||||
Pas d'adverbes : on répète le mot.
|
||||
|
||||
```
|
||||
aka aka = beaucoup d'eau
|
||||
mako mako = très grand
|
||||
teki teki = aller vite / courir
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Temps
|
||||
|
||||
**Présent implicite uniquement.**
|
||||
|
||||
Pour indiquer le passé ou le futur, on utilise des mots de contexte :
|
||||
|
||||
```
|
||||
ona seni na... = "dans le temps ancien..." (passé)
|
||||
ora ni na... = "vers l'aurore..." (futur proche)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Racines Sacrées (~50%)
|
||||
|
||||
Commencent par une voyelle. Réservées aux concepts fondamentaux, spirituels et naturels primordiaux.
|
||||
|
||||
| Proto | Sens | Domaine |
|
||||
|-------|------|---------|
|
||||
| **aka** | eau, fluide | élément primordial |
|
||||
| **ala** | aile | nature sacrée |
|
||||
| **ami** | esprit, souffle vital | spirituel |
|
||||
| **ana** | âme, conscience | spirituel |
|
||||
| **asa** | sacré, divin | spirituel |
|
||||
| **aska** | libre, liberté | concept fondateur |
|
||||
| **ati** | oiseau, vol | nature sacrée |
|
||||
| **aita** | ancêtre, ancien | lignée |
|
||||
| **aki** | faucon | animal sacré |
|
||||
| **eka** | tout, entier | dimension |
|
||||
| **eko** | étoile | céleste |
|
||||
| **ena** | origine, source | dimension |
|
||||
| **ika** | un, unique | concept fondateur |
|
||||
| **ita** | être, exister | existence |
|
||||
| **oki** | épreuve, danger | conflit sacré |
|
||||
| **ola** | grue | animal sacré |
|
||||
| **ona** | son, vibration | rituel |
|
||||
| **ora** | aurore, aube | moment sacré |
|
||||
| **osi** | mort, mourir | cycle sacré |
|
||||
|
||||
---
|
||||
|
||||
## Racines Standards (~50%)
|
||||
|
||||
Commencent par une consonne. Vocabulaire quotidien et concret.
|
||||
|
||||
### Éléments et Nature
|
||||
| Proto | Sens |
|
||||
|-------|------|
|
||||
| **boka** | forêt |
|
||||
| **kali** | pierre, roche |
|
||||
| **lona** | lune |
|
||||
| **nola** | rivière, courant |
|
||||
| **pena** | air, vent |
|
||||
| **sela** | ciel |
|
||||
| **seli** | sel, mer |
|
||||
| **siko** | sec, aride |
|
||||
| **soki** | feu, flamme |
|
||||
| **sola** | soleil, lumière |
|
||||
| **tako** | sombre, obscur |
|
||||
| **tani** | vallée |
|
||||
| **tasa** | montagne |
|
||||
| **toka** | terre, sol |
|
||||
|
||||
### Corps et Sens
|
||||
| Proto | Sens |
|
||||
|-------|------|
|
||||
| **kano** | main |
|
||||
| **keko** | écho, résonance |
|
||||
| **kina** | sang |
|
||||
| **koli** | cœur |
|
||||
| **moka** | visage |
|
||||
| **niko** | chair, viande |
|
||||
| **peki** | pied, base |
|
||||
| **peli** | peau, surface |
|
||||
| **poki** | voix, parole |
|
||||
| **poli** | poumon, souffle |
|
||||
| **sano** | corps |
|
||||
| **sili** | œil, regard, vision |
|
||||
| **tiko** | oreille, écoute |
|
||||
|
||||
### Actions
|
||||
| Proto | Sens |
|
||||
|-------|------|
|
||||
| **kapi** | capturer, prendre |
|
||||
| **kiso** | transmettre, couper |
|
||||
| **kita** | donner |
|
||||
| **lano** | lancer, jeter |
|
||||
| **leti** | lever, élever |
|
||||
| **loti** | tourner, rotation |
|
||||
| **miko** | mélanger |
|
||||
| **mila** | voir, observer |
|
||||
| **moki** | apprendre |
|
||||
| **neka** | faire, créer |
|
||||
| **pasa** | prendre |
|
||||
| **peno** | venir, arriver |
|
||||
| **posa** | dire, parler |
|
||||
| **saki** | garder, protéger |
|
||||
| **samo** | assembler, unir |
|
||||
| **sana** | chasser, traquer |
|
||||
| **seka** | savoir, connaître |
|
||||
| **soki** | frapper, battre |
|
||||
| **sopi** | dormir, sommeil |
|
||||
| **taka** | porter, transporter |
|
||||
| **teki** | aller, chemin |
|
||||
| **teno** | tenir, garder |
|
||||
| **tiki** | tisser, lier |
|
||||
| **tilo** | tirer, extraire |
|
||||
| **toko** | toucher, contact |
|
||||
|
||||
### Êtres et Relations
|
||||
| Proto | Sens |
|
||||
|-------|------|
|
||||
| **besi** | bête, animal sauvage |
|
||||
| **kasi** | chef, guide |
|
||||
| **kota** | union, confluence |
|
||||
| **mito** | famille, clan |
|
||||
| **naki** | enfant, descendant |
|
||||
| **pako** | ami, allié |
|
||||
| **pesa** | poisson |
|
||||
| **sika** | serpent |
|
||||
| **soka** | ennemi, étranger hostile |
|
||||
| **tibo** | tribu, groupe |
|
||||
| **toli** | personne, individu |
|
||||
|
||||
### Concepts
|
||||
| Proto | Sens |
|
||||
|-------|------|
|
||||
| **kilo** | échanger, troquer |
|
||||
| **leko** | loi, règle |
|
||||
| **mako** | grand, vaste |
|
||||
| **meli** | doux, tendre |
|
||||
| **moli** | mémoire, souvenir |
|
||||
| **noli** | noble, élevé |
|
||||
| **nopo** | nouveau, jeune |
|
||||
| **paki** | paix, calme |
|
||||
| **pasi** | pont, lien, passage |
|
||||
| **piso** | petit, fin |
|
||||
| **poko** | poison, toxique |
|
||||
| **seko** | secret, caché |
|
||||
| **seni** | vieux, ancien |
|
||||
| **teli** | vrai, vérité |
|
||||
| **temi** | temps, durée |
|
||||
| **tosa** | bon, bien |
|
||||
|
||||
### Lieux et Structures
|
||||
| Proto | Sens |
|
||||
|-------|------|
|
||||
| **boli** | bord, limite |
|
||||
| **kama** | chambre, pièce |
|
||||
| **koni** | assemblée, réunion |
|
||||
| **kopa** | peinture, fresque |
|
||||
| **liko** | cercle, anneau |
|
||||
| **loko** | lieu, endroit |
|
||||
| **lopi** | route, chemin |
|
||||
| **nisa** | humide, mouillé |
|
||||
| **pola** | porte, passage |
|
||||
| **poto** | profond, gouffre |
|
||||
| **sapo** | serment, promesse |
|
||||
| **somo** | sommet, haut |
|
||||
| **soni** | zone, région |
|
||||
| **talo** | hall, grande salle |
|
||||
| **tomi** | tombe, enterrer |
|
||||
| **pela** | veille, guet |
|
||||
|
||||
### Matériaux et Objets
|
||||
| Proto | Sens |
|
||||
|-------|------|
|
||||
| **boki** | bois (matériau) |
|
||||
| **kelo** | couleur, teinte |
|
||||
| **kesa** | cendre, gris |
|
||||
| **keto** | chaîne, lien |
|
||||
| **kolo** | cercle, cycle |
|
||||
| **lapi** | lait, liquide blanc |
|
||||
| **laso** | rouge |
|
||||
| **lina** | ligne, corde |
|
||||
| **meti** | métal, minerai |
|
||||
| **napi** | navire, embarcation |
|
||||
| **piki** | pic, pointe |
|
||||
| **saki** | sac, contenant |
|
||||
| **sino** | signe, marque |
|
||||
| **tabi** | tablette, plaque |
|
||||
| **toko** | document, écrit |
|
||||
|
||||
### Communication
|
||||
| Proto | Sens |
|
||||
|-------|------|
|
||||
| **leki** | récit, histoire |
|
||||
| **lomi** | rumeur, bruit |
|
||||
| **mesi** | message, nouvelle |
|
||||
| **nomi** | nom, appellation |
|
||||
| **palo** | parler, discuter |
|
||||
|
||||
### Travail et Technique
|
||||
| Proto | Sens |
|
||||
|-------|------|
|
||||
| **moki** | moule, forme |
|
||||
| **piso** | fixer, attacher |
|
||||
| **selo** | servir, aider |
|
||||
| **tapo** | travail, œuvre |
|
||||
| **teko** | technique, art |
|
||||
|
||||
---
|
||||
|
||||
## Exemples de Phrases
|
||||
|
||||
### Phrases simples
|
||||
|
||||
**L'enfant voit l'eau.**
|
||||
```
|
||||
naki na aka no mila
|
||||
enfant SUJET eau OBJET voir
|
||||
```
|
||||
|
||||
**La personne donne le poisson.**
|
||||
```
|
||||
toli na pesa no kita
|
||||
personne SUJET poisson OBJET donner
|
||||
```
|
||||
|
||||
**Le chef parle.**
|
||||
```
|
||||
kasi na posa
|
||||
chef SUJET parler
|
||||
```
|
||||
|
||||
### Avec pluriel
|
||||
|
||||
**Les enfants voient les étoiles.**
|
||||
```
|
||||
naki si na eko si no mila
|
||||
enfant PL SUJET étoile PL OBJET voir
|
||||
```
|
||||
|
||||
### Avec négation
|
||||
|
||||
**L'ennemi ne vient pas.**
|
||||
```
|
||||
soka na so peno
|
||||
ennemi SUJET NEG venir
|
||||
```
|
||||
|
||||
**La personne ne sait pas.**
|
||||
```
|
||||
toli na so seka
|
||||
personne SUJET NEG savoir
|
||||
```
|
||||
|
||||
### Questions
|
||||
|
||||
**L'enfant dort-il ?**
|
||||
```
|
||||
naki na sopi ka
|
||||
enfant SUJET dormir QUESTION
|
||||
```
|
||||
|
||||
**Qui chasse le poisson ?**
|
||||
```
|
||||
ki na pesa no sana
|
||||
qui SUJET poisson OBJET chasser
|
||||
```
|
||||
|
||||
**Que fait la personne ?**
|
||||
```
|
||||
toli na ke no neka
|
||||
personne SUJET quoi OBJET faire
|
||||
```
|
||||
|
||||
**Où va le chef ?**
|
||||
```
|
||||
kasi na ko ni teki
|
||||
chef SUJET où DIRECTION aller
|
||||
```
|
||||
|
||||
### Avec direction/origine
|
||||
|
||||
**L'enfant va vers la montagne.**
|
||||
```
|
||||
naki na tasa ni teki
|
||||
enfant SUJET montagne DIRECTION aller
|
||||
```
|
||||
|
||||
**La personne vient de la rivière.**
|
||||
```
|
||||
toli na nola ne peno
|
||||
personne SUJET rivière ORIGINE venir
|
||||
```
|
||||
|
||||
### Avec intensification
|
||||
|
||||
**Beaucoup d'eau coule.**
|
||||
```
|
||||
aka aka na teki
|
||||
eau eau SUJET aller
|
||||
```
|
||||
|
||||
**Le très grand chef.**
|
||||
```
|
||||
kasi mako mako
|
||||
chef grand grand
|
||||
```
|
||||
|
||||
**L'enfant court (va vite).**
|
||||
```
|
||||
naki na teki teki
|
||||
enfant SUJET aller aller
|
||||
```
|
||||
|
||||
### Phrases complexes
|
||||
|
||||
**L'ancêtre libre garde la mémoire.**
|
||||
```
|
||||
aita aska na moli no saki
|
||||
ancêtre libre SUJET mémoire OBJET garder
|
||||
```
|
||||
|
||||
**Les personnes de la tribu chassent ensemble.**
|
||||
```
|
||||
toli si tibo na kota no sana
|
||||
personne PL tribu SUJET union OBJET chasser
|
||||
```
|
||||
|
||||
**L'âme sacrée voit l'étoile.**
|
||||
```
|
||||
ana asa na eko no mila
|
||||
âme sacré SUJET étoile OBJET voir
|
||||
```
|
||||
|
||||
### Contexte temporel
|
||||
|
||||
**Dans le temps ancien, les ancêtres parlaient.**
|
||||
```
|
||||
temi seni no aita si na posa
|
||||
temps ancien OBJET ancêtre PL SUJET parler
|
||||
```
|
||||
|
||||
**Vers l'aurore, l'enfant part.**
|
||||
```
|
||||
ora ni naki na teki
|
||||
aurore DIRECTION enfant SUJET aller
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Notes d'Usage
|
||||
|
||||
### Adjectifs
|
||||
Les adjectifs suivent le nom qu'ils modifient :
|
||||
- *toli mako* = "grande personne"
|
||||
- *aka asa* = "eau sacrée"
|
||||
|
||||
### Possession
|
||||
On juxtapose possesseur + possédé :
|
||||
- *kasi kano* = "main du chef" (litt. "chef main")
|
||||
- *naki sili* = "regard de l'enfant"
|
||||
|
||||
### Coordination
|
||||
Juxtaposition simple pour "et" :
|
||||
- *aka soki* = "eau et feu"
|
||||
- *toli naki* = "personne et enfant"
|
||||
Loading…
Reference in New Issue
Block a user