Skip to content

Commit c1b7f61

Browse files
committed
feat: modernize Python project
1 parent 623fb25 commit c1b7f61

47 files changed

Lines changed: 1530 additions & 3404 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ McBopomofo (小麥注音輸入法) is a Traditional Chinese input method engine
1313
**Development:**
1414
- macOS 14.7 or later
1515
- Xcode 15.3 or later
16-
- Python 3.9 (for dictionary data generation)
16+
- Python 3.12+ (for dictionary data generation)
1717

1818
## Building and Running
1919

@@ -88,7 +88,7 @@ LC_ALL=C sort -o BPMFMappings.txt BPMFMappings.txt
8888
LC_ALL=C sort -o phrase.occ phrase.occ
8989
```
9090

91-
**For detailed dictionary data documentation**, see `Source/Data/AGENTS.md` which covers file formats, editing workflows, Python tools, and troubleshooting.
91+
**For detailed dictionary data documentation**, see `Source/Data/README.md` which covers file formats, editing workflows, Python tools, and troubleshooting.
9292

9393
## GitHub Copilot Configuration
9494

@@ -117,7 +117,7 @@ McBopomofo uses a three-layer architecture (Swift/Objective-C++/C++). For detail
117117
| `Source/Engine/Mandarin/Mandarin.cpp` | Bopomofo syllable processing and keyboard layouts |
118118
| `Source/Engine/gramambular2/` | Text segmentation algorithms (HMM-based) |
119119
| `Source/Data/Makefile` | Dictionary data build system |
120-
| `Source/Data/AGENTS.md` | Comprehensive dictionary data documentation |
120+
| `Source/Data/README.md` | Comprehensive dictionary data documentation |
121121
| `algorithm.md` | Detailed algorithm explanation (Chinese) |
122122
| `McBopomofoTests/PreferencesTests.swift` | Example Swift Testing suite patterns |
123123

@@ -181,7 +181,7 @@ McBopomofo uses a three-layer architecture (Swift/Objective-C++/C++). For detail
181181

182182
### Dictionary Data Modifications
183183

184-
For dictionary data modifications, see [Wiki: 詞庫開發說明](https://github.com/openvanilla/McBopomofo/wiki/詞庫開發說明) or `Source/Data/AGENTS.md` for detailed workflows.
184+
For dictionary data modifications, see [Wiki: 詞庫開發說明](https://github.com/openvanilla/McBopomofo/wiki/詞庫開發說明) or `Source/Data/README.md` for detailed workflows.
185185

186186
## Things to Avoid
187187

Source/Data/.gitignore

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,230 @@
1+
# ============================================================================
2+
# McBopomofo Data Build Artifacts
3+
# ============================================================================
4+
# Generated dictionary data files (built by Makefile, bundled into app)
15
PhraseFreq.txt
26
associated-phrases-v2.txt
37
cand.occ
48
data-plain-bpmf.txt
59
data.txt
10+
11+
# ============================================================================
12+
# Python .gitignore (Official GitHub Template)
13+
# ============================================================================
14+
15+
# Byte-compiled / optimized / DLL files
16+
__pycache__/
17+
*.py[codz]
18+
*$py.class
19+
20+
# C extensions
21+
*.so
22+
23+
# Distribution / packaging
24+
.Python
25+
build/
26+
develop-eggs/
27+
dist/
28+
downloads/
29+
eggs/
30+
.eggs/
31+
lib/
32+
lib64/
33+
parts/
34+
sdist/
35+
var/
36+
wheels/
37+
share/python-wheels/
38+
*.egg-info/
39+
.installed.cfg
40+
*.egg
41+
MANIFEST
42+
43+
# PyInstaller
44+
# Usually these files are written by a python script from a template
45+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
46+
*.manifest
47+
*.spec
48+
49+
# Installer logs
50+
pip-log.txt
51+
pip-delete-this-directory.txt
52+
53+
# Unit test / coverage reports
54+
htmlcov/
55+
.tox/
56+
.nox/
57+
.coverage
58+
.coverage.*
59+
.cache
60+
nosetests.xml
61+
coverage.xml
62+
*.cover
63+
*.py.cover
64+
.hypothesis/
65+
.pytest_cache/
66+
cover/
67+
68+
# Translations
69+
*.mo
70+
*.pot
71+
72+
# Django stuff:
73+
*.log
74+
local_settings.py
75+
db.sqlite3
76+
db.sqlite3-journal
77+
78+
# Flask stuff:
79+
instance/
80+
.webassets-cache
81+
82+
# Scrapy stuff:
83+
.scrapy
84+
85+
# Sphinx documentation
86+
docs/_build/
87+
88+
# PyBuilder
89+
.pybuilder/
90+
target/
91+
92+
# Jupyter Notebook
93+
.ipynb_checkpoints
94+
95+
# IPython
96+
profile_default/
97+
ipython_config.py
98+
99+
# pyenv
100+
# For a library or package, you might want to ignore these files since the code is
101+
# intended to run in multiple environments; otherwise, check them in:
102+
# .python-version
103+
104+
# pipenv
105+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
106+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
107+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
108+
# install all needed dependencies.
109+
# Pipfile.lock
110+
111+
# UV
112+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
113+
# This is especially recommended for binary packages to ensure reproducibility, and is more
114+
# commonly ignored for libraries.
115+
# uv.lock
116+
117+
# poetry
118+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
119+
# This is especially recommended for binary packages to ensure reproducibility, and is more
120+
# commonly ignored for libraries.
121+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
122+
# poetry.lock
123+
# poetry.toml
124+
125+
# pdm
126+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
127+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
128+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
129+
# pdm.lock
130+
# pdm.toml
131+
.pdm-python
132+
.pdm-build/
133+
134+
# pixi
135+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
136+
# pixi.lock
137+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
138+
# in the .venv directory. It is recommended not to include this directory in version control.
139+
.pixi
140+
141+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
142+
__pypackages__/
143+
144+
# Celery stuff
145+
celerybeat-schedule
146+
celerybeat.pid
147+
148+
# Redis
149+
*.rdb
150+
*.aof
151+
*.pid
152+
153+
# RabbitMQ
154+
mnesia/
155+
rabbitmq/
156+
rabbitmq-data/
157+
158+
# ActiveMQ
159+
activemq-data/
160+
161+
# SageMath parsed files
162+
*.sage.py
163+
164+
# Environments
165+
.env
166+
.envrc
167+
.venv
168+
env/
169+
venv/
170+
ENV/
171+
env.bak/
172+
venv.bak/
173+
174+
# Spyder project settings
175+
.spyderproject
176+
.spyproject
177+
178+
# Rope project settings
179+
.ropeproject
180+
181+
# mkdocs documentation
182+
/site
183+
184+
# mypy
185+
.mypy_cache/
186+
.dmypy.json
187+
dmypy.json
188+
189+
# Pyre type checker
190+
.pyre/
191+
192+
# pytype static type analyzer
193+
.pytype/
194+
195+
# Cython debug symbols
196+
cython_debug/
197+
198+
# PyCharm
199+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
200+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
201+
# and can be added to the global gitignore or merged into this file. For a more nuclear
202+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
203+
# .idea/
204+
205+
# Abstra
206+
# Abstra is an AI-powered process automation framework.
207+
# Ignore directories containing user credentials, local state, and settings.
208+
# Learn more at https://abstra.io/docs
209+
.abstra/
210+
211+
# Visual Studio Code
212+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
213+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
214+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
215+
# you could uncomment the following to ignore the entire vscode folder
216+
# .vscode/
217+
218+
# Ruff stuff:
219+
.ruff_cache/
220+
221+
# PyPI configuration file
222+
.pypirc
223+
224+
# Marimo
225+
marimo/_static/
226+
marimo/_lsp/
227+
__marimo__/
228+
229+
# Streamlit
230+
.streamlit/secrets.toml

Source/Data/README

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)