---
title: "Interpreter"
language: "en"
type: "Symbol"
summary: "Interpreter[form] represents an interpreter object that can be applied to an input to try to interpret it as an object of the specified form. Interpreter[form, test] returns the interpreted object only if applying test to it yields True; otherwise it returns a Failure object. Interpreter[form, test, fail] returns the result of applying the function fail if the test fails."
keywords: 
- translation
- string interpretation
- string formats
- parsing
- string recognition
- string grammar
- smart fields
- smart forms
- NLU
- natural language understanding
- NLP
- syntax
- input formats
canonical_url: "https://reference.wolfram.com/language/ref/Interpreter.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Setting Up Input Interpreters"
    link: "https://reference.wolfram.com/language/guide/InterpretingStrings.en.md"
  - 
    title: "Converting between Expressions & Strings"
    link: "https://reference.wolfram.com/language/guide/ConvertingBetweenExpressionsAndStrings.en.md"
  - 
    title: "Date & Time"
    link: "https://reference.wolfram.com/language/guide/DateAndTime.en.md"
  - 
    title: "Free-Form & External Input"
    link: "https://reference.wolfram.com/language/guide/FreeFormAndExternalInput.en.md"
  - 
    title: "Text Manipulation"
    link: "https://reference.wolfram.com/language/guide/ProcessingTextualData.en.md"
  - 
    title: "String Manipulation"
    link: "https://reference.wolfram.com/language/guide/StringManipulation.en.md"
  - 
    title: "Creating Form Interfaces & Apps"
    link: "https://reference.wolfram.com/language/guide/CreatingFormsAndApps.en.md"
  - 
    title: "Creating Instant APIs"
    link: "https://reference.wolfram.com/language/guide/CreatingAnInstantAPI.en.md"
  - 
    title: "Geographic Data & Entities"
    link: "https://reference.wolfram.com/language/guide/GeographicData.en.md"
  - 
    title: "Knowledge Representation & Access"
    link: "https://reference.wolfram.com/language/guide/KnowledgeRepresentationAndAccess.en.md"
  - 
    title: "Locations, Paths, and Routing"
    link: "https://reference.wolfram.com/language/guide/LocationsPathsAndRouting.en.md"
  - 
    title: "WDF (Wolfram Data Framework)"
    link: "https://reference.wolfram.com/language/guide/WDFWolframDataFramework.en.md"
  - 
    title: "Text Normalization"
    link: "https://reference.wolfram.com/language/guide/TextNormalization.en.md"
  - 
    title: "Programmable Linguistic Interface"
    link: "https://reference.wolfram.com/language/guide/ProgrammableLinguisticInterface.en.md"
  - 
    title: "External Interpreted Language Interfaces"
    link: "https://reference.wolfram.com/language/guide/ExternalInterpretedLanguageInterfaces.en.md"
  - 
    title: "Linguistic Data"
    link: "https://reference.wolfram.com/language/guide/LinguisticData.en.md"
related_functions: 
  - 
    title: "SemanticInterpretation"
    link: "https://reference.wolfram.com/language/ref/SemanticInterpretation.en.md"
  - 
    title: "GrammarToken"
    link: "https://reference.wolfram.com/language/ref/GrammarToken.en.md"
  - 
    title: "ToExpression"
    link: "https://reference.wolfram.com/language/ref/ToExpression.en.md"
  - 
    title: "ImportString"
    link: "https://reference.wolfram.com/language/ref/ImportString.en.md"
  - 
    title: "SemanticImportString"
    link: "https://reference.wolfram.com/language/ref/SemanticImportString.en.md"
  - 
    title: "Entity"
    link: "https://reference.wolfram.com/language/ref/Entity.en.md"
  - 
    title: "DateObject"
    link: "https://reference.wolfram.com/language/ref/DateObject.en.md"
  - 
    title: "APIFunction"
    link: "https://reference.wolfram.com/language/ref/APIFunction.en.md"
  - 
    title: "FormFunction"
    link: "https://reference.wolfram.com/language/ref/FormFunction.en.md"
  - 
    title: "$InterpreterTypes"
    link: "https://reference.wolfram.com/language/ref/$InterpreterTypes.en.md"
  - 
    title: "Classify"
    link: "https://reference.wolfram.com/language/ref/Classify.en.md"
  - 
    title: "TextCases"
    link: "https://reference.wolfram.com/language/ref/TextCases.en.md"
