Page Summary
-
DateTimeGranularityis an enum that defines the precision of a timestamp extracted from text. -
It specifies how precise a
DateTimeEntityis, ranging from unknown to specific seconds. -
Examples of granularity include 'day' for "tomorrow" and 'minute' for "12:51".
-
This enum is crucial for understanding the level of detail associated with extracted time information.
DateTimeGranularity
enum DateTimeGranularity : Int@enum DateTimeGranularity The precision of a timestamp that was extracted from text.
For example, “tomorrow” has the granularity .day, while “12:51” has the granularity .minute.
-
The granularity of the
DateTimeEntityis unknown.Declaration
Swift
case unknown = 0 -
The
DateTimeEntityis precise to a specific year.Declaration
Swift
case year = 1 -
The
DateTimeEntityis precise to a specific month.Declaration
Swift
case month = 2 -
The
DateTimeEntityis precise to a specific week.Declaration
Swift
case week = 3 -
The
DateTimeEntityis precise to a specific day.Declaration
Swift
case day = 4 -
The
DateTimeEntityis precise to a specific hour.Declaration
Swift
case hour = 5 -
The
DateTimeEntityis precise to a specific minute.Declaration
Swift
case minute = 6 -
The
DateTimeEntityis precise to a specific second.Declaration
Swift
case second = 7