Skip to content

Dates with month and day #41

@willem640

Description

@willem640

Hello,

Thanks for providing this nice python package. While working with HGV EpiDocs from papyri.info, I noticed that some dates included a day and month (such as HGV21/20810.xml, with some even having multiple dates, each with year and month: HGV38/37635.xml).

I'd be happy to make a PR. A few possible solutions come to mind:

  1. Keeping the date as a string and converting to a year (or floating-point year) for functions like EpiDoc.mean_date and EpiDoc.is_after.
  2. Using a package like historicaldate, which supports BC dates, that can also be uncertain or within a range.
  3. Including a custom date class, with year/month/day.
  4. Ignoring the month and day.

Currently, the date will just be None if it's more complex than a single int.

This is one of the offending date records:
20810:

<origDate notBefore="0216-07-25" notAfter="0216-08-28">25. Juli - 28. Aug. 216</origDate>

And one with multiple possible origDates:
37635:

                    <origDate xml:id="dateAlternativeX" notBefore="0644-05" notAfter="0644-06">
                        <precision match="../@notBefore" degree="0.5"/>
                        <certainty locus="value" match="../year-from-date(@notBefore)"/>ca. Mai - Juni 644 (Jahr unsicher)</origDate>
                     <origDate xml:id="dateAlternativeY" notBefore="0659-05" notAfter="0659-06">
                        <precision match="../@notBefore" degree="0.5"/>
                        <certainty locus="value" match="../year-from-date(@notBefore)"/>ca. Mai - Juni 659 (Jahr unsicher)</origDate>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions