# enzet/emmio architecture

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

- Interactive diagram: https://gitdiagram.com/enzet/emmio
- Repository: https://github.com/enzet/emmio

## Overview

Based on our review of the file tree and README, Emmio is an experimental language learning project implemented mainly in Python. Its purpose is to provide spaced repetition–based learning systems and vocabulary (lexicon) assessment tools while managing several types of artifacts (dictionaries, sentence translations, frequency and word lists, and audio files).

##### Project Identification and Overall Concept
- That it is implemented primarily in Python (with additional Go and C modules likely targeting specific tasks), and that it uses a modular structure for handling different artifacts and learning algorithms.

##### Main Components
- Command-Line/User Interface: Represent the entry point (emmio/__main__.py and emmio/ui.py) that handles user commands (for example, “lexicon”, “learn”, etc.).
- Core Learning Modules:
- Learning System: Modules in emmio/learn (teacher, serialization, visualization, etc.) that implement the spaced repetition learning algorithm.
- Lexicon Assessment: The lexicon modules (emmio/lexicon and its visualizer) which assess vocabulary knowledge, using randomized weighted word presentations.
- Data Management and Artifact Handlers:
- Dictionaries: Include the dictionary component (with modules such as emmio/dictionary/core.py, config.py, and integrations like en_wiktionary.py and google_translate.py) that fetch and manage word translations and definitions.
- Sentence Translations: Show the sentence service (emmio/sentence modules) which handles loading and linking of sentences and translations (including Tatoeba support).
- Word & Frequency Lists: Represent the frequency/word lists modules (emmio/lists) that process and store word occurrence data.
- Audio Module: Include the audio component (emmio/audio), which processes and manages audio files for words and sentences.
- Secondary / Utility Components:
- Data and Serialization: Modules like emmio/data.py and emmio/serialization.py that handle storing and transferring data.
- User Management: Modules in emmio/user that handle configuration and storage of individual user progress and settings.
- Graphing and Visualization: Elements like emmio/plot.py and visualizer modules in learn/ and lexicon/ for visual feedback.
- Miscellaneous: Other supporting components like emmio/text, emmio/graph, emmio/util, and integration modules (even the modules in “c” and “go/text.go” that might be used for performance-critical functions).

##### Relationships and Interactions
- That the modules often load configuration settings (see the various config.py and config.json files) which in turn determine behavior. For example, the dictionary configuration influences how word translations are fetched.
- Interactions between modules: for instance, the lexicon algorithm uses frequency lists to weigh words; the learning algorithm might update user data stored in a specific “users” directory under the data directory (as described in the README).

##### Additional Details to Capture
- Smaller modules (like the ones in “emmio/text”, “emmio/graph”, etc.) if they play a major role in visualization or data processing.
- Don’t forget to show how language-specific functionalities are implemented. For instance, the dictionary and sentence modules process language-specific data, while the frequency lists help in tailoring learning to a specific language profile.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Interface Layer"
        UI["User Interface"]:::interface
    end

    subgraph "Core Modules"
        LM["Learning Module"]:::core
        LX["Lexicon Module"]:::core
    end

    subgraph "Services Layer"
        DS["Dictionary Service"]:::service
        SS["Sentence Service"]:::service
        LS["Lists Service"]:::service
        AS["Audio Service"]:::service
    end

    subgraph "Utilities Layer"
        DSER["Data & Serialization"]:::utility
        UM["User Management"]:::utility
        GV["Graphing/Visualization"]:::utility
        MU["Misc Utilities"]:::utility
    end

    subgraph "Artifacts Repository"
        AR["Artifacts Repository"]:::repo
    end

    UI -->|"routes_to"| LM
    UI -->|"routes_to"| LX

    LM -->|"uses"| DS
    LM -->|"uses"| SS
    LM -->|"uses"| LS
    LM -->|"uses"| AS
    LM -->|"updates"| UM

    LX -->|"frequency_weight"| LS

    LM -->|"stores_data"| DSER
    LX -->|"stores_data"| DSER

    LM -->|"visual_feedback"| GV
    LX -->|"visual_feedback"| GV

    DS -->|"fetches_to"| AR
    SS -->|"links_to"| AR
    LS -->|"stores_in"| AR
    AS -->|"manages"| AR

    MU ---|"supports"| LM
    MU ---|"supports"| LX
    MU -->|"enhances"| DS
    MU -->|"enhances"| SS

    click UI "https://github.com/enzet/emmio/blob/main/emmio/__main__.py"
    click UI "https://github.com/enzet/emmio/blob/main/emmio/ui.py"

    click LM "https://github.com/enzet/emmio/tree/main/emmio/learn"
    click LX "https://github.com/enzet/emmio/tree/main/emmio/lexicon"

    click DS "https://github.com/enzet/emmio/tree/main/emmio/dictionary"
    click SS "https://github.com/enzet/emmio/tree/main/emmio/sentence"
    click LS "https://github.com/enzet/emmio/tree/main/emmio/lists"
    click AS "https://github.com/enzet/emmio/tree/main/emmio/audio"

    click DSER "https://github.com/enzet/emmio/blob/main/emmio/data.py"
    click DSER "https://github.com/enzet/emmio/blob/main/emmio/serialization.py"

    click UM "https://github.com/enzet/emmio/tree/main/emmio/user"

    click GV "https://github.com/enzet/emmio/blob/main/emmio/plot.py"
    click GV "https://github.com/enzet/emmio/blob/main/emmio/graph.py"

    click MU "https://github.com/enzet/emmio/tree/main/emmio/text"
    click MU "https://github.com/enzet/emmio/blob/main/emmio/util.py"
    click MU "https://github.com/enzet/emmio/blob/main/c/text.c"
    click MU "https://github.com/enzet/emmio/blob/main/go/text.go"

    classDef interface fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef core fill:#A9DFBF,stroke:#229954,stroke-width:2px;
    classDef service fill:#F9E79F,stroke:#F1C40F,stroke-width:2px;
    classDef utility fill:#F5B7B1,stroke:#C0392B,stroke-width:2px;
    classDef repo fill:#CCD1D1,stroke:#566573,stroke-width:2px;
```
