Lingua-JA-FindDates

 view release on metacpan or  search on metacpan

lib/Lingua/JA/FindDates.pod  view on Meta::CPAN

returned won't be in the order that they are in the text, but in the
order that they are found by the regular expressions, which means that
in a string with two dates, the callbacks might be called for the
second date before they are called for the first one. Dates which
contain more information, such as a month, day and year, are searched
for before shorter ones, such as a year only or a month and day only.

=item UTF-8 version only

This module only understands Japanese encoded in Perl's internal form
(UTF-8).

=item Trips a bug in Perl 5.10

If you send subsjdate a string which is pure ASCII, you'll get a
stream of warning messages about "uninitialized value". The error
messages are wrong - this is actually a bug in Perl, reported as bug
number 56902
(L<http://rt.perl.org/rt3/Public/Bug/Display.html?id=56902>). But
sending this routine a string which is pure ASCII doesn't make sense
anyway, so don't worry too much about it.

=back

=head1 EXPORTS

This module exports L</subsjdate>, L</kanji2number>,
L</seireki_to_nengo>, L</nengo_to_seireki> and L</regjnums> on
request. The variable L</@jdatere> is also exportable on
request. L</$verbose> is not exportable, since it controls the
module's behaviour.

All the exportable functions and variables can be exported using the
tag C<:all> as in

    use Lingua::JA::FindDates ':all';

=head1 SEE ALSO

=head2 Other modules

=over

=item L<DateTime::Locale::JA>

Minimal selection of Japanese date functions. It's not complete enough
to deal with the full range of dates in actual documents.

=item L<DateTime::Format::Japanese>

This parses Japanese dates. Unlike the present module it claims to
also format them, so it can turn a L<DateTime> object into a Japanese
date, and it also does times. 

=item L<DateTime::Calendar::Japanese::Era>

A full set of Japanese eras.

=item L<Lingua::JA::Moji>

Japanese character transliterations, including wide ascii numerals.

=back

=head2 Online date converter

An online date converter which uses this module may be found at
L<https://www.lemoda.net/japanese/findjdates/index.cgi>.

=head1 DEPENDENCIES

L<Carp> is used to report errors. This module has no dependencies on
non-core modules.

=head1 VARIABLES

=head2 @jdatere

The Japanese date regular expressions are stored in an array
C<@jdatere> containing a pair of a regular expression to match a kind
of date, and a string like "ymdw" which contains letters saying what
to do with captured subexpressions.

The array is ordered from the regular expression with the longest
match (like "year / month / day / weekday") to the shortest (like
"year" only).

The string explains what to do with the captured elements like $1, $2,
etc. from the regular expression. For example, if the first letter is
"y", then $1 is a year in Western format like 2008, or if the third
letter is "w", then $3 is the day of the week, from 1 to 7. The
following elements exist:

=over

=item e

Japanese era (string).

=item j

Japanese year (string representing small number)

=item x

Empty month and day

=item m

The month number (from 1 to 12, 13 for a blank month, 0 for an invalid
month)

=item d

The day of month (from 1 to 31, 32 for a blank day, 0 for an invalid day)

=item w

A weekday (from Monday = 1 to Sunday = 7, zero or undefined for an
invalid weekday)



( run in 1.858 second using v1.01-cache-2.11-cpan-800906f7e73 )