Files
typikon/examples/dump.rs
T
funkpower 56cc1a3d92 Greek and Slavic usage, and the marks the books print
Both keep the same Typikon and read it a little differently, and until now
this library silently picked one reading and called it the Typikon. Two
differences are modelled, each one visible in the output and named in the
day's reason:

  - The Protection of the Theotokos is a great feast in Slavic usage. Greek
    practice ranks it lower, and the Church of Greece keeps it on 28 October
    besides. This has teeth: rank is what lifts a Wednesday or Friday fast.
  - Greek practice admits fish on any day of the Nativity Fast but Wednesday
    and Friday until 17 December; Slavic practice keeps fish to Saturdays and
    Sundays throughout.

Every jurisdiction carries the usage its books follow, and --tradition
overrides it for a parish that does not match its jurisdiction's default. The
difference in the calendar lives in a data overlay compiled in beside the
common menologion, which is where a local church's own commemorations would
go; the difference in the fast lives in the rule, because that is where it is.

Each rank also now carries the mark the books print beside it, circled cross,
cross and Jerusalem cross for great, vigil and polyeleos. Unicode has no glyph
for the polyeleos sign, a cross over a half-circle, so the Jerusalem cross
stands in as digital calendars generally settle on.
2026-09-18 11:28:40 -04:00

20 lines
784 B
Rust

// Dump every day of a range, every jurisdiction, as one JSON object per line,
// for differential testing against the Python implementation.
use typikon::calendars::Date;
use typikon::day::describe_with;
use typikon::jurisdictions::{CALENDARS, JURISDICTIONS};
use typikon::menologion;
fn main() {
let args: Vec<String> = std::env::args().collect();
let start = Date::parse_iso(&args[1]).expect("start date");
let days: i32 = args[2].parse().expect("days");
for jur in JURISDICTIONS.iter().chain(CALENDARS.iter()) {
let men = menologion::for_jurisdiction(jur.tradition, jur.menaia);
for n in 0..days {
let d = describe_with(start + n, jur, &men);
println!("{}", serde_json::to_string(&d.to_json()).unwrap());
}
}
}