---
# Interpreter  Listing of Interpreter Types »

Interpreter[form] represents an interpreter object that can be applied to an input to try to interpret it as an object of the specified form. 

Interpreter[form, test] returns the interpreted object only if applying test to it yields True; otherwise it returns a Failure object.

Interpreter[form, test, fail] returns the result of applying the function fail if the test fails.

## Details and Options

* ``Interpreter[…][input]`` applies the interpreter to a particular input, which is typically a string.

* Possible ``form`` specifications include:

|                                        |                                                           |
| -------------------------------------- | --------------------------------------------------------- |
| "Expression"                           | any Wolfram Language expression                           |
| "HeldExpression"                       | expression to be returned held                            |
| "InactiveExpression"                   | expression to be returned inactivated                     |
| "SemanticExpression"                   | expression derived semantically from free-form input      |
| "Number"                               | any number in a standard format                           |
| "SemanticNumber"                       | number derived semantically (e.g. "half")                 |
| "ComputedNumber"                       | number derived by computation (e.g. "2+2")                |
| "Integer"                              | integer                                                   |
| "SemanticInteger"                      | integer derived semantically (e.g. "six")                 |
| "ComplexNumber"                        | real or complex number                                    |
| "MathExpression"                       | mathematical expression (e.g. "sin(2x)+1")                |
| "MathFormula"                          | mathematical formula (e.g. "2x+3y=0")                     |
| "HeldMathFormula"                      | mathematical formula to be returned held                  |
| "HexInteger"                           | integer in hexadecimal                                    |
| "RomanNumeral"                         | Roman numerals                                            |
| "Boolean"                              | Boolean value (true/false, 1/0, etc. giving True / False) |
| "String"                               | pure string                                               |
| "TextArea"                             | text of any length (rendered in forms as a text area)     |
| "TextLine"                             | single line of text                                       |
| "URLString"                            | URL-encoded string                                        |
| "URL"                                  | correctly formatted URL                                   |
| "URLQueryString"                       | URL query string                                          |
| "SemanticURL"                          | URL derived semantically (e.g. from company name)         |
| "IPAddress"                            | correctly formatted IP address                            |
| "FileName"                             | name of a file on your computer                           |
| "UploadedFile"                         | file to be uploaded to the cloud                          |
| "CachedFile"                           | file to be cached in a temporary directory                |
| "EmailAddress"                         | correctly formatted email address                         |
| "PhoneNumber"                          | correctly formatted phone number                          |
| "Date"                                 | date in any standard format                               |
| "StructuredDate"                       | date obtained from a picker                               |
| "DateTime"                             | date and time                                             |
| "Time"                                 | time of day                                               |
| "ComputedDate", etc.                   | date derived by computation (e.g. "next tuesday")         |
| "Location"                             | anything that yields a geo location                       |
| "GeoCoordinates"                       | geo position specifed as latitude, longitude              |
| "StreetAddress"                        | any standard street address                               |
| "Country"                              | country or country-like territory                         |
| "AdministrativeDivision"               | state, province, county, etc.                             |
| "USState"                              | US state                                                  |
| "USCounty"                             | US county                                                 |
| "Quantity"                             | quantity with units                                       |
| "ComputedQuantity"                     | quantity derived by computation                           |
| "StructuredQuantity"                   | quantity given purely as number followed by unit          |
| "PhysicalQuantity"                     | physical quantity (e.g. "mass")                           |
| "CurrencyAmount"                       | currency amount (e.g. "\$7.50")                           |
| "CurrencyName"                         | name of a currency (e.g. "US dollars")                    |
| "Company"                              | company                                                   |
| "TickerSymbol"                         | financial instrument ticker symbol                        |
| "Image"                                | image                                                     |
| "Color"                                | color in any standard format                              |
| "StructuredColor"                      | color obtained from a picker                              |
| "Sound"                                | sound                                                     |
| "Graphics"                             | vector graphics                                           |
| "entity"                               | any Wolfram Language entity type (e.g. "City")            |
| "entityclass"                          | a class of entities (e.g. "CityClass")                    |
| "format"                               | any standard Wolfram Language import format               |
| Restricted[form, spec]                 | a form restricted in the specified way                    |
| DelimitedSequence[form, …]             | a delimited sequence of forms returned as a list          |
| form1 \| form2 \| …                    | several possible forms, tried in order                    |
| {c1, c2, …}                            | a literal set of choices ci                               |
| {lab1 -> c1, lab2 -> c2, …}              | choices ci with labels labi                               |
| AnySubset[{c1, c2, …}]                 | any subset of the ci                                      |
| CompoundElement[{form1, …}]            | a list of elements specified by the formi                 |
| CompoundElement[<\|key1 -> form1, …\|>] | an association of elements specified by the formi         |
| RepeatingElement[form, …]              | a list of elements all specified by form                  |
| CloudObject[…]                         | a deployed GrammarRules object                            |
| QuantityVariable["pq"]                 | a quantity compatible with the physical quantity pq       |

