# rubyswolf/typing architecture

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

- Interactive diagram: https://gitdiagram.com/rubyswolf/typing
- Repository: https://github.com/rubyswolf/typing

## Overview

This repository combines a chord-typing runtime with tools for deriving and tuning chord layouts from text corpora. The main user-to-result path is physical key input, chord resolution against a selected layout, and emitted text; separate corpus-analysis tools produce layout and chord data, while another generates a word-chain resource. The README is empty, so capabilities are inferred from the tree and shown excerpts; relationships involving unsampled files are omitted where their wiring cannot be verified.

Main entry points: [`allDurf.txt`](https://github.com/rubyswolf/typing/blob/master/allDurf.txt) (Text corpus), [`chord_translator.py`](https://github.com/rubyswolf/typing/blob/master/chord_translator.py) (Chord translator), [`layouts`](https://github.com/rubyswolf/typing/tree/master/layouts) (Chord layouts), [`generate_chord_layout.py`](https://github.com/rubyswolf/typing/blob/master/generate_chord_layout.py) (Chord layout generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Typing runtime"]
  node_translator["Chord translator"]
  node_layout_data["Chord layouts"]
  node_visualizer["Typing visualizer"]
  node_tester["Typing tester<br/>[typing_tester.html]"]
end

subgraph group_design["Layout design"]
  node_layout_generator["Chord layout generator"]
  node_layout_search["Chord layout search"]
  node_typing_optimizer["Typing layout optimizer"]
  node_high_ngrams["High-order n-grams"]
  node_cross_room["Cross-room n-grams"]
end

subgraph group_resources["Corpus resources"]
  node_corpus["Text corpus<br/>[allDurf.txt]"]
  node_word_chain_generator["Word-chain generator"]
  node_word_chain["Word-chain data"]
  node_raw_corpus["Original corpus"]
end

node_typist(("Typist"))
node_keyboard["Keyboard input"]
node_text_output["Emitted text"]

node_typist -->|"presses keys"| node_keyboard
node_keyboard -->|"captures input"| node_translator
node_layout_data -->|"loads layout"| node_translator
node_translator -->|"emits text"| node_text_output
node_translator -->|"updates display"| node_visualizer
node_corpus -->|"scans text"| node_layout_generator
node_layout_generator -->|"writes layout"| node_layout_data
node_corpus -->|"scans text"| node_layout_search
node_corpus -->|"scans text"| node_typing_optimizer
node_corpus -->|"counts n-grams"| node_high_ngrams
node_high_ngrams -->|"adds chords"| node_layout_data
node_corpus -->|"counts n-grams"| node_cross_room
node_cross_room -->|"updates chords"| node_layout_data
node_corpus -->|"counts words"| node_word_chain_generator
node_word_chain_generator -->|"writes data"| node_word_chain

click node_translator "https://github.com/rubyswolf/typing/blob/master/chord_translator.py"
click node_layout_data "https://github.com/rubyswolf/typing/tree/master/layouts"
click node_visualizer "https://github.com/rubyswolf/typing/blob/master/chord_translator.py"
click node_tester "https://github.com/rubyswolf/typing/blob/master/typing_tester.html"
click node_corpus "https://github.com/rubyswolf/typing/blob/master/allDurf.txt"
click node_layout_generator "https://github.com/rubyswolf/typing/blob/master/generate_chord_layout.py"
click node_layout_search "https://github.com/rubyswolf/typing/blob/master/layout_optimizer.py"
click node_typing_optimizer "https://github.com/rubyswolf/typing/blob/master/optimize_typing_layout.py"
click node_high_ngrams "https://github.com/rubyswolf/typing/blob/master/add_high_order_ngrams.py"
click node_cross_room "https://github.com/rubyswolf/typing/blob/master/update_extended_cross_room_ngrams.py"
click node_word_chain_generator "https://github.com/rubyswolf/typing/blob/master/generate_word_chain.py"
click node_word_chain "https://github.com/rubyswolf/typing/blob/master/word_chain_top1k.json"
click node_raw_corpus "https://github.com/rubyswolf/typing/blob/master/allDurf.original.txt"

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_translator,node_layout_data,node_visualizer,node_tester toneBlue
class node_layout_generator,node_layout_search,node_typing_optimizer,node_high_ngrams,node_cross_room toneAmber
class node_corpus,node_word_chain_generator,node_word_chain,node_raw_corpus toneMint
class node_typist,node_keyboard,node_text_output toneIndigo
```

## Components

### Typing runtime

- [Chord translator](https://github.com/rubyswolf/typing/blob/master/chord_translator.py): `chord_translator.py`
- [Chord layouts](https://github.com/rubyswolf/typing/tree/master/layouts): `layouts`
- [Typing visualizer](https://github.com/rubyswolf/typing/blob/master/chord_translator.py): `chord_translator.py`
- [Typing tester](https://github.com/rubyswolf/typing/blob/master/typing_tester.html): `typing_tester.html`

### Layout design

- [Chord layout generator](https://github.com/rubyswolf/typing/blob/master/generate_chord_layout.py): `generate_chord_layout.py`
- [Chord layout search](https://github.com/rubyswolf/typing/blob/master/layout_optimizer.py): `layout_optimizer.py`
- [Typing layout optimizer](https://github.com/rubyswolf/typing/blob/master/optimize_typing_layout.py): `optimize_typing_layout.py`
- [High-order n-grams](https://github.com/rubyswolf/typing/blob/master/add_high_order_ngrams.py): `add_high_order_ngrams.py`
- [Cross-room n-grams](https://github.com/rubyswolf/typing/blob/master/update_extended_cross_room_ngrams.py): `update_extended_cross_room_ngrams.py`

### Corpus resources

- [Text corpus](https://github.com/rubyswolf/typing/blob/master/allDurf.txt): `allDurf.txt`
- [Word-chain generator](https://github.com/rubyswolf/typing/blob/master/generate_word_chain.py): `generate_word_chain.py`
- [Word-chain data](https://github.com/rubyswolf/typing/blob/master/word_chain_top1k.json): `word_chain_top1k.json`
- [Original corpus](https://github.com/rubyswolf/typing/blob/master/allDurf.original.txt): `allDurf.original.txt`

### Other components

- **Typist**
- **Keyboard input**
- **Emitted text**

## Connections

- Typist → Keyboard input: presses keys
- Keyboard input → Chord translator: captures input (evidence: `chord_translator.py`)
- Chord layouts → Chord translator: loads layout (evidence: `chord_translator.py`)
- Chord translator → Emitted text: emits text (evidence: `chord_translator.py`)
- Chord translator → Typing visualizer: updates display (evidence: `chord_translator.py`)
- Text corpus → Chord layout generator: scans text (evidence: `generate_chord_layout.py`)
- Chord layout generator → Chord layouts: writes layout (evidence: `generate_chord_layout.py`)
- Text corpus → Chord layout search: scans text (evidence: `layout_optimizer.py`)
- Text corpus → Typing layout optimizer: scans text (evidence: `optimize_typing_layout.py`)
- Text corpus → High-order n-grams: counts n-grams (evidence: `add_high_order_ngrams.py`)
- High-order n-grams → Chord layouts: adds chords (evidence: `add_high_order_ngrams.py`)
- Text corpus → Cross-room n-grams: counts n-grams (evidence: `update_extended_cross_room_ngrams.py`)
- Cross-room n-grams → Chord layouts: updates chords (evidence: `update_extended_cross_room_ngrams.py`)
- Text corpus → Word-chain generator: counts words (evidence: `generate_word_chain.py`)
- Word-chain generator → Word-chain data: writes data (evidence: `generate_word_chain.py`)
