=head1 NAME

DateTime::Format::Natural::Lang::Authoring - Authoring the language sets

=head1 DESCRIPTION

Whenever a language is provided via the C<lang> parameter to 
C<DateTime::Format::Natural's> C<parse_datetime>, C<parse_datetime> 
tries to load, for example, C<DateTime::Format::Natural::Lang::EN> 
for the english language.

=head1 STRUCTURE

The header should look as following:

 package DateTime::Format::Natural::Lang::EN;

 use strict;
 use warnings;

 use base qw(Exporter);

 our $VERSION = '0.1';

 our (@EXPORT, %data_weekdays, %data_months, %main, %ago, %now, 
     %daytime, %months, %at, %number, %this_in, %next, %last, %day, 
     %setyearday);

 @EXPORT = qw(%data_weekdays %data_months %main %ago %now %daytime 
             %months %number %at %this_in %next %last %day %setyearday);

Substitute C<EN> with the appropriate language code. Use C<$VERSION = '0.1'>
if it's a initial release, otherwise replace it with your custom version number.

 {
     my $i = 1;

     %data_weekdays = map {  $_ => $i++ } qw(Monday Tuesday Wednesday Thursday
                                            Friday Saturday Sunday);
     $i = 1;

     %data_months = map { $_ => $i++ } qw(January February March April
                                         May June July August September
                                         October November December);
 }

Replace C<%data_weekdays> with the weekdays in your language chosen.
The same with C<%data_months> concerning months.

 %main = ('second'         => qr/^second$/i,
          'ago'            => qr/^ago$/i,
          'now'            => qr/^now$/i,
          'daytime'        => qr/^(?:morning|afternoon|evening)$/i,
          'months'         => [qw(in this)],
          'at_intro'       => qr/^(\d{1,2})(\:\d{2})?(am|pm)?|(noon|midnight)$/i,
          'at_matches'     => [qw(day in month)],
          'number_intro'   => qr/^(\d{1,2})(?:st|nd|rd|th)? ?$/i,
          'number_matches' => [qw(day week month in)],
          'weekdays'       => qr/^(?:this|next|last)$/i,
          'this_in'        => qr/^(?:this|in)$/i,
          'next'           => qr/^next$/i,
          'last'           => qr/^last$/i,
         );

This is the hash with contains the regular expressions for the C<parse_datetime()>
routine in C<DateTime::Format::Natural>.

 %ago = ('hour'  => qr/^hour(?:s)?$/i,
         'day'   => qr/^day(?:s)?$/i,
         'week'  => qr/^week(?:s)?$/i,
         'month' => qr/^month(?:s)?$/i,
         'year'  => qr/^year(?:s)?$/i,
        );

C<%ago> contains the regular expressions for strings such as 
"1 hour ago", "10 weeks ago" & "3 years ago".

 %now = ('day'    => qr/^day(?:s)?$/i,
         'week'   => qr/^week(?:s)?$/i,
         'month'  => qr/^month(?:s)?$/i,
         'year'   => qr/^year(?:s)?$/i,
         'before' => qr/^before$/i,
         'from'   => qr/^from$/i,
         );

C<%now> contains the regular expressions for strings such as
"1 day before now" , "4 months from now" & "3 years from now".

 %daytime = ('tokens'     => [ qr/\d/, qr/^in$/i, qr/^the$/i ],
             'morning'    => qr/^morning$/i,
             'afternoon'  => qr/^afternoon$/i,
             );

C<%daytime> contains the regular expressions for strings such as
"7 in the morning" & "4 in the afternoon".

 %months = ('number' => qr/^(\d{1,2})(?:st|nd|rd|th)? ?$/i);

C<%months> contains the regular expression for matching
days within a month.

 %number = ('month'  => qr/month(?:s)/i,
            'hour'   => qr/hour(?:s)/i,
            'before' => qr/before/i,
            'after'  => qr/after/i,
           );

C<%number> contains the regular expressions for strings such as
"7 hours before" & "1 month after".

 %at = ('noon'     => qr/noon/i,
        'midnight' => qr/midnight/i,
       );

C<%at> contains the regular expressions for strings such as
"noon" & "midnight".

 %this_in = ('hour'   => qr/hour(?:s)/i,
             'week'   => qr/^week$/i,
             'number' => qr/^(\d{1,2})(?:st|nd|rd|th)?$/i,
            );

C<%this_in> contains the regular expressions for strings such as
"in 1 hours" & "this week".

 %next = ('week'   => qr/^week$/i,
          'day'    => qr/^day$/i,
          'month'  => qr/^month$/i,
          'year'   => qr/^year$/i,
          'number' => qr/^(\d{1,2})(?:st|nd|rd|th)$/,
         );

C<%next> contains the regular expressions for strings such as
"next week", "next day", "next month" & "next year".

 %last = ('week'   => qr/^week$/i,
          'day'    => qr/^day$/i,
          'month'  => qr/^month$/i,
          'year'   => qr/^year$/i,
          'number' => qr/^(\d{1,2})(?:st|nd|rd|th)$/,
          );

C<%last> contains the regular expressions for strings such as
"last week", "last day", "last month" & "last year".

 %day = ('init'         => qr/^(?:today|yesterday|tomorrow)$/i,
         'yesterday'    => qr/yesterday/i,
         'tomorrow'     => qr/tomorrow/i,
         'noonmidnight' => qr/^noon|midnight$/i,
         );

C<%day> contains the regular expressions for strings such as
"yesterday", "tomorrow", "noon" & "midnight".

 %setyearday = ('day' => qr/^day$/i,
                'ext' => qr/^(\d{1,3})(?:st|nd|rd|th)$/,
               );

C<%setyearday> sets the year day.

=head1 SEE ALSO

L<DateTime>, L<Date::Calc>, L<http://datetime.perl.org/>

=head1 AUTHOR

Steven Schubiger <schubiger@cpan.org>

=head1 LICENSE

This program is free software; you may redistribute it and/or
modify it under the same terms as Perl itself.

See L<http://www.perl.com/perl/misc/Artistic.html>

=cut
