NAME

Time::Keeper::Natural::Match - what a text named, and what was filled in

VERSION

Version 0.08

SYNOPSIS

my $m = Time::Keeper::Natural->new(zone => 'Europe/London')->match('next Tuesday at 3 pm');
$m->value;        # 2026-10-20T15:00:00+01:00
$m->kind;         # point
$m->precision;    # hour
$m->assumed;      # ('zone')

DESCRIPTION

A natural phrase leaves things out: "15 October" has no year, "next month" names a period and not an instant, "Tuesday" has no direction. A Match holds the value read and a list of what was assumed to make it one. It is made by "match" in Time::Keeper::Natural and its three siblings and never by hand, and it cannot be changed.

METHODS

value

The Time::Keeper value, Time::Keeper::Date or Time::Keeper::Duration read; for an interval, its start.

kind

point (from match), date (match_date), duration (match_duration) or interval (match_interval).

to

An interval's end; undef for the other kinds. (end is where the text ends.)

precision

The smallest field the text named: year, quarter, month, week, day, hour, minute, second, or a fraction of one; none for a duration. "next month" is month, "next Tuesday at 3 pm" hour, "15:30" minute, "now" second. An interval's is its start's.

assumed

What was filled in, as a list of fixed strings, empty when the text left nothing out:

year             a date with no year took the anchor's (or prefer's)
month            a day with no month ("the 15th") took the anchor's (or prefer's)
century          a two-digit year took the nearest century
date             a time with no date is on the anchor's day
time             a day named without a time is its first moment
period start     a period longer than a day is its first moment
weekday next     a bare weekday is the coming one
weekday last     ... or, under prefer => 'past', the last one
direction        a phrase with two meanings took prefer's side
bare_hour am     a bare hour in a twelve-hour locale, by the option
bare_hour pm
bare_hour next
zone             the text named no zone; the parser's was used

assumptions

Time::Keeper::Natural::Match->assumptions;

That list, the whole of it, in that order. A Match never carries another.

text

The text as given (for find, the whole text the mention is in).

start

end

Where in the text what was read begins and ends, in characters: the text without its outer whitespace, or for find the mention.

locale

The locale whose words were read.

anchor

The anchor the text was read against.

SEE ALSO

Time::Keeper::Natural.

AUTHOR

LNATION <email@lnation.org>

LICENSE AND COPYRIGHT

This software is Copyright (c) 2026 by LNATION.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)