fix(report): fill the full-data edition and clear English Han

Add the interpretation pages from fields the engine already computed, project the annual tables the reader prints, and clear English Han on the four measured charts. Patyayini is not implemented. The generate button copy is unchanged.

This commit stays on the feature branch and is not pushed to staging.
This commit is contained in:
jesse-ux
2026-10-08 22:29:41 +08:00
committed by Jesse_Chen
parent 98c98aa535
commit 25d067bf12
11 changed files with 1958 additions and 71 deletions
+177 -1
View File
@@ -297,6 +297,8 @@ def normalize_zh_markdown_terms(markdown: str) -> str:
text = _normalize_zh_bhava_factor_text(text)
text = text.replace("Bhava 年龄状态 十二宫力量", "Bhava Bala 十二宫力量")
text = text.replace("Shadbala / Bhava 年龄状态", "Shadbala / Bhava Bala")
text = text.replace("六维力量 / Bhava 年龄状态", "六维力量 / Bhava Bala")
text = text.replace("行星s", "行星")
text = text.replace("星宿 Scheme", "星宿身体对应表")
text = _normalize_mula_gloss(_restore_zh_nakshatra_glosses(_collapse_duplicate_zh_parentheses(text)))
text = text.replace("### 是 Solar Return", "### 真实太阳返照")
@@ -559,6 +561,180 @@ def _normalize_zh_dasha_prose(markdown: str) -> str:
return text
# Fragments left after the longer English glossary. Longer keys are applied first.
_EN_RESIDUAL_HAN: tuple[tuple[str, str], ...] = (
("没有候选以吉相位照年盘", "no candidate aspects the annual Lagna by a benefic aspect"),
("按子运起点星座奇偶", "by the odd or even sign where the sub-period starts"),
("按七级比较所落星座", "compare the occupied signs across seven levels"),
("两主分落别的星座", "the two lords fall in other signs"),
("星座或其主所落星座", "the sign, or the sign its lord occupies"),
("实际位置判断是否", "judge from the actual position whether"),
("以吉相位照年盘", "aspect the annual Lagna by a benefic aspect"),
("不单独增加结论的确定性", "does not by itself make a conclusion more certain"),
("年数数到该", "the year count reaches that sign"),
("一律顺行", "always direct"),
("只倒算计都", "only Ketu is counted backward"),
("未进打分", "not used in the score"),
("时间轴结论", "timeline conclusion"),
("主三角色", "primary triangle role"),
("七轮裁定", "seven-round decision"),
("书内分歧", "the book itself disagrees"),
("待替换为", "still to be replaced by"),
("取为年主", "is taken as the year lord"),
("五分力量", "five-fold strength"),
("五类候选", "five candidate groups"),
("以凶相位照", "aspect by a malefic aspect"),
("阶段框架", "phase frame"),
("起始年龄", "start age"),
("结束年龄", "end age"),
("六重力量", "six-fold strength"),
("矩阵源数据", "matrix source"),
("相位矩阵", "aspect matrix"),
("灵魂使命", "soul aim"),
("核心自我", "core self"),
("人生最高目标", "highest aim"),
("主要谋士", "main advisor"),
("权力代理", "delegated authority"),
("兄弟姐妹", "siblings"),
("冒险精神", "appetite for risk"),
("家庭根基", "home base"),
("情感安全感", "emotional security"),
("祖先业力", "ancestral pattern"),
("传统传承", "inherited tradition"),
("智能成果", "crafted results"),
("竞争对手", "rivals"),
("转化力量", "capacity for change"),
("配偶特质", "spouse traits"),
("伴侣关系", "partnership"),
("书例校准", "book-example calibration"),
("八分法", "eightfold division"),
("要素数量", "factor count"),
("要素总数", "factor total"),
("综合性质", "overall nature"),
("基本年数", "base years"),
("并列参考", "side reference"),
("双主星", "dual lords"),
("子运方向", "sub-period direction"),
("身份按同", "identity follows the same"),
("明显迹象", "a clear indication"),
("严重程度", "severity"),
("轴线之间", "between the axis"),
("颗行星", "planets"),
("高峰期", "peak phase"),
("下降期", "setting phase"),
("最困难", "most difficult"),
("需结合", "read together with"),
("灵魂星", "soul planet"),
("兄弟星", "sibling planet"),
("母亲星", "mother planet"),
("父亲星", "father planet"),
("子女星", "child planet"),
("障碍星", "obstacle planet"),
("配偶星", "spouse planet"),
("旧算法", "previous algorithm"),
("按原书", "per the book"),
("起运", "period start"),
("从主", "from the lord"),
("级取", "the level selects"),
("两主", "two lords"),
("等分", "equal parts"),
("未采用", "not used"),
("星座奇偶", "odd or even sign"),
("的子运", "sub-period"),
("待评估", "not yet assessed"),
("进行medium", "underway"),
("当before", "current "),
("原始值", "raw value"),
("主层", "main level"),
("子层", "sub level"),
("年数", "years"),
("主星", "lord"),
("序号", "index"),
("起始", "start"),
("结束", "end"),
("星座", "sign"),
("相位", "aspect"),
("年度", "annual"),
("细项", "detail"),
("年返", "solar return"),
("摘要", "summary"),
("项目", "item"),
("数值", "value"),
("方法", "method"),
("校验", "check"),
("辅助", "supporting"),
("算法", "algorithm"),
("并列", "listed alongside"),
("顺序", "order"),
("修正", "adjustment"),
("最终", "final"),
("正文", "body text"),
("阶段", "phase"),
("是否", "whether"),
("只有", "only"),
("特殊", "special"),
("方向", "direction"),
("勇气", "courage"),
("母亲", "mother"),
("父亲", "father"),
("子女", "children"),
("创造力", "creativity"),
("学生", "students"),
("障碍", "obstacles"),
("质量", "quality"),
("顺行", "direct"),
("逆行", "retrograde"),
("比较", "compare"),
("另一", "another"),
("部分", "partial"),
("进行", "in progress"),
("占据planet尊贵", "occupied planet dignity"),
("占据planet数", "occupied planet count"),
("partial减weak", "partially reduced"),
("成立条件", "conditions"),
("不in煞", "not in a malefic house"),
("迹象", "indication"),
("相邻", "adjacent"),
("占据", "occupies"),
("尊贵", "dignity"),
("克", "restrains"),
("其", " its "),
("减", "reduced"),
("最", "most "),
("条", "items"),
("的", " of "),
("不", "not "),
("吉", "benefic"),
("数", "count"),
("煞", "malefic"),
("看", "see"),
("起", "from"),
("版", "edition"),
("级", "level"),
("主", "lord"),
("期", "phase"),
("星", "planet"),
("度", "degree"),
("从", "from"),
("取", "take"),
("所", "at"),
("较", "comparatively"),
("当", "when"),
("按", "by"),
("有", "present"),
("无", "absent"),
("表", "table"),
)
def apply_en_residual_han(markdown: str) -> str:
"""Translate Han fragments that survive the longer English glossary."""
text = markdown
for raw, public in sorted(_EN_RESIDUAL_HAN, key=lambda item: len(item[0]), reverse=True):
text = text.replace(raw, public)
return text
def normalize_en_markdown_terms(markdown: str) -> str:
text = markdown.replace("(", "(").replace(")", ")").replace("、", ", ")
text = (
@@ -576,7 +752,7 @@ def normalize_en_markdown_terms(markdown: str) -> str:
r"\1 \2",
text,
)
return _thicken_en_dasha_density(text)
return apply_en_residual_han(_thicken_en_dasha_density(text))
def _thicken_en_dasha_density(markdown: str) -> str: