fix(ephemeris): alias the engine's three panchanga spellings to the table

Coordinator ruling (brief author, 2026-09-26): Aindra -> Indra (因陀罗),
Variyana -> Variyan (安逸), Dhanishtha -> Dhanishta (虚宿). Spelling aliases
only; the brief's table and its typed test copy are unchanged. BLOCKED item
struck through, PROGRESS / checklist / task index updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017eEAG8HD3mm8gsKXgk8uU8
This commit is contained in:
Jesse_Chen
2026-09-26 06:58:41 +08:00
co-authored by Claude Opus 5.5
parent 2981da6fbc
commit dd8912fea0
6 changed files with 29 additions and 15 deletions
+10 -4
View File
@@ -9,7 +9,10 @@
*
* Matching ignores case, spaces and hyphens. The three spelling aliases the
* brief lists (Garija/Gara, Dwitiya/Dvitiya, Shashthi/Shashti) live in
* `PANCHANGA_NAME_ALIASES`; no other alias is accepted.
* `PANCHANGA_NAME_ALIASES`, plus three the coordinator ruled on 2026-09-26 so
* the engine's own spellings (`scripts/muhurta.py`) reach the existing
* entries: Aindra → Indra, Variyana → Variyan, Dhanishtha → Dhanishta. These
* are spellings, not translations; no other alias is accepted.
*/
export type PanchangaNameKind = "tithi" | "nakshatra" | "yoga" | "karana";
@@ -114,11 +117,14 @@ export const KARANA_ZH: Readonly<Record<string, string>> = {
Kimstughna: "金斯图格纳",
};
/** Spelling alias → table key. Only the three pairs the brief names. */
/**
* Spelling alias → table key. The brief's three pairs, plus the engine's three
* spellings (coordinator ruling 2026-09-26).
*/
export const PANCHANGA_NAME_ALIASES: Readonly<Record<PanchangaNameKind, Readonly<Record<string, string>>>> = {
tithi: { Dvitiya: "Dwitiya", Shashti: "Shashthi" },
nakshatra: {},
yoga: {},
nakshatra: { Dhanishtha: "Dhanishta" },
yoga: { Aindra: "Indra", Variyana: "Variyan" },
karana: { Gara: "Garija" },
};
+15 -7
View File
@@ -85,6 +85,21 @@ test("the three listed aliases resolve to the same entry", () => {
assert.equal(panchangaNameZh("tithi", "Krishna Shashthi"), "黑分初六");
});
test("the engine's own spellings reach the existing entries (coordinator ruling 2026-09-26)", () => {
// `scripts/muhurta.py` spells these three differently from the brief's table.
// 原值:6de277a4 里断言这三个引擎拼法返回 null(照写梵文、待裁决)。
// 新值:映射到表内既有条目。
// 原因:协调方 2026-09-26 以任务书作者身份裁定补拼写别名,译名不变。
assert.equal(panchangaNameZh("yoga", "Aindra"), "因陀罗");
assert.equal(panchangaNameZh("yoga", "Indra"), "因陀罗");
assert.equal(panchangaNameZh("yoga", "Variyana"), "安逸");
assert.equal(panchangaNameZh("yoga", "Variyan"), "安逸");
assert.equal(panchangaNameZh("nakshatra", "Dhanishtha"), "虚宿");
assert.equal(panchangaNameZh("nakshatra", "Dhanishta"), "虚宿");
// An alias stays inside its own limb.
assert.equal(panchangaNameZh("nakshatra", "Aindra"), null);
});
test("case, spaces and hyphens are ignored", () => {
assert.equal(normalizePanchangaName("Uttara-Bhadra pada"), "uttarabhadrapada");
assert.equal(panchangaNameZh("nakshatra", "uttara bhadrapada"), "壁宿");
@@ -100,13 +115,6 @@ test("a name the table does not know returns null so the caller keeps the engine
assert.equal(panchangaNameZh("karana", "Unknown"), null);
// A yoga name is not looked up in another limb's table.
assert.equal(panchangaNameZh("nakshatra", "Vriddhi"), null);
/* Engine spellings (`scripts/muhurta.py`) that the brief's table spells
differently. Not aliased here: the brief allows only the three aliases
above, so these stay in Sanskrit until the table is ruled on — see
PROGRESS-people-ephemeris-ui-20260926 「待裁决」. */
assert.equal(panchangaNameZh("yoga", "Aindra"), null);
assert.equal(panchangaNameZh("yoga", "Variyana"), null);
assert.equal(panchangaNameZh("nakshatra", "Dhanishtha"), null);
});
test("tithi split separates the fortnight from the day", () => {