* ``\$InterpreterTypes`` gives a complete list of possible interpreter types.

* ``Interpreter[…][input]`` returns an interpreted value, ``Missing["NoInput"]`` if ``input`` is effectively blank, or ``Failure[…]``.

* In the case of ``"entity"``, any domain supported by ``EntityValue`` can be used.

* ``Interpreter["format"]["input"]`` is effectively equivalent to ``ImportString["input", "format"]``.

* ``Interpreter[choices]`` allows a list of rules or an association for ``choices``. A pure list of values can also be used when there is no ambiguity.

* ``Interpreter[form, test][input]`` applies ``test`` to the result of interpreting ``input`` using the specified ``form``.

* If the result of applying ``test`` is ``True``, then the interpretation of ``input`` is returned.

* If the result of applying ``test`` is a ``Failure`` object, this object is immediately returned.

* If the result of applying ``test`` is ``False`` or anything else, then in ``Interpreter[form, test, fail][input]`` the result of applying ``fail`` to the interpretation of ``input`` is returned. If no ``fail`` is given, then a ``Failure`` object is returned.

* If ``Interpreter`` directly generates a ``Failure`` object, the following tags are used:

|                         |                                                                      |
| ----------------------- | -------------------------------------------------------------------- |
| "InterpretationFailure" | the string given could not be interpreted in the form specified      |
| "RestrictionFailure"    | interpretation succeeded, but a restriction failed                   |
| "ConditionFailure"      | interpretation and restrictions succeeded, but explicit test failed  |
| "ConnectionFailure"     | required cloud connection could not be made                          |

* ``Interpreter`` supports the following options:

|                    |                    |                                                               |
| ------------------ | ------------------ | ------------------------------------------------------------- |
| AmbiguityFunction  | Automatic          | function to apply to ambiguous semantic results               |
| DateFormat         | \$DateStringFormat | default format to assume for dates                            |
| DigitBlock         | Infinity           | number of digits between breaks to assume                     |
| GeoLocation        | \$GeoLocation      | geo location to assume for semantic interpretation            |
| ImportOptions      | {}                 | options to use when importing data                            |
| NumberPoint        | "."                | string to assume for decimal points                           |
| NumberSeparator    | {",", " "}         | string to assume at breaks between number blocks              |
| NumberSigns        | {"-", ""}          | strings to assume for signs of negative and positive numbers  |
| TimeZone           | \$TimeZone         | time zone to assume for semantic interpretation               |

