View Source GoogleApi.ContentWarehouse.V1.Model.NlpSemanticParsingDatetimeFetchedRelativeDateTime (google_api_content_warehouse v0.4.0)

For a more detailed presentation on what's a fetching operation, see go/datetime-meaning-schemas. Examples to illustrate how the proto is used: I. Fetching day-of-weeks: a) query: "1st 2 Mondays of April" proto: ordinal: 1 target {weekday: MONDAY} count: 2 range: {begin {year: RESOLVED_YEAR month: APRIL day: 1} {end {year: RESOLVED_YEAR month: APRIL day: 30} b) query: "1st and last Monday of April" proto: ordinal: 1 ordinal: -1 target {weekday: MONDAY} range: {begin {year: RESOLVED_YEAR month: APRIL day: 1} {end {year: RESOLVED_YEAR month: APRIL day: 30} c) query: "next Monday" proto: ordinal: 1 target {weekday: MONDAY} d) query: "last 2 Mondays" proto: ordinal: -1 count: 2 target {weekday: MONDAY} e) query: "this Monday" proto: ordinal: 0 target {weekday: MONDAY} f) query: "the monday after next" proto: ordinal: 2 target {weekday: MONDAY} g) query: "third Monday in April" proto: ordinal: 3 target {weekday: MONDAY} range: {begin {year: RESOLVED_YEAR month: APRIL day: 1} {end {year: RESOLVED_YEAR month: APRIL day: 30} h) query: "the monday before last" proto: ordinal: -2 target {weekday: MONDAY} i) query: "the second to the last monday in April" proto: ordinal: -2 target {weekday: MONDAY} range: {begin {year: RESOLVED_YEAR month: APRIL day: 1} {end {year: RESOLVED_YEAR month: APRIL day: 30} II. Fetching date/time unit: a) query: "1st 2 weeks of April" proto: ordinal: 1 target {unit: WEEK} count: 2 range: {begin {year: RESOLVED_YEAR month: APRIL day: 1} {end {year: RESOLVED_YEAR month: APRIL day: 30} b) query: "1st and last week of April" proto: ordinal: 1 ordinal: -1 target {unit: WEEK} range: {begin {year: RESOLVED_YEAR month: APRIL day: 1} {end {year: RESOLVED_YEAR month: APRIL day: 30} c) query: "next year" proto: ordinal: 1 target {unit: YEAR} d) query: "last 2 weeks" proto: ordinal: -1 count: 2 target {unit: WEEK} e) query: "this month" proto: ordinal: 0 target {unit: MONTH} f) query: "the week after next" proto: ordinal: 2 target {unit: WEEK} g) query: "third week in April" proto: ordinal: 3 target {unit: WEEK} range: {begin {year: RESOLVED_YEAR month: APRIL day: 1} {end {year: RESOLVED_YEAR month: APRIL day: 30} h) query: "the week before last" proto: ordinal: -2 target {unit: WEEK} i) query: "the second to the last week in April" proto: ordinal: -2 target {unit: WEEK} range: {begin {year: RESOLVED_YEAR month: APRIL day: 1} {end {year: RESOLVED_YEAR month: APRIL day: 30} Next field: 9

Attributes

  • baseType (type: String.t, default: nil) -
  • count (type: integer(), default: nil) - How many to fetch (e.g. [next weekend] vs. [next two weeks])
  • metadata (type: String.t, default: nil) - Can be used to tag relative datetime expressions with metadata information in the grammar.
  • ordinal (type: list(integer()), default: nil) - Encodes expressions like next (+1), last (-1), after next (+2), this (0).
  • range (type: GoogleApi.ContentWarehouse.V1.Model.NlpSemanticParsingDatetimeRange.t, default: nil) - The restriction range on which fetching is operated, e.g., "April" in "first Tuesday in/of April." If this field is missing, the operation is done relative to the base_type (or if not given, to the query's reference datetime). When the fetching operation is performed relative to a reference time point, positive ordinal values represent upcoming instances from the reference point, negative ordinal values represent previous instances from the reference point. Similarly, ordinal=0 represents a reference to the "current instance", which may vary depending on the target. E.g. "this week" is simply defined as the week range that contains the current reference time point, but "this " can be ambiguous and its resolution will depend on language/locale conventions ("this monday" in some languages refers to the closest upcoming instance of Monday, while in other languages it represents the Monday instance within the current week).
  • rangeModifier (type: String.t, default: nil) - Modifier that return the appropriate subrange. For more information, see the description of RangeOfDateTimeModifier. Example: early next week late next Monday
  • relativeRange (type: GoogleApi.ContentWarehouse.V1.Model.NlpSemanticParsingDatetimeResolutionProperties.t, default: nil) - If the underlying range comes from a relative datetime expression, encode the expression here instead.
  • target (type: GoogleApi.ContentWarehouse.V1.Model.NlpSemanticParsingDatetimeTargetToFetch.t, default: nil) - The target to be fetched. This could be a named day-of-week or month (e.g., "Monday", "April"), or a date/time unit (e.g., "day", "week", "month").

Summary

Functions

Unwrap a decoded JSON object into its complex fields.

Types

@type t() ::
  %GoogleApi.ContentWarehouse.V1.Model.NlpSemanticParsingDatetimeFetchedRelativeDateTime{
    baseType: String.t() | nil,
    count: integer() | nil,
    metadata: String.t() | nil,
    ordinal: [integer()] | nil,
    range:
      GoogleApi.ContentWarehouse.V1.Model.NlpSemanticParsingDatetimeRange.t()
      | nil,
    rangeModifier: String.t() | nil,
    relativeRange:
      GoogleApi.ContentWarehouse.V1.Model.NlpSemanticParsingDatetimeResolutionProperties.t()
      | nil,
    target:
      GoogleApi.ContentWarehouse.V1.Model.NlpSemanticParsingDatetimeTargetToFetch.t()
      | nil
  }

Functions

@spec decode(struct(), keyword()) :: struct()

Unwrap a decoded JSON object into its complex fields.