forked from openvanilla/McBopomofo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
69 lines (54 loc) · 2.16 KB
/
Copy path__init__.py
File metadata and controls
69 lines (54 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
"""McBopomofo dictionary data curation tools.
This package provides tools for building, compiling, validating, and analyzing
dictionary data for the McBopomofo Traditional Chinese input method.
Project Path Configuration:
---------------------------
The package exports centralized path constants for consistent file access:
>>> from curation import PROJECT_ROOT, CONFIG_FILE
>>> print(PROJECT_ROOT) # .../Source/Data/
>>> print(CONFIG_FILE) # .../Source/Data/textpool.rc
All scripts and modules should import these constants instead of computing
paths relatively.
Submodules:
-----------
builders : Data building and processing tools
- frequency_builder: Generates frequency data from occurrence counts
- phrase_deriver: Derives associated phrases from dictionary data
compilers : Data compilation tools
- main_compiler: Main data compiler combining all source files
- plain_bpmf_compiler: Plain BPMF data compiler for traditional mode
- compiler_utils: Shared utilities for compilation
validators : Validation and analysis tools
- score_validator: Validates and tests dictionary data quality
utils : General utilities
- text_filter: Text filtering utilities for CJK characters
Usage:
------
Import specific modules:
>>> from curation.builders import frequency_builder
>>> from curation.compilers import main_compiler
Or import entire submodules:
>>> from curation import builders, compilers, validators, utils
Import project paths:
>>> from curation import PROJECT_ROOT, CONFIG_FILE
"""
__version__ = "0.1.0"
# Project path configuration
# All scripts and modules should import these constants for consistent path resolution
from pathlib import Path
# Project root is Source/Data/ directory (where pyproject.toml lives)
PROJECT_ROOT = Path(__file__).parent.parent
CONFIG_FILE = PROJECT_ROOT / "textpool.rc"
# Submodules are available but not imported to avoid side effects
# Import them explicitly when needed:
# >>> from curation import builders
# >>> from curation.builders import frequency_builder
__all__ = [
"analyzers",
"builders",
"compilers",
"validators",
"utils",
"PROJECT_ROOT",
"CONFIG_FILE",
]