Setting Up Input Interpreters

The Wolfram Language provides a uniform mechanism for specifying how inputs of different types should be interpreted as Wolfram Language or WDF expressions, for example in forms or APIs. The interpretations can involve either structural or semantic conversions, and the specification of the interpretation can be used to generate interface elements such as input fields for requesting input suitable for interpretation in a form.

Interpreter define how input should be interpreted, either directly or in APIs or forms

"InterpreterType" an Interpreter type expressed in natural language

Arbitrary Inputs & Expressions

"SemanticExpression" any natural language input, interpreted semantically

"Expression" an expression in Wolfram Language syntax

"InactiveExpression" an expression in Wolfram Language syntax, returned inactivated

"HeldExpression" an expression returned unevaluated with HoldComplete

"InactiveSemanticExpression"  ▪  "HeldSemanticExpression"

AmbiguityFunction option for handling ambiguities in semantic interpretation

Strings

"String" pure string, left as a string (deployed as a single-line field)

"TextArea" text string of any length (deployed as a multiline text field)

"TextLine" single-line text string

"URLString" string with URL encoding (e.g. "a+%CE%B1")

Restricted restrict to strings matching a pattern, or with a maximum length

Numbers

"Number" any number in a standard format (e.g. "67", "6.78", "6.78e+10")

"Integer" whole number (with range restricted using Restricted)

"Real" real number in a standard format (e.g. "3.", "1.2e-3")

"Digit" a digit (09)

"SemanticNumber" number derived semantically (e.g. "2.5 million", "three quarters")

"ComputedNumber" number derived by computation (e.g. "2+2", "sqrt(13)")

"SemanticInteger" whole number derived semantically (e.g. "seventy-four")

"RomanNumeral" a Roman numeral (e.g. "MCMXIV")

"OrdinalNumber" an ordinal number (e.g. "third")

NumberPoint option for specifying decimal number point to assume

Restricted restrict range of numbers

Math-Related

"MathExpression" mathematical expression (e.g. "sin(2x)+1")

"MathFormula" mathematical formula (e.g. "2x+3y=0")

"HeldMathExpression"  ▪  "InactiveMathExpression"  ▪  "HeldMathFormula"

"ComplexNumber" complex (or real) number (e.g. "2+i")

Scientific Writing

"TeXExpression" correctly formatted TeX expression

"MathMLExpression" correctly formatted MathML expression

"InactiveTeXExpression"  ▪  "HeldTeXExpression"  ▪  "HeldMathMLExpression"

Web etc. Related

"URL" correctly formatted URL (e.g. "http://www.wolfram.com")

"SemanticURL" semantically derived URL (e.g. "wolfram website")

"IPAddress"  ▪  "URLQueryString"  ▪  "HexInteger"  ▪  "URLString"

Email, Phone Numbers & Credit Cards

"EmailAddress" correctly formatted email address (e.g. "me@example.com")

"PhoneNumber" correctly formatted phone number

"CreditCardNumber" correctly formatted credit card number

Dates & Times

"Date" date in any standard format, disambiguated by geo location

"Time" time of day (defaulting to geo location time zone)

"ComputedDate" date derived by computation (e.g. "next Tuesday")

"DateTime"  ▪  "ComputedDateTime"  ▪  "ComputedTime"

"StructuredDate" date with a particular format (chosen with a date picker on forms)

"UnixTime" Unix time specification, given as a whole number

"ExcelDate" date in the Microsoft Excel standard

"StructuredTime"  ▪  "StructuredDateTime"

"DayOfWeek" a day of the week (e.g. "Thursday")

DateFormat option for specifying date formats to accept

TimeZone option for specifying time zone to assume

Restricted restrict to dates in a certain range

Colors

"Color" color (specified by name, or with a picker in a form)

"ComputedColor" color derived by computation (e.g. "red+blue")

"StructuredColor" color in a structured form (chosen with a picker on forms)

Quantities

"Quantity" quantity with units (e.g. "4.5 km", "10 ft 6 in", "30C", "7 m/s")

"ComputedQuantity" quantity derived by computation (e.g. "6.7GB / 2hrs")

"StructuredQuantity" quantity given specifically as number followed by unit

"PhysicalQuantity" physical quantity (e.g. "mass", "data transfer rate")

