# hsai-rohit/h-sairohit-mood2emoji architecture

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

- Interactive diagram: https://gitdiagram.com/hsai-rohit/h-sairohit-mood2emoji
- Repository: https://github.com/hsai-rohit/h-sairohit-mood2emoji

## Overview

This is a small Streamlit teaching app: a learner enters a sentence, the app checks it against a child-safety word list, then uses TextBlob sentiment polarity and falls back to word counting when the result is neutral. The app displays a mood emoji and feedback; its Teacher Mode describes that flow. Styling and result rendering are internal UI responsibilities. The map is based on the README and the excerpted app.py; no separate subsystems or storage are shown.

Main entry points: [`app.py`](https://github.com/hsai-rohit/h-sairohit-mood2emoji/blob/main/app.py) (Streamlit app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["App interface"]
  node_streamlit_app["Streamlit app<br/>[app.py]"]
  node_input["Sentence input<br/>[app.py]"]
  node_result["Mood feedback<br/>[app.py]"]
  node_teacher_mode["Teacher Mode<br/>[app.py]"]
end

subgraph group_analysis["Text analysis"]
  node_safety["Safety filter<br/>[app.py]"]
  node_textblob["TextBlob analysis<br/>[app.py]"]
  node_rule_fallback["Rule fallback<br/>[app.py]"]
end

node_learner(("Learner"))

node_learner -->|"enters sentence"| node_input
node_input -->|"submits input"| node_streamlit_app
node_streamlit_app -->|"checks safety"| node_safety
node_streamlit_app -->|"analyzes text"| node_textblob
node_streamlit_app -->|"uses if neutral"| node_rule_fallback
node_streamlit_app -->|"shows feedback"| node_result
node_streamlit_app -->|"displays explanation"| node_teacher_mode

click node_streamlit_app "https://github.com/hsai-rohit/h-sairohit-mood2emoji/blob/main/app.py"
click node_input "https://github.com/hsai-rohit/h-sairohit-mood2emoji/blob/main/app.py"
click node_safety "https://github.com/hsai-rohit/h-sairohit-mood2emoji/blob/main/app.py"
click node_textblob "https://github.com/hsai-rohit/h-sairohit-mood2emoji/blob/main/app.py"
click node_rule_fallback "https://github.com/hsai-rohit/h-sairohit-mood2emoji/blob/main/app.py"
click node_result "https://github.com/hsai-rohit/h-sairohit-mood2emoji/blob/main/app.py"
click node_teacher_mode "https://github.com/hsai-rohit/h-sairohit-mood2emoji/blob/main/app.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_streamlit_app,node_input,node_result,node_teacher_mode toneBlue
class node_safety,node_textblob,node_rule_fallback toneAmber
class node_learner toneIndigo
```

## Components

### App interface

- [Streamlit app](https://github.com/hsai-rohit/h-sairohit-mood2emoji/blob/main/app.py): `app.py`
- [Sentence input](https://github.com/hsai-rohit/h-sairohit-mood2emoji/blob/main/app.py): `app.py`
- [Mood feedback](https://github.com/hsai-rohit/h-sairohit-mood2emoji/blob/main/app.py): `app.py`
- [Teacher Mode](https://github.com/hsai-rohit/h-sairohit-mood2emoji/blob/main/app.py): `app.py`

### Text analysis

- [Safety filter](https://github.com/hsai-rohit/h-sairohit-mood2emoji/blob/main/app.py): `app.py`
- [TextBlob analysis](https://github.com/hsai-rohit/h-sairohit-mood2emoji/blob/main/app.py): `app.py`
- [Rule fallback](https://github.com/hsai-rohit/h-sairohit-mood2emoji/blob/main/app.py): `app.py`

### Other components

- **Learner**

## Connections

- Learner → Sentence input: enters sentence (evidence: `app.py`)
- Sentence input → Streamlit app: submits input (evidence: `app.py`)
- Streamlit app → Safety filter: checks safety (evidence: `app.py`)
- Streamlit app → TextBlob analysis: analyzes text (evidence: `app.py`)
- Streamlit app → Rule fallback: uses if neutral (evidence: `app.py`)
- Streamlit app → Mood feedback: shows feedback (evidence: `app.py`)
- Streamlit app → Teacher Mode: displays explanation (evidence: `app.py`)
