python3 -m venv venv
source venv/bin/activate
deactivate
pip install -r requirements.txt
python3 phonetics.py 感
Display complete phonetic family trees showing parent-child relationships between characters.
from phonetic_tree import show_phonetic_family
# Show the complete family tree for a character
glyph = "𬩆"
tree = show_phonetic_family(glyph)
print(tree)𡿧(zāi) --
|
|災(zāi) --
| |
| |𨉒(?)
|
|甾(zī zāi) --
| |
| |淄(zī) --
| | |
| | |𬩆(?)
python3 demo_phonetic_tree.py
The function automatically:
- Finds the ancestor (root) of the entire family
- Builds a hierarchical tree structure
- Displays pinyin readings from
readings.csv - Uses a recursive algorithm to handle multi-level relationships
A beautiful web-based interface for exploring all 1,453 phonetic families interactively.
- 🔍 Search and filter by character or pinyin
- 📈 Sort by ranking, family size, or name
- 🌳 Interactive tree visualization
- 📊 View all families with statistics
- 📱 Responsive design for mobile and desktop
# Generate family data files (one-time setup)
python3 generate_family_data.py
# Start the web server
cd frontend
python3 serve.pyThen open your browser to: http://localhost:8000
See frontend/README.md for more details.
- 向(xiàng) - 249 members
- 亡(wáng) - 233 members
- 囗(wéi) - 233 members
- 父(fù) - 228 members
- 隹(zhuī) - 225 members
isort .
black .
flake8 .
mypy .
pytest