* ``Interpreter[spec][{input1, input2, …}]`` is equivalent to ``{Interpreter[spec][input1], Interpreter[spec][input2], …}``, except insofar as ``spec`` contains constructs such as ``CompoundElement`` or ``RepeatingElement`` that directly interpret the structure given.

* Interpreter[form]["Subscript[string, 1]"\|"Subscript[string, 2]"\|\[Ellipsis]] yields as a result the interpretation of the first of the Subscript[string, i] that can be interpreted using the specified form.

* Typically, ``Interpreter[form][CloudObject[…]]``**, **``Interpreter[form][File[…]]`` and ``Interpreter[form][URL[…]]`` yield the result of interpreting the contents of the cloud object, file or URL according to the specified form.

* For other expressions, ``Interpreter[form][expr]`` returns ``expr`` if ``expr`` conforms to the specification for ``form``, and returns ``Failure[…]`` otherwise.

---

## Examples (28)

### Basic Examples (8)

Interpret a number in any standard explicit format:

```wl
In[1]:= Interpreter["Number"]["4.5e7"]

Out[1]= 4.5*^7
```

Interpret a number given linguistically:

```wl
In[2]:= Interpreter["SemanticNumber"]["seventy-five"]

Out[2]= 75
```

Flag a failure if the input given is not of the type specified:

```wl
In[3]:= Interpreter["Number"]["January 14"]

Out[3]=
Failure["InterpretationFailure", Association["MessageTemplate" :> Interpreter::number, 
  "MessageParameters" -> Association["Input" -> "January 14"], "Input" -> "January 14", 
  "Type" -> "Number"]]
```

---

Interpret a date, generating a ``DateObject`` :

```wl
In[1]:= Interpreter["Date"]["June 23, 1988"]

Out[1]= DateObject[{1988, 6, 23}, "Day", "Gregorian", -6.]
```

Interpret a city, generating an ``Entity`` object:

```wl
In[2]:= Interpreter["City"]["NYC"]

Out[2]= Entity["City", {"NewYork", "NewYork", "UnitedStates"}]
```

Interpret a university:

```wl
In[3]:= Interpreter["University"]["oxford u."]

Out[3]= Entity["University", "UniversityOfOxfordUnitedKingdom36022"]
```

Interpret a location, returning a ``GeoPosition`` :

```wl
In[4]:= Interpreter["Location"]["eiffel tower"]

Out[4]= GeoPosition[{48.8583, 2.29444}]
```

---

Interpret a list of numbers:

```wl
In[1]:= Interpreter[DelimitedSequence["Number"]]["2,4,5,7,11,15,20"]

Out[1]= {2, 4, 5, 7, 11, 15, 20}
```

---

Interpret a ``File`` object:

```wl
In[1]:= Interpreter["Image"][File["ExampleData/spikey.tiff"]]

Out[1]= [image]
```

---

Interpret a ``URL`` object:

```wl
In[1]:= Interpreter["Sound"][URL["https://www.wolframcloud.com/obj/documentation/car.mp3"]]

Out[1]= Sound[«1»]
```

---

Interpret a number restricted to be between 1 and 10:

```wl
In[1]:= Interpreter[Restricted["Number", {1, 10}]]["6"]

Out[1]= 6
```

If the number is outside the range, a failure is generated:

```wl
In[2]:= Interpreter[Restricted["Number", {1, 10}]]["11"]

Out[2]=
Failure["RestrictionFailure", Association["MessageTemplate" :> Interpreter::numberinterval, 
  "MessageParameters" -> Association["Min" -> "1", "Max" -> "10", "Input" -> "11"], 
  "Interval" -> Interval[{1, 10}], "Input" -> "11", "Type" -> "Number"]]
```

Interpret a city restricted to a geographical region:

