# pwxcoo/chinese-xinhua architecture

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

- Interactive diagram: https://gitdiagram.com/pwxcoo/chinese-xinhua
- Repository: https://github.com/pwxcoo/chinese-xinhua

## Overview

This repository is a static Chinese dictionary and phrase database, not a running API; the README says the API was discontinued. Its user workflow is to obtain the relevant JSON or CSV collection and use its records directly. The collections cover characters, words, idioms, and xiehouyu, with an additional CSV dataset. Scraping scripts document data acquisition, but the excerpts do not establish how every checked-in data file was produced; only the ci.csv write is explicit.

Main entry points: [`data/idiom.json`](https://github.com/pwxcoo/chinese-xinhua/blob/master/data/idiom.json) (Idiom records), [`data/word.json`](https://github.com/pwxcoo/chinese-xinhua/blob/master/data/word.json) (Character records), [`data/xiehouyu.json`](https://github.com/pwxcoo/chinese-xinhua/blob/master/data/xiehouyu.json) (Xiehouyu records), [`data/ci.csv`](https://github.com/pwxcoo/chinese-xinhua/blob/master/data/ci.csv) (Word CSV)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collections["Data collections"]
  node_characters[("Character records<br/>[word.json]")]
  node_words[("Word records<br/>[ci.json]")]
  node_idioms[("Idiom records<br/>[idiom.json]")]
  node_sayings[("Xiehouyu records<br/>[xiehouyu.json]")]
  node_word_csv[("Word CSV<br/>[ci.csv]")]
end

subgraph group_acquisition["Data acquisition"]
  node_word_scraper["Character scraper<br/>[word.py]"]
  node_idiom_scraper["Idiom scraper<br/>[chengyu.py]"]
  node_saying_scraper["Xiehouyu scraper<br/>[xiehouyu.py]"]
  node_word_scraper_ci["Word scraper<br/>[ci.py]"]
  node_abbreviations["Abbreviation enrichment<br/>[addAbbreviation.py]"]
end

node_user(("Data user"))

node_characters -->|"provides records"| node_user
node_words -->|"provides records"| node_user
node_idioms -->|"provides records"| node_user
node_sayings -->|"provides records"| node_user
node_word_csv -->|"provides data"| node_user
node_word_scraper -.->|"writes JSON"| node_characters
node_idiom_scraper -.->|"writes JSON"| node_idioms
node_saying_scraper -.->|"writes JSON"| node_sayings
node_word_scraper_ci -->|"appends CSV"| node_word_csv
node_abbreviations -.->|"writes JSON"| node_idioms

click node_characters "https://github.com/pwxcoo/chinese-xinhua/blob/master/data/word.json"
click node_words "https://github.com/pwxcoo/chinese-xinhua/blob/master/data/ci.json"
click node_idioms "https://github.com/pwxcoo/chinese-xinhua/blob/master/data/idiom.json"
click node_sayings "https://github.com/pwxcoo/chinese-xinhua/blob/master/data/xiehouyu.json"
click node_word_csv "https://github.com/pwxcoo/chinese-xinhua/blob/master/data/ci.csv"
click node_word_scraper "https://github.com/pwxcoo/chinese-xinhua/blob/master/scripts/word.py"
click node_idiom_scraper "https://github.com/pwxcoo/chinese-xinhua/blob/master/scripts/chengyu.py"
click node_saying_scraper "https://github.com/pwxcoo/chinese-xinhua/blob/master/scripts/xiehouyu.py"
click node_word_scraper_ci "https://github.com/pwxcoo/chinese-xinhua/blob/master/scripts/ci.py"
click node_abbreviations "https://github.com/pwxcoo/chinese-xinhua/blob/master/scripts/addAbbreviation.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_characters,node_words,node_idioms,node_sayings,node_word_csv,node_user toneBlue
class node_word_scraper,node_idiom_scraper,node_saying_scraper,node_word_scraper_ci,node_abbreviations toneAmber
```

## Components

### Data collections

- [Character records](https://github.com/pwxcoo/chinese-xinhua/blob/master/data/word.json): `data/word.json`
- [Word records](https://github.com/pwxcoo/chinese-xinhua/blob/master/data/ci.json): `data/ci.json`
- [Idiom records](https://github.com/pwxcoo/chinese-xinhua/blob/master/data/idiom.json): `data/idiom.json`
- [Xiehouyu records](https://github.com/pwxcoo/chinese-xinhua/blob/master/data/xiehouyu.json): `data/xiehouyu.json`
- [Word CSV](https://github.com/pwxcoo/chinese-xinhua/blob/master/data/ci.csv): `data/ci.csv`

### Data acquisition

- [Character scraper](https://github.com/pwxcoo/chinese-xinhua/blob/master/scripts/word.py): `scripts/word.py`
- [Idiom scraper](https://github.com/pwxcoo/chinese-xinhua/blob/master/scripts/chengyu.py): `scripts/chengyu.py`
- [Xiehouyu scraper](https://github.com/pwxcoo/chinese-xinhua/blob/master/scripts/xiehouyu.py): `scripts/xiehouyu.py`
- [Word scraper](https://github.com/pwxcoo/chinese-xinhua/blob/master/scripts/ci.py): `scripts/ci.py`
- [Abbreviation enrichment](https://github.com/pwxcoo/chinese-xinhua/blob/master/scripts/addAbbreviation.py): `scripts/addAbbreviation.py`

### Other components

- **Data user**

## Connections

- Character records → Data user: provides records (evidence: `README.md`)
- Word records → Data user: provides records (evidence: `README.md`)
- Idiom records → Data user: provides records (evidence: `README.md`)
- Xiehouyu records → Data user: provides records (evidence: `README.md`)
- Word CSV → Data user: provides data (evidence: `README.md`)
- Character scraper → Character records: writes JSON
- Idiom scraper → Idiom records: writes JSON
- Xiehouyu scraper → Xiehouyu records: writes JSON
- Word scraper → Word CSV: appends CSV (evidence: `scripts/ci.py`)
- Abbreviation enrichment → Idiom records: writes JSON
