nuance_DISTANCE

Amount of space between two things or people.

Sample language

  • eighteen inches
  • two and a half meters
  • more than three km
  • file miles further
  • far

Examples

Responses for the above samples are shown below.

Example: eighteen inches

{
     "nuance_DISTANCE_ABS": {
         "nuance_UNIT": "in",
         "nuance_NUMBER": {
             "nuance_CARDINAL_NUMBER": 18
         }
     }
}

Example: two and a half meters

{
  "nuance_DISTANCE_ABS": {
     "nuance_UNIT": "m",
     "nuance_NUMBER": {
         "nuance_DOUBLE": 2.5
     }
  }
}

Example: more than three km

{
  "nuance_DISTANCE_REL": {
     "nuance_DISTANCE_ABS": {
       "nuance_UNIT": "km",
       "nuance_NUMBER": {
         "nuance_CARDINAL_NUMBER": 3
        }
     },
     "nuance_MODIFIER": "GT"
  }
}

Example: five miles further

{
     "nuance_DISTANCE_REL": {
         "nuance_DISTANCE_ABS": {
             "nuance_UNIT": "mi",
             "nuance_NUMBER": {
                 "nuance_CARDINAL_NUMBER": 5
             }
         },
         "nuance_MODIFIER": "INC"
     }
}

Example: far

{
     "nuance_DISTANCE_REL": {
         "nuance_MODIFIER": "FAR"
     }
}

New for v9.x and v10.x

Example: 100 millimeters

{
    "nuance_DISTANCE_ABS": {
        "nuance_UNIT": "mm",
        "nuance_NUMBER": {
            "nuance_CARDINAL_NUMBER": 100
        }
    }
}

Example: -5.5 mm

{
    "nuance_DISTANCE_ABS": {
        "nuance_UNIT": "mm",
        "nuance_NUMBER": {
            "nuance_DOUBLE": -5.5
        }
    }
}

Numeric value range

<= 99,999,999

Changes between 6.x and 9.x for nuance_DISTANCE

nuance_NUMBER now returns, instead of a number or string, either:

Example: “two and a half meters”

  • 6.x: {"nuance_NUMBER":2.5,"nuance_UNIT":"m"}
  • 9.x: {"nuance_NUMBER":{"nuance_DOUBLE":2.5},"nuance_UNIT":"m"}

Schema

{
     "$schema": "http://json-schema.org/draft-04/schema#",
     "type": "object",
     "properties": {
         "nuance_DISTANCE": {
             "type": "object",
             "properties": {
                 "oneOf": [{
                         "nuance_DISTANCE_ABS": {
                             "type": "object",
                             "properties": {
                                 "nuance_UNIT": {
                                     "type": "string",
                                     "pattern": "[km|m|cm|mm|mi|yd|ft|in]"
                                 },
                                 "nuance_MODIFIER": {
                                     "type": "string",
                                     "pattern": "fuzzy"
                                 },
                                 "nuance_NUMBER": {
                                     "type": "object",
                                     "properties": {
                                         "oneOf": [{
                                                 "nuance_CARDINAL_NUMBER": {
                                                     "anyOf": [{
                                                             "type": "number"
                                                         }, {
                                                             "type": "string"
                                                         }
                                                     ]

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

                                                 }
                                             }
                                         ]
                                     }

                                 }
                             }
                         }
                     }, {
                         "nuance_DISTANCE_REL": {
                             "type": "object",
                             "properties": {
                                 "nuance_DISTANCE_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": "[km|m|cm|mm|mi|yd|ft|in]"
                                         }
                                     },
                                     "nuance_MODIFIER": {
                                         "type": "string",
                                         "pattern": "[GT|LT|GE|LE|EQ|INC|FAR|CLOSE]"
                                     }
                                 }
                             },
                             "required": "nuance_MODIFIER"
                         }
                     }
                 ]
             }
         }
     },
     "additionalProperties": false
}