```wl
In[3]:= Interpreter[Restricted["City", Entity["Country", "Italy"]]]["london"]

Out[3]=
Failure["RestrictionFailure", Association["MessageTemplate" :> Interpreter::geomember1, 
  "MessageParameters" -> Association["Polygon" -> "Italy", "Input" -> "london"], 
  "Region" -> Entity["Country", "Italy"], "Input" -> "london"]]
```

---

Run a test on the result:

```wl
In[1]:= Interpreter["Number", Positive]["3"]

Out[1]= 3

In[2]:= Interpreter["City", #["Population"] < Quantity[10 ^ 6, "People"]&]["paris"]

Out[2]= Entity["City", {"Paris", "Illinois", "UnitedStates"}]
```

---

Use a custom failure mode when the test doesn't pass:

```wl
In[1]:= Interpreter["Number", OddQ, Style[ToString[#], Blue]&]["-10"]

Out[1]= "Enter a valid value."
```

### Scope (3)

Interpret many types of entities:

```wl
In[1]:= Interpreter["Movie"]["avatar"]

Out[1]= Entity["Movie", "Avatar::y6ws3"]

In[2]:= Interpreter["Airport"]["ORD"]

Out[2]= Entity["Airport", "KORD"]

In[3]:= Interpreter["ZIPCode"]["90210"]

Out[3]= Entity["ZIPCode", "90210"]

In[4]:= Interpreter["Company"]["apple"]

Out[4]= Entity["Financial", "NASDAQ:AAPL"]
```

---

Enable computations:

```wl
In[1]:= Interpreter["ComputedNumber"]["sin(pi/2)"]

Out[1]= 1

In[2]:= Interpreter["ComputedCity"]["most populated city"]

Out[2]= Entity["City", {"Shanghai", "Shanghai", "China"}]

In[3]:= Interpreter["ComputedLocation"]["birth place of Einstein"]

Out[3]= GeoPosition[{48.4, 9.97}]
```

---

Interpret string representations of files:

```wl
In[1]:= Interpreter["JPEG"][Import["ExampleData/ocelot.jpg", "String"]]

Out[1]= [image]
```

### Options (9)

#### AmbiguityFunction (1)

Return all the possible interpretations:

```wl
In[1]:= Interpreter["City", AmbiguityFunction -> All]["Boston"]

Out[1]= AmbiguityList[{Entity["City", {"Boston", "Massachusetts", "UnitedStates"}], Entity["City", {"Boston", "NewYork", "UnitedStates"}], Entity["City", {"Boston", "Lincolnshire", "UnitedKingdom"}], Entity["City", {"Boston", "Georgia", "UnitedStates"}], E ... ew York, USA)"|>, <|"Description" -> "Boston (United Kingdom)"|>, <|"Description" -> "Boston (Georgia, USA)"|>, <|"Description" -> "Boston (Uzbekistan)"|>, <|"Description" -> "Boston (Indiana, USA)"|>, <|"Description" -> "Boston (Philippines)"|>}]

In[2]:= Interpreter["SemanticExpression", AmbiguityFunction -> All]["Boston"]

Out[2]= AmbiguityList[{Entity["City", {"Boston", "Massachusetts", "UnitedStates"}], Entity["City", {"Boston", "NewYork", "UnitedStates"}], Entity["City", {"Boston", "Lincolnshire", "UnitedKingdom"}], Entity["City", {"Boston", "Georgia", "UnitedStates"}], E ... , Davao Oriental, Davao Region, Philippines (an administrative division)"|>, <|"Description" -> "Boston, Lincolnshire, England, United Kingdom (an administrative division)"|>, <|"Description" -> "a surname"|>, <|"Description" -> "a given name"|>}]
```

#### DateFormat (2)

Specify a custom date format:

```wl
In[1]:= Interpreter["StructuredDate", DateFormat -> {"Day", "-", "Month", "-", "Year"}]["9-3-2013"]

Out[1]= DateObject[{2013, 3, 9}, "Day", "Gregorian", -6.]
```

