"SemanticReal" (Interpreter Type)
Natural-language name of a real number.
Details
- "SemanticReal" can be used in Interpreter and related constructs, including deployed smart form fields.
- Use of "SemanticReal" requires connectivity to the Wolfram Cloud.
Restriction Specifications
-
Restricted["SemanticReal",{{choices1,…}}] one among choices Restricted["SemanticReal",max] a real below max Restricted["SemanticReal",{min,max}] a real between min and max Restricted["SemanticReal",{min,max,s}] a real between min and max, with step s Restricted["SemanticReal", Automatic, n] a real with n-digit precision
Interpretation
- "SemanticReal" yields a Real.
Examples
Basic Examples (3)
Interpreter["SemanticReal"]["3.1415"]Interpreter["SemanticReal"]["3.*^4"]Interpreter["SemanticReal"]["1.23456e3"]Interpret real numbers in natural language:
Interpreter["SemanticReal"]["two thirds"]Interpreter["SemanticReal"]["minus six"]Interpreter[Restricted["SemanticReal", {0, 1}]][{"1/3", "5/3"}]Restrict to multiples of 1/2 between 1 and 4:
Interpreter[Restricted["SemanticReal", {1, 4, .5}]][{"3/2", "15/2"}]Interpreter[Restricted["SemanticReal", Automatic, 10]]["one third"]Otherwise, $MachinePrecision is implied:
Interpreter["SemanticReal"]["one third"]//PrecisionWhen the number contains a Precision or Accuracy, and a precision restriction is also specified, the lower of the two will be applied:
Interpreter[Restricted["SemanticReal", Automatic, 3]]["1.23456789`8"]Interpreter[Restricted["SemanticReal", Automatic, 2]]["1.23456789``10"]Related Guides
History
Introduced in 2015 (10.1)