diff --git a/README.md b/README.md index cd12a3a..7856998 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,11 @@ its **beginning**, so `Reminisc.`, `Reminisc:` and `Reminiscere` all mean the sa Monday and 3 is Tuesday. A feria outside 1 to 7 is refused. * `Whit Monday`, `Easter Tuesday`, `Ostermontag` and `Pfingstdienstag` are also understood, with the weekday written as part of the word or as a separate word. -* `Feria secunda`, `Fer. tertia` spell the number out; `prima` to `quarta` are understood. +* `Feria secunda`, `Fer. tertia` spell the number out; `prima` to `septima` are understood. +* With a feast that is not a Sunday, the feria names that feast's own weekday, where 1 is + Sunday: `Feria 6 in Parasceve` is Good Friday and `Feria V in Coena Domini` is Maundy + Thursday. Nothing is added to the date. The number is checked instead, so + `Fer. 2. Ascens.` is refused, because Ascension is a Thursday. **Days of a German feast:** Easter, Whitsun and Christmas were kept over several days, and German registers count them: diff --git a/pyproject.toml b/pyproject.toml index 54a567e..944c051 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "feastdate" -version = "1.0.5" +version = "1.0.6" description = "Convert church-year feast names from old parish registers (Dom. Palm. 1656) into calendar dates, Julian or Gregorian." readme = "README.md" license = { file = "LICENSE" } diff --git a/src/feastdate/__init__.py b/src/feastdate/__init__.py index 5bdab9f..de7568a 100644 --- a/src/feastdate/__init__.py +++ b/src/feastdate/__init__.py @@ -9,7 +9,7 @@ g2o, greg_easter, j2o, julian_easter, o2g, o2j, resolve, show, to_ord, ) -__version__ = '1.0.5' +__version__ = '1.0.6' __all__ = [ 'feast_date', 'resolve', 'show', 'FeastError', diff --git a/src/feastdate/core.py b/src/feastdate/core.py index 168d689..fb5800d 100644 --- a/src/feastdate/core.py +++ b/src/feastdate/core.py @@ -234,6 +234,7 @@ def show(o, cal): ADV = ('advent', 'adv') EPIPH = ('epiph',) FERIA = ('feria', 'fer') +FERIA_DAY = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] # Weekday words English transcriptions use after a feast name: `Whit Monday`. WEEKDAY_WORDS = {'monday': 1, 'tuesday': 2, 'montag': 1, 'dienstag': 2} # Weekday words that only say which day the feast fell on. The answer must agree. @@ -265,7 +266,8 @@ def show(o, cal): FEAST_DAYS = 3 # the most days any feast was kept; 'letzter' is the third # Ordinals written out. The register writes `der dritte Ostertag`, `Feria secunda`. ORD_WORDS = [(r'(?:erst|zweit|dritt|viert)(?:e|er|en|es|em)?', ('erst', 'zweit', 'dritt', 'viert')), - (r'(?:prim|secund|terti|quart)(?:a|o|ae|am|us|um|i)?', ('prim', 'secund', 'terti', 'quart')), + (r'(?:prim|secund|terti|quart|quint|sext|septim)(?:a|o|ae|am|us|um|i)?', + ('prim', 'secund', 'terti', 'quart', 'quint', 'sext', 'septim')), (r'(?:first|second|third|fourth)', ('first', 'second', 'third', 'fourth'))] LAST_RE = r'letzt(?:e|er|en|es|em)?' # Words that connect a feast name to the rest of the entry and add nothing to the date. @@ -500,7 +502,13 @@ def refuse_unless(ok, why): extra = 0 if feria: refuse_unless(kind == 'easter', 'feria counts from a movable feast') - extra = n - 1 # feria 2 = Monday, 3 = Tuesday + if off % 7: + # A weekday feast: `Feria 6 in Parasceve` is Good Friday itself. The number + # names the feast's own weekday (feria 1 = Sunday), so it is a check. + refuse_unless((n - 2) % 7 == o % 7, 'feria %d does not fall on %s, a %s' + % (n, hit, FERIA_DAY[o % 7])) + else: + extra = n - 1 # feria 2 = Monday, 3 = Tuesday elif tag and n is not None: refuse_unless((kind, key) in DAY_FEASTS, 'only Ostertag, Pfingsttag and Weihnachtstag count their days') diff --git a/tests/test_feastdate.py b/tests/test_feastdate.py index a11ecb3..59e5239 100644 --- a/tests/test_feastdate.py +++ b/tests/test_feastdate.py @@ -115,6 +115,10 @@ def test_the_1700_switch(): ('Fer. 9. Pasch. 1680', '^feria counts the days of the week, 1 to 7, not 9'), ('Fer. 0. Pent. 1680', '^feria counts the days of the week, 1 to 7, not 0'), ('Fer. 8. Trin. 1680', '^feria counts the days of the week, 1 to 7, not 8'), + # With a weekday feast the feria names the feast's own weekday, not an offset (#3). + ('Fer. 2. Ascens. 1680', '^feria 2 does not fall on ascens, a Thursday'), + ('Feria 2 in Parasceve 1680', '^feria 2 does not fall on parasceve, a Friday'), + ('Feria 6 in Coena Domini 1680', '^feria 6 does not fall on coena, a Thursday'), ]) def test_refused(bad, why): # Anchored on each branch's own wording: the catch-all quotes the input back, so a @@ -283,6 +287,12 @@ def test_cal_of_year_answers_for_the_day(): ('2. Christtag 1740', 'Mon 26 Dec 1740 (Gregorian)'), ('Feria secunda Paschatos 1740', 'Mon 18 Apr 1740 (Gregorian)'), ('Fer. tertia Pent. 1740', 'Tue 7 Jun 1740 (Gregorian)'), + # A weekday feast: the feria is the feast's own weekday and adds nothing (#3). + ('Feria 6 in Parasceve 1680', 'Fri 9 Apr 1680 (Julian)'), + ('Feria sexta in Parasceve 1680', 'Fri 9 Apr 1680 (Julian)'), + ('Feria V in Coena Domini 1680', 'Thu 8 Apr 1680 (Julian)'), + ('Feria quinta in Coena Domini 1680', 'Thu 8 Apr 1680 (Julian)'), + ('Fer. 5. Ascens. 1680', 'Thu 20 May 1680 (Julian)'), ]) def test_day_of_the_feast(text, want): assert feast_date(text) == want