---

Specify multiple date formats to be tried in order:

```wl
In[1]:= Interpreter["StructuredDateTime", DateFormat -> {{"Month", "/", "Day", "/", "Year", " ", "Hour", ":", "Minute"}, {"Year", "-", "Month", "-", "Day", "T", "Hour", ":", "Minute", ":", "Second"}}][{"2020-03-01T23:23:02", "1/22/2020 17:00"}]

Out[1]= {DateObject[{2020, 3, 1, 23, 23, 2.}, "Instant", "Gregorian", 1.], DateObject[{2020, 1, 22, 17, 0}, "Minute", "Gregorian", 1.]}
```

#### DigitBlock (1)

Change the maximum length of blocks of digits between separators:

```wl
In[1]:= Interpreter["Integer", DigitBlock -> 5]["12345,67890"]

Out[1]= 1234567890

In[2]:= Interpreter["Number", DigitBlock -> 2]["1,43.5"]

Out[2]= 143.5
```

#### GeoLocation (1)

Set a location to use for semantic interpretations:

```wl
In[1]:= Interpreter["ComputedQuantity", GeoLocation -> Entity["City", {"CapeTown", "WesternCape", "SouthAfrica"}]]["distance from Princeton, NJ"]

Out[1]= Quantity[12589.2, "Kilometers"]
```

By default, the user's ``\$GeoLocation`` is used:

```wl
In[2]:= Interpreter["ComputedQuantity", GeoLocation -> Automatic]["distance from Princeton, NJ"]

Out[2]= Quantity[717.073, "Miles"]
```

#### NumberPoint (1)

Set a custom decimal point:

```wl
In[1]:= Interpreter["Number", NumberPoint -> "%"]["10%2"]

Out[1]= 10.2
```

#### NumberSeparator (1)

Change the separator between blocks of digits:

```wl
In[1]:= Interpreter["StructuredQuantity", NumberSeparator -> ","]["3,500 Kilometers"]

Out[1]= Quantity[3500, "Kilometers"]
```

#### NumberSigns (1)

Change the signs for negative and positive numbers:

```wl
In[1]:= Interpreter["Number", NumberSigns -> {"neg ", "pos "}]["neg 15"]

Out[1]= -15

In[2]:= Interpreter["Number", NumberSigns -> {"neg ", "pos "}]["pos 5.3e4"]

Out[2]= 53000.
```

#### TimeZone (1)

Set the time zone to use for semantic interpretations:

```wl
In[1]:= Interpreter["ComputedDateTime", TimeZone -> -9]["current time"]

Out[1]= DateObject[{2014, 6, 24}, TimeObject[{3, 35, 41.6195}], TimeZone -> -9.]
```

### Properties & Relations (4)

``Interpreter`` specifications are used to create ``FormObject``, ``FormFunction``, and ``APIFunction`` :

```wl
In[1]:= FormFunction["x" -> "Integer", #x ^ 2&]["x" -> "2"]

Out[1]= 4
```

---

The ``Interpreter`` head is optional, but it can be useful to specify options:

```wl
In[1]:= APIFunction["time" -> Interpreter["DateTime", TimeZone -> -5], #time&]["time" -> "now"]

Out[1]= DateObject[{2014, 6, 18}, TimeObject[{4, 59, 45.0492}, TimeZone -> -5], TimeZone -> -5]
```

---

Use ``RepeatingElement`` and ``CompoundElement`` to interpret complicated structures:

```wl
In[1]:= Interpreter[CompoundElement[<|"numbers" -> RepeatingElement["Integer"], "fruit" -> RepeatingElement[{"apple" -> "pomme", "orange" -> "orange", "grapefruit" -> "pamplemousse"}]|>]][<|"numbers" -> {"1", "14", "-4"}, "fruit" -> {"apple", "pomme", "grapefruit"}|>]

Out[1]= <|"numbers" -> {1, 14, -4}, "fruit" -> {"pomme", "pomme", "pamplemousse"}|>
```

