# keithnery/kuapa architecture

> Architecture diagram of the GitHub repository keithnery/kuapa, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/keithnery/kuapa
- Repository: https://github.com/keithnery/kuapa

## Overview

KUAPA is a small collection of command-line translators for endangered Brazilian Indigenous languages. Users enter Portuguese words for Yaathe lookup, sentences for Tupi Potiguara word translation, or simple expressions for Tupi Potiguara template translation. Each translator is a standalone script with its own vocabulary and interaction flow; the README documents the language directions and limited feature set. The graph reflects the sampled scripts; no shared runtime or external service is shown.

Main entry points: [`tupi potiguara translator.py`](https://github.com/keithnery/kuapa/blob/main/tupi%20potiguara%20translator.py) (Sentence Translation), [`native translators.py`](https://github.com/keithnery/kuapa/blob/main/native%20translators.py) (Language Menu), [`Yaathe translator.py`](https://github.com/keithnery/kuapa/blob/main/Yaathe%20translator.py) (Word Lookup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_yaathe["Yaathe Translator"]
  node_yaathe_cli["Word Lookup"]
  node_yaathe_vocab["Word Dictionary"]
end

subgraph group_tp_words["Tupi Word Translator"]
  node_tp_word_cli["Sentence Translation"]
  node_tp_word_vocab["Word Vocabulary"]
  node_tp_ignored["Ignored Words"]
end

subgraph group_tp_phrases["Tupi Phrase Translator"]
  node_tp_phrase_cli["Language Menu"]
  node_tp_phrase_matcher["Template Matcher"]
  node_tp_phrase_vocab["Phrase Dictionary"]
end

node_user(("User"))

node_user -->|"enters word"| node_yaathe_cli
node_yaathe_cli -->|"looks up"| node_yaathe_vocab
node_yaathe_cli -->|"prints translation"| node_user
node_user -->|"enters sentence"| node_tp_word_cli
node_tp_word_cli -->|"filters words"| node_tp_ignored
node_tp_word_cli -->|"looks up words"| node_tp_word_vocab
node_tp_word_cli -->|"prints translation"| node_user
node_user -->|"chooses direction"| node_tp_phrase_cli
node_user -->|"enters text"| node_tp_phrase_cli
node_tp_phrase_cli -->|"calls translate"| node_tp_phrase_matcher
node_tp_phrase_matcher -->|"matches templates"| node_tp_phrase_vocab
node_tp_phrase_cli -->|"prints translation"| node_user

click node_yaathe_cli "https://github.com/keithnery/kuapa/blob/main/Yaathe%20translator.py"
click node_yaathe_vocab "https://github.com/keithnery/kuapa/blob/main/Yaathe%20translator.py"
click node_tp_word_cli "https://github.com/keithnery/kuapa/blob/main/tupi%20potiguara%20translator.py"
click node_tp_word_vocab "https://github.com/keithnery/kuapa/blob/main/tupi%20potiguara%20translator.py"
click node_tp_ignored "https://github.com/keithnery/kuapa/blob/main/tupi%20potiguara%20translator.py"
click node_tp_phrase_cli "https://github.com/keithnery/kuapa/blob/main/native%20translators.py"
click node_tp_phrase_matcher "https://github.com/keithnery/kuapa/blob/main/native%20translators.py"
click node_tp_phrase_vocab "https://github.com/keithnery/kuapa/blob/main/native%20translators.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_yaathe_cli,node_yaathe_vocab,node_user toneBlue
class node_tp_word_cli,node_tp_word_vocab,node_tp_ignored toneAmber
class node_tp_phrase_cli,node_tp_phrase_matcher,node_tp_phrase_vocab toneMint
```

## Components

### Yaathe Translator

- [Word Lookup](https://github.com/keithnery/kuapa/blob/main/Yaathe%20translator.py): `Yaathe translator.py`
- [Word Dictionary](https://github.com/keithnery/kuapa/blob/main/Yaathe%20translator.py): `Yaathe translator.py`

### Tupi Word Translator

- [Sentence Translation](https://github.com/keithnery/kuapa/blob/main/tupi%20potiguara%20translator.py): `tupi potiguara translator.py`
- [Word Vocabulary](https://github.com/keithnery/kuapa/blob/main/tupi%20potiguara%20translator.py): `tupi potiguara translator.py`
- [Ignored Words](https://github.com/keithnery/kuapa/blob/main/tupi%20potiguara%20translator.py): `tupi potiguara translator.py`

### Tupi Phrase Translator

- [Language Menu](https://github.com/keithnery/kuapa/blob/main/native%20translators.py): `native translators.py`
- [Template Matcher](https://github.com/keithnery/kuapa/blob/main/native%20translators.py): `native translators.py`
- [Phrase Dictionary](https://github.com/keithnery/kuapa/blob/main/native%20translators.py): `native translators.py`

### Other components

- **User**

## Connections

- User → Word Lookup: enters word (evidence: `Yaathe translator.py`)
- Word Lookup → Word Dictionary: looks up (evidence: `Yaathe translator.py`)
- Word Lookup → User: prints translation (evidence: `Yaathe translator.py`)
- User → Sentence Translation: enters sentence (evidence: `tupi potiguara translator.py`)
- Sentence Translation → Ignored Words: filters words (evidence: `tupi potiguara translator.py`)
- Sentence Translation → Word Vocabulary: looks up words (evidence: `tupi potiguara translator.py`)
- Sentence Translation → User: prints translation (evidence: `tupi potiguara translator.py`)
- User → Language Menu: chooses direction (evidence: `native translators.py`)
- User → Language Menu: enters text (evidence: `native translators.py`)
- Language Menu → Template Matcher: calls translate (evidence: `native translators.py`)
- Template Matcher → Phrase Dictionary: matches templates (evidence: `native translators.py`)
- Language Menu → User: prints translation (evidence: `native translators.py`)
