OpenersNotesSection(Spacer1)Details

OpenersPrimaryExamplesSection(Spacer1)Examples  (6)

OpenersExampleSection0(Spacer1)Basic Examples  (6)

Interpret mathematical expressions:

Interpreter["InactiveMathExpression"]["int sin(y)-iy"]

Interpreter["InactiveMathExpression"]["1.4x+3"]

Interpreter["InactiveMathExpression"]["a = b+3"]

Find out Wolfram Language representations of natural language queries:

Interpreter["InactiveMathExpression"]["second derivative of log x"]

No evaluation is attempted when matching the choices:

Interpreter[Restricted["InactiveMathExpression",{{1,2,3,4}}]]["two plus one"]

Interpreter[Restricted["InactiveMathExpression",{{2, Inactivate[2+1]}}]]["two plus one"]

By default, new symbols are created in (RefLink[$Context, paclet:ref/$Context]), but a custom context can be specified:

Interpreter[Restricted["InactiveMathExpression",All,Automatic,Automatic]]["y + 2"]
Context[y]

Interpreter[Restricted["InactiveMathExpression",All,Automatic,"mycontext`"]]["k + 2"]
Context[k]

Specify contexts for the allowed and output symbols:

mycontext`b = 10;
Interpreter[Restricted["InactiveMathExpression",Automatic,{"mycontext`","System`"},"mycontext`"]]["a+b"]
Context[a]

Prevent the creation of any new symbol:

Interpreter[Restricted["InactiveMathExpression",Automatic,Automatic,None]]["3+1"]

Interpreter[Restricted["InactiveMathExpression",Automatic,Automatic,None]]["z+1"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Interpreter, paclet:ref/Interpreter])  ▪  (RefLink[Restricted, paclet:ref/Restricted])  ▪  (RefLink[Failure, paclet:ref/Failure])  ▪  (RefLink[Inactive, paclet:ref/Inactive])  ▪  (RefLink[Inactivate, paclet:ref/Inactivate])}, {Related Interpreter Types:  (RefLink[MathExpression, paclet:ref/interpreter/MathExpression])  ▪  (RefLink[HeldMathExpression, paclet:ref/interpreter/HeldMathExpression])  ▪  (RefLink[MathFormula, paclet:ref/interpreter/MathFormula])  ▪  (RefLink[Expression, paclet:ref/interpreter/Expression])  ▪  (RefLink[WolframLanguageSymbol, paclet:ref/interpreter/WolframLanguageSymbol])  ▪  (RefLink[HeldMathFormula, paclet:ref/interpreter/HeldMathFormula])  ▪  (RefLink[InactiveMathFormula, paclet:ref/interpreter/InactiveMathFormula])  ▪  (RefLink[HeldExpression, paclet:ref/interpreter/HeldExpression])  ▪  (RefLink[InactiveExpression, paclet:ref/interpreter/InactiveExpression])  ▪  (RefLink[SemanticExpression, paclet:ref/interpreter/SemanticExpression])  ▪  (RefLink[HeldSemanticExpression, paclet:ref/interpreter/HeldSemanticExpression])  ▪  (RefLink[InactiveSemanticExpression, paclet:ref/interpreter/InactiveSemanticExpression])  ▪  (RefLink[ComputedWolframLanguageSymbol, paclet:ref/interpreter/ComputedWolframLanguageSymbol])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Setting Up Input Interpreters, paclet:guide/InterpretingStrings])}})}})