---

``Alternatives`` can also be used to interpret data that can have different shapes:

```wl
In[1]:= Interpreter[CompoundElement[<|"x" -> RepeatingElement["City" | "Country"]|>]][<|"x" -> {"berlin", "portugal", "tegucigalpa"}|>]

Out[1]= <|"x" -> {Entity["City", {"Berlin", "Berlin", "Germany"}], Entity["Country", "Portugal"], Entity["City", {"Tegucigalpa", "FranciscoMorazan", "Honduras"}]}|>

In[2]:= Interpreter[CompoundElement[<|"x" -> RepeatingElement["AmusementPark"]|>]][<|"x" -> {"coliseum" | "disneyland", "six flags" | "central park" }|>]

Out[2]= <|"x" -> {Entity["AmusementPark", "Disneyland::Anaheim::1955"], Entity["AmusementPark", "SixFlagsGreatAmerica::Gurnee::1976"]}|>
```

### Possible Issues (3)

The number and date options are not compatible with semantic interpreters:

```wl
In[1]:= Interpreter["Date", DateFormat -> {"Month", "/", "Day", "/", "Year"}]["10/11/12"]
```

Interpreter::datefmtsemantic: Option DateFormat is incompatible with Date interpreter type. Using StructuredDate.

```wl
Out[1]= DateObject[{12, 10, 11}, "Day"]

In[2]:= Interpreter["SemanticNumber", NumberPoint -> ":"]["10:12"]
```

Interpreter::semanticopt: Option NumberPoint is incompatible with type SemanticNumber and will be ignored.

```wl
Out[2]=
Failure["InterpretationFailure", Association["MessageTemplate" :> Interpreter::semantictype, 
  "MessageParameters" -> Association["Type" -> "number", "Input" -> "10:12"], "Type" -> "Number", 
  "Input" -> "10:12"]]
```

---

If an ``AmbiguityFunction`` is set that is not ``Automatic``, the ``test`` at the second argument is applied to its result, possibly leading to a failure:

```wl
In[1]:= Interpreter["ComputedNumber", Positive, AmbiguityFunction -> All]["log 2"]
```

Interpreter::ambigtest: Warning: when AmbiguityFunction is not Automatic the test is applied to the whole result.

```wl
Out[1]=
Failure["ConditionFailure", Association["MessageTemplate" :> Interpreter::invalid, 
  "MessageParameters" -> Association[]]]

In[2]:= Interpreter["ComputedNumber", Positive]["log 2"]

Out[2]= Log[2]

In[3]:= Interpreter["ComputedNumber", AmbiguityFunction -> All]["log 2"]

Out[3]= AmbiguityList[{Log[2], (Log[2]/Log[10])}, "log", {<|"Description" -> "the natural logarithm", "HeldExpression" -> HoldComplete[Log[2]]|>, <|"Description" -> "the base 10 logarithm", "HeldExpression" -> HoldComplete[Log10[2]]|>}]
```

---

``Interpreter["String"]`` accepts an empty string. This is not true for ``FormFunction``, where the empty string and an empty field are considered equivalent:

```wl
In[1]:= Interpreter["String"][""]

Out[1]= ""

In[2]:=
form = FormFunction[{"a string" -> "String"}, f];
form[{"a string" -> ""}]

Out[2]=
FormFunction[InputForm[FormObject[Association["a string" -> Association["Input" -> "", 
     "Interpreter" -> "String"]], Association["a string" -> Failure["MissingParameter", 
     Association["MessageTemplate" :> Interpreter::required, "MessageParameters" -> 
       Association[]]]]]], f]
```

### Neat Examples (1)

Obtain the ``GeoPosition`` for the White House:

```wl
In[1]:= position = Interpreter["Location"]["White House"]

Out[1]= GeoPosition[{38.8977, -77.0366}]
```

Show it on a map:

