Time-Keeper-Natural

The words people use for a time, "next Tuesday at 3 pm", "in two weeks", "end of
last month", read into Time::Keeper values, relative to a moment called the anchor.

    my $n = Time::Keeper::Natural->new(zone => 'Europe/London', locale => 'en-GB');
    $n->parse('next Tuesday at 3 pm');
    $n->in_locale('fr')->parse('il y a 3 heures');
    $n->parse_duration('1 hour, 30 minutes');
    my ($from, $to) = $n->parse_interval('15–17 Oct 2026');
    $n->parse('3 pm EST');
    $n->parse('the 15th');
    $n->parse('3 days after tomorrow');
    my @found = $n->find('Can we meet next Tuesday at 3 pm, or on the 20th?');

WHAT IT READS

In every one of CLDR's 1,121 locales, whatever Time::Keeper writes there: relative
time ("3 hours ago", "yesterday"), durations ("1 hour, 30 minutes"), intervals
("15–17 Oct 2026"), and the locale's own date and time formats, with their zone
names and digits in any script. The tests prove it by writing each and reading it
back. A zone after a time ("3 pm EST", "15:30 Europe/Paris") and a day written as
an ordinal ("the 15th", "le 1er octobre", in about forty locales) are read too, and
with a calendar option the dates of any of CLDR's seventeen calendars ("4 Heshvan
5787", "令和8年10月15日"), relative phrases counting that calendar's months.
Durations take fractions in the locale's decimal sign ("1.5 hours", "1,5
Stunden"), a day takes a part of it ("tomorrow morning", "demain soir"), and
chains of counts in a language written without spaces may be in words
("二週間三日後").

Where a locale has a word table, also "end of", "start of", "at", "on", "from
... to ...", a duration before or after a point ("3 days after tomorrow"), the
weekend, and ordinal weekdays in the language's own order ("来月の第3金曜日").
A table can also put an inflected form back to CLDR's phrase ("Ende nächsten
Monats"). Tables ship for ar bn de el en es fr hi it ja ko nl pt ru th zh. All but
English are first drafts awaiting a native reader, and each says in its header
what its language does not read.

find returns every time a text mentions, each with its place in the text.

WHAT IT DOES NOT READ

Recurrence, vague words ("soon"), idioms CLDR does not have
("a fortnight"), holidays and business days.

INSTALLATION

Time-Keeper 0.08 or later must be installed first, and a C compiler is needed.

    perl Makefile.PL
    make
    make test
    make install

LICENSE AND COPYRIGHT

This software is Copyright (c) 2026 by LNATION.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)

The locale data and the spellout rules are from the Unicode Common Locale Data
Repository, Copyright (c) 1991-2026 Unicode, Inc., under the Unicode License v3.
