Groups | Search | Server Info | Login | Register


Groups > perl.gedcom > #16

Re: Re-writing Genealogy::Gedcom::Date

Newsgroups perl.gedcom
Message-ID <563A7919.30204@savage.net.au> (permalink)
Date 2015-11-05 08:31 +1100
Subject Re: Re-writing Genealogy::Gedcom::Date
References (2 earlier) <2CDE6E06-706A-4417-AA74-656AE1F63D87@ionescu.de> <561E1A95.3070903@savage.net.au> <D554AC36-4DC2-4FB2-811D-463217200374@caisys.co.uk> <5639D67D.2070507@savage.net.au> <74ED90C8-2E49-4F00-8956-BC63838DFF25@caisys.co.uk>
From ron@savage.net.au (Ron Savage)

Show all headers | View raw


Hi Mike

On 04/11/15 21:30, Mike Elston wrote:
> Hi Ron,
>
> As I said before in another message, your question is the result of confusion between /calendars/ and /names of months/.
>
> There's no such thing as "German republican names" for months, any more than there are "German republican months" (or even "German months"). There are just the German names for the usual months that most of the Western world use, the months of the Julian and Gregorian calendars. Whereas the "French Republican names" are the names of the months of the French Republican calendar.

Thanx for the detail.

The above ("There's no such thing...") is the only thing that matters.

You used 'german_r_month' (orginally, below) and not 'german_month'.
That confused me.

It's a matter of what I put in the grammar, and I've gone with 
'german_month' :-).

I just did not wish to find out one day that I needed both a 
german_month list and a german_r_month list! That would just mean an 
update, but rather worse would be if both existed but the only one I 
implemented had the 'wrong' name.

So, the French calendar escape is 'French r' or '@#dFrench r@', both 
case-insensitive.

Using 'French r' leaves 'French' free for later adoption.

And for German it is 'German' or '@#dGerman@', likewise case-insensitive.

And I /do/ realize the simple (@#d...@-free) versions will presumably 
not be compatible with other software.

[snip]
>>>>
>>>>> german_r_month	~ 'jan' | 'feb' | 'mär' | 'maer' | 'mrz' | 'apr' | 'mai'
>>>>> 		| 'jun' | 'jul' | 'aug' | 'sep' | 'sept' | 'okt'
>>>>> 		| 'nov' | 'dez'

This gives me an opportunity for a progress report:

shell> prove -l t/
t/English.t .. ok
t/French.t ... ok
t/German.t ... ok
All tests successful.
Files=3, Tests=304,  2 wallclock secs ( 0.07 usr  0.00 sys +  1.96 cusr 
  0.03 csys =  2.06 CPU)
Result: PASS

The English tests use both Gregorian and Julian. The French and German 
tests mix their respective calendars with both Gregorian and Julian.

This means there are so far 304 pairs of input and output for you to study.

I'll do Hebrew today or tomorrow. After that, I'll release the module 
since the docs are 98% complete.

Now, from your other message:
 > Ron, it might be helpful if you explained whether you are just aiming 
 > for syntax checking or whether you intend to parse these dates and > 
 > possibly convert them or do other calculations on them. For the > > > 
 > former the concept of different calendars is relatively negligible, > 
 > however for the latter it is a must.

The code parses dates, and accepts the Gedcom defined calendar escapes.

Gedcom mentions the German language but not the German calendar. 
Nevertheless, I have extended the grammar to accept German dates.

The output from the parse() method can be passed into the normalize() 
method which will reconstruct the date input, with various bits 
normalized. E.g. 'Int' or 'Interpreted' comes back as 'INT'.

As for calculations, you'll have to build up a date string from the 
output of parse() and pass that to DateTime (or whatever).

In Perl there is a perhaps-unfortunate plethora of date-oriented 
modules. My module's 'See Also' section lists a few, and has a set of 
links to various articles which mention many others (especially in the 
comments sections of the articles).

-- 
Ron Savage - savage.net.au

Back to perl.gedcom | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re-writing Genealogy::Gedcom::Date ron@savage.net.au (Ron Savage) - 2015-10-14 13:52 +1100
  Re: Re-writing Genealogy::Gedcom::Date mhi@ionescu.de (Michael Ionescu) - 2015-10-14 06:19 +0200
    Re: Re-writing Genealogy::Gedcom::Date ron@savage.net.au (Ron Savage) - 2015-10-14 16:49 +1100
    Re: Re-writing Genealogy::Gedcom::Date ron@savage.net.au (Ron Savage) - 2015-10-14 20:04 +1100
      Re: Re-writing Genealogy::Gedcom::Date mike@caisys.co.uk (Mike Elston) - 2015-10-14 11:05 +0100
        Re: Re-writing Genealogy::Gedcom::Date ron@savage.net.au (Ron Savage) - 2015-10-15 08:47 +1100
          Re: Re-writing Genealogy::Gedcom::Date mike@caisys.co.uk (Mike Elston) - 2015-10-14 23:33 +0100
            Re: Re-writing Genealogy::Gedcom::Date ron@savage.net.au (Ron Savage) - 2015-10-15 10:30 +1100
        Re: Re-writing Genealogy::Gedcom::Date ron@savage.net.au (Ron Savage) - 2015-10-27 08:40 +1100
        Re: Re-writing Genealogy::Gedcom::Date ron@savage.net.au (Ron Savage) - 2015-11-04 20:57 +1100
          Re: Re-writing Genealogy::Gedcom::Date mike@caisys.co.uk (Mike Elston) - 2015-11-04 10:30 +0000
            Re: Re-writing Genealogy::Gedcom::Date ron@savage.net.au (Ron Savage) - 2015-11-05 08:32 +1100
              Re: Re-writing Genealogy::Gedcom::Date ron@savage.net.au (Ron Savage) - 2015-11-07 10:22 +1100
                RE: Re-writing Genealogy::Gedcom::Date john@washburnresearch.org ("John Washburn") - 2015-11-06 20:08 -0600
                Genealogy::Gedcom::Date - Parse dates in French r/German/Gregorian/Hebrew/Julian ron@savage.net.au (Ron Savage) - 2015-11-09 09:34 +1100
              Announce: Genealogy::Gedcom V 0.87 ron@savage.net.au (Ron Savage) - 2015-11-15 16:58 +1100
            Re: Re-writing Genealogy::Gedcom::Date ron@savage.net.au (Ron Savage) - 2015-11-05 08:31 +1100
          Re: Re-writing Genealogy::Gedcom::Date mhi@ionescu.de (Michael Ionescu) - 2015-11-04 13:29 +0100
            Re: Re-writing Genealogy::Gedcom::Date mike@caisys.co.uk (Mike Elston) - 2015-11-04 12:36 +0000

csiph-web