nuance_DURATION

Period of time described in absolute (hours, minutes, seconds, and days) or relative terms (for example, “two hours more”).

See Changes between 6.x and 9.x for nuance_DURATION.

Sample language

  • 7 hours
  • 2.5 hours
  • half an hour
  • more than an hour
  • 15 minutes longer
  • less than thirty minutes
  • around two hours and fifteen minutes
  • a year and a month

Examples

Responses for the above samples are shown below.

Example: 7 hours

{
     "nuance_DURATION_ABS": {
         "nuance_NUMBER": {
             "nuance_CARDINAL_NUMBER": 7
         },
         "nuance_UNIT": "hour"
     }
}

Example: 2.5 hours

{
     "nuance_DURATION_ABS": {
         "nuance_UNIT": "minute",
         "nuance_NUMBER": {
             "nuance_CARDINAL_NUMBER": 150
         }
     }
}

Example: half an hour

{
     "nuance_DURATION_ABS": {
         "nuance_UNIT": "minute",
         "nuance_NUMBER": {
             "nuance_CARDINAL_NUMBER": 30
         }
     }
}

Example: more than an hour

{
  "nuance_DURATION_REL": {
     "nuance_DURATION_ABS": {
       "nuance_NUMBER": {
         "nuance_CARDINAL_NUMBER": 1
       },
       "nuance_UNIT": "hour"
     },
     "nuance_MODIFIER": "GT"
  }
}

Example: 15 minutes longer

{
     "nuance_DURATION_REL": {
         "nuance_DURATION_ABS": {
             "nuance_UNIT": "minute",
             "nuance_NUMBER": {
                 "nuance_CARDINAL_NUMBER": 15
             }
         },
         "nuance_MODIFIER": "INC"
     }
}

Example: less than thirty minutes

{
     "nuance_DURATION_REL": {
         "nuance_DURATION_ABS": {
             "nuance_UNIT": "minute",
             "nuance_NUMBER": {
                 "nuance_CARDINAL_NUMBER": 30
             }
         },
         "nuance_MODIFIER": "LT"
     }
}

Example: around two hours and fifteen minutes

{
     "nuance_DURATION_ABS": {
         "nuance_UNIT": "minute",
         "nuance_NUMBER": {
             "nuance_CARDINAL_NUMBER": 135
             }
         },
         "nuance_MODIFIER": "fuzzy"
}

Example: a year and a month

{
    "nuance_DURATION_ABS": {
        "nuance_NUMBER": {
            "nuance_CARDINAL_NUMBER": 13
        },
        "nuance_UNIT": "month"
    }
}
Example: 2 1/3 hr
{
    "nuance_DURATION_ABS": {
        "nuance_NUMBER": {
            "nuance_DOUBLE": "2 1/3"
        },
        "nuance_UNIT": "hour"
    }
}

Numeric value range

<= 99,999,999

Changes between 6.x and 9.x for nuance_DURATION

nuance_NUMBER now returns, instead of a number, either:

Example: “a year and a month”

  • 6.x: {"nuance_NUMBER":13,"nuance_UNIT":"month"}
  • 9.x: {"nuance_NUMBER":{"nuance_CARDINAL_NUMBER":13},"nuance_UNIT":"month"}

Schema

{
     "$schema": "http://json-schema.org/draft-04/schema#",
     "type": "object",
     "properties": {
         "nuance_DURATION": {
             "type": "object",
             "properties": {
                 "oneOf": [{
                         "nuance_DURATION_ABS": {
                             "type": "object",
                             "properties": {
                                 "nuance_NUMBER": {
                                     "type": "object",
                                     "properties": {
                                         "oneOf": [{
                                                 "nuance_CARDINAL_NUMBER": {
                                                     "anyOf": [{
                                                             "type": "number"
                                                         }, {
                                                             "type": "string"
                                                         }
                                                     ]

                                                 }
                                             }, {
                                                 "nuance_DOUBLE": {
                                                     "anyOf": [{
                                                             "type": "number"
                                                         }, {
                                                             "type": "string"
                                                         }
                                                     ]

                                                 }
                                             }
                                         ]
                                     }

                                 },

                                 "nuance_UNIT": {
                                     "type": "string",
                                     "pattern": "[millisecond|second|minute|hour|day|week|month|year]"
                                 },
                                 "nuance_MODIFIER": {
                                     "type": "string",
                                     "pattern": "[fuzzy]"
                                 }

                             }
                         }
                     }, {
                         "nuance_DURATION_REL": {
                             "type": "object",
                             "properties": {
                                 "nuance_DURATION_ABS": {
                                     "type": "object",
                                     "properties": {
                                         "nuance_NUMBER": {
                                             "type": "object",
                                             "properties": {
                                                 "oneOf": [{
                                                         "nuance_CARDINAL_NUMBER": {
                                                             "anyOf": [{
                                                                     "type": "number"
                                                                 }, {
                                                                     "type": "string"
                                                                 }
                                                             ]

                                                         }
                                                     }, {
                                                         "nuance_DOUBLE": {
                                                             "anyOf": [{
                                                                     "type": "number"
                                                                 }, {
                                                                     "type": "string"
                                                                 }
                                                             ]

                                                         }
                                                     }
                                                 ]
                                             }

                                         },

                                         "nuance_UNIT": {
                                             "type": "string",
                                             "pattern": "[millisecond|second|minute|hour|day|week|month|year]"
                                         }
                                     }
                                 },

                                 "nuance_MODIFIER": {
                                     "type": "string",
                                     "pattern": "[GT|LT|GE|LE|EQ|INC]"
                                 }
                             },
                             "required": "nuance_MODIFIER"
                         }
                     }
                 ]
             }
         }
     },
     "additionalProperties": false
}