```wl
In[2]:= GeoGraphics[GeoMarker@position, ImageSize -> Medium, GeoRange -> Quantity[0.2, "Miles"]]

Out[2]= [image]
```

## See Also

* [`SemanticInterpretation`](https://reference.wolfram.com/language/ref/SemanticInterpretation.en.md)
* [`GrammarToken`](https://reference.wolfram.com/language/ref/GrammarToken.en.md)
* [`ToExpression`](https://reference.wolfram.com/language/ref/ToExpression.en.md)
* [`ImportString`](https://reference.wolfram.com/language/ref/ImportString.en.md)
* [`SemanticImportString`](https://reference.wolfram.com/language/ref/SemanticImportString.en.md)
* [`Entity`](https://reference.wolfram.com/language/ref/Entity.en.md)
* [`DateObject`](https://reference.wolfram.com/language/ref/DateObject.en.md)
* [`APIFunction`](https://reference.wolfram.com/language/ref/APIFunction.en.md)
* [`FormFunction`](https://reference.wolfram.com/language/ref/FormFunction.en.md)
* [`\$InterpreterTypes`](https://reference.wolfram.com/language/ref/$InterpreterTypes.en.md)
* [`Classify`](https://reference.wolfram.com/language/ref/Classify.en.md)
* [`TextCases`](https://reference.wolfram.com/language/ref/TextCases.en.md)

## Related Guides

* [Setting Up Input Interpreters](https://reference.wolfram.com/language/guide/InterpretingStrings.en.md)
* [Converting between Expressions & Strings](https://reference.wolfram.com/language/guide/ConvertingBetweenExpressionsAndStrings.en.md)
* [Date & Time](https://reference.wolfram.com/language/guide/DateAndTime.en.md)
* [Free-Form & External Input](https://reference.wolfram.com/language/guide/FreeFormAndExternalInput.en.md)
* [Text Manipulation](https://reference.wolfram.com/language/guide/ProcessingTextualData.en.md)
* [String Manipulation](https://reference.wolfram.com/language/guide/StringManipulation.en.md)
* [Creating Form Interfaces & Apps](https://reference.wolfram.com/language/guide/CreatingFormsAndApps.en.md)
* [Creating Instant APIs](https://reference.wolfram.com/language/guide/CreatingAnInstantAPI.en.md)
* [Geographic Data & Entities](https://reference.wolfram.com/language/guide/GeographicData.en.md)
* [Knowledge Representation & Access](https://reference.wolfram.com/language/guide/KnowledgeRepresentationAndAccess.en.md)
* [Locations, Paths, and Routing](https://reference.wolfram.com/language/guide/LocationsPathsAndRouting.en.md)
* [WDF (Wolfram Data Framework)](https://reference.wolfram.com/language/guide/WDFWolframDataFramework.en.md)
* [Text Normalization](https://reference.wolfram.com/language/guide/TextNormalization.en.md)
* [Programmable Linguistic Interface](https://reference.wolfram.com/language/guide/ProgrammableLinguisticInterface.en.md)
* [External Interpreted Language Interfaces](https://reference.wolfram.com/language/guide/ExternalInterpretedLanguageInterfaces.en.md)
* [Linguistic Data](https://reference.wolfram.com/language/guide/LinguisticData.en.md)

## Related Links

* [Fast Introduction for Programmers: Interpreters](http://www.wolfram.com/language/fast-introduction-for-programmers/interpreters/)
* [An Elementary Introduction to the Wolfram Language: Natural Language Understanding](https://www.wolfram.com/language/elementary-introduction/35-natural-language-understanding.html)
* [An Elementary Introduction to the Wolfram Language: Creating Websites and Apps](https://www.wolfram.com/language/elementary-introduction/36-creating-websites-and-apps.html)

## History

* [Introduced in 2014 (10.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn100.en.md) \| [Updated in 2015 (10.1)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn101.en.md) ▪ [2016 (11.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn110.en.md)