OpenersNotesSection(Spacer1)Details

OpenersPrimaryExamplesSection(Spacer1)Examples  (2)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Interpret integer numbers:

Interpreter["SemanticInteger"]["ten"]

Interpreter["SemanticInteger"]["-15"]

Restrict in a range:

Interpreter[Restricted["SemanticInteger",{1,3}]][{"one", "two","three","four"}]

Restrict to the first five prime numbers:

Interpreter[Restricted["SemanticInteger", {Prime/@Range[5]}]]["five"]

Restrict to odd numbers below 100:

Interpreter[Restricted["SemanticInteger", {1,100,2}]]["seventeen"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Interpreter, paclet:ref/Interpreter])  ▪  (RefLink[SemanticImport, paclet:ref/SemanticImport])  ▪  (RefLink[Restricted, paclet:ref/Restricted])  ▪  (RefLink[Failure, paclet:ref/Failure])  ▪  (RefLink[Integer, paclet:ref/Integer])}, {Related Interpreter Types:  (RefLink[Integer, paclet:ref/interpreter/Integer])  ▪  (RefLink[ComputedInteger, paclet:ref/interpreter/ComputedInteger])  ▪  (RefLink[Digit, paclet:ref/interpreter/Digit])  ▪  (RefLink[Number, paclet:ref/interpreter/Number])  ▪  (RefLink[OrdinalNumber, paclet:ref/interpreter/OrdinalNumber])  ▪  (RefLink[Real, paclet:ref/interpreter/Real])  ▪  (RefLink[ComplexNumber, paclet:ref/interpreter/ComplexNumber])  ▪  (RefLink[HexInteger, paclet:ref/interpreter/HexInteger])  ▪  (RefLink[RomanNumeral, paclet:ref/interpreter/RomanNumeral])  ▪  (RefLink[SemanticNumber, paclet:ref/interpreter/SemanticNumber])  ▪  (RefLink[ComputedNumber, paclet:ref/interpreter/ComputedNumber])  ▪  (RefLink[SemanticReal, paclet:ref/interpreter/SemanticReal])  ▪  (RefLink[ComputedReal, paclet:ref/interpreter/ComputedReal])  ▪  (RefLink[SemanticComplexNumber, paclet:ref/interpreter/SemanticComplexNumber])  ▪  (RefLink[ComputedComplexNumber, paclet:ref/interpreter/ComputedComplexNumber])}})}})

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