"Age" age (e.g. "2 years old", "4.5 months")

"Percent" percentage (e.g. "20%")

"PercentFraction" percentage referring to a baseline (e.g. "2/3")

"HeuristicPercent"  ▪  "ComputedPercent"  ▪  "ComputedPercentFraction"  ▪  ...

Restricted restrict quantities to particular units, unit types, or sizes

Currency

"CurrencyAmount" any standard currency amount (e.g. "$5", "45 pesos", "10.25 GBP")

"CurrencyName" any currency name (e.g. "USD", "US dollars")

"ComputedCurrencyAmount" currency amount derived by computation (e.g. "US debt")

Locations

"Location" anything that yields a geo location (e.g. "eiffel tower")

"GeoCoordinates" latitude, longitude geo coordinates (e.g. "17W 20.6N")

"StreetAddress" street address (e.g. "123 Broadway, NYC")

"ComputedLocation" location derived by computation (e.g. "center of illinois")

Restricted restrict to be within a certain region (e.g. country or lat-long range)

Entities »

"Country" any country or territory (e.g. "USA", "U.S.", "st helena")

"City"  ▪  "USState"  ▪  "ZIPCode"  ▪  "USCounty"  ▪  "SchoolDistrict"  ▪  ...

"Company"  ▪  "University"  ▪  "Language"  ▪  "GivenName"  ▪  "Person"  ▪  ...

"Animal"  ▪  "Chemical"  ▪  "Movie"  ▪  "Religion"  ▪  "FileFormat"  ▪  ...

"Entity" any entity of any type

"EntityType" a type of entity (e.g. "city" or "Movie")

"EntityProperty" a property (e.g. "population")

Restricted restrict to a particular class of entities of a given type

Entity Classes

"CountryClass" a class of countries or territories (e.g. "Europe", "NATO")

"USStateClass"  ▪  "USCountyClass"  ▪  "AdministrativeDivisionClass"  ▪  ...

"ChemicalClass"  ▪  "FinancialIndexClass"  ▪  "BookClass"  ▪  ...

"MountainClass"  ▪  "MovieClass"  ▪  "AstronomicalObjectClass"  ▪  ...

Choices

"Boolean" Boolean value, yielding True/False (e.g. "true"/"false", "y"/"n", "1"/"0")

List, Association one of a set of choices

AnySubset any subset of a set of choices

Sequences

DelimitedSequence sequence of forms delimited by comma, space, etc.

Files

"UploadedFile" file to be uploaded to the cloud (returning the cloud object)

"CachedFile" file to be cached in a temporary directory (returning the file name)

"FileName" name of a file on your computer

"ImportFormatString"  ▪  "ExportFormatString"  ▪  "MIMETypeString"

Non-Textual Input »

"Sound" a sound, potentially requested from a microphone

"Image" an image, potentially requested from a camera

"Graphics" vector graphics

"Barcode" an image interpreted as a barcode or QR code

"GIF"  ▪  "PNG"  ▪  "WAV"  ▪  "CSV"  ▪  "XLS"  ▪  "TeX"  ▪  "KML"  ▪  "SMILES"  ▪  "PLY"  ▪  ...

"Bit"  ▪  "Byte"  ▪  "Integer8"  ▪  "Integer32"  ▪  "Real64"  ▪  ...

Alternative & Combination Inputs

Alternatives () several alternative interpretation forms, tried in order

CompoundElement list or association of types (e.g. {"City", "Country"})

RepeatingElement repeating list of identical types

RectangularRepeatingElement  ▪  SquareRepeatingElement

$InterpreterTypes a list of supported interpreters

Restricted define a restriction on what to accept

Failure representation of an interpretation failure, including typical form field message

Using Input Interpreters

FormObject define the structure of a form with parameters to interpret

FormFunction define a form to evaluate involving parameters

APIFunction define an API with parameters to interpret

EmbedCode create embed code that converts parameters from external environments

Other Input Interpretation Functions »

SemanticInterpretation  ▪  Import  ▪  SemanticImport  ▪  ...

LLM-Based Interpretation »

LLMResourceFunction apply interpretations from the Wolfram Prompt Repository

LLMExampleFunction apply interpretations based on examples

LLMFunction  ▪  LLMPrompt  ▪  LLMTool  ▪  ...