What is the equivalent of typing = at the beginning of a line to specify natural language input in WolframScript?
1 Answer
$\begingroup$
$\endgroup$
4
This can be done by using Interpreter with SemanticExpression:
Interpreter["SemanticExpression"]["population of Switzerland"]
It can also be done using SemanticInterpretation (thanks @Bob Hanlon):
SemanticInterpretation["population of Switzerland"]
-
2$\begingroup$ Or
SemanticInterpretation["population of Switzerland"]
$\endgroup$ Commented May 5, 2020 at 7:09 -
$\begingroup$ @BobHanlon Thanks. Do you know if it is possible to make an alias so there is no need to type the whole function? $\endgroup$– DurandACommented May 5, 2020 at 15:17
-
$\begingroup$
sem[str_String] := SemanticInterpretation[str]
; however, the autocompletion essentially does this. $\endgroup$ Commented May 5, 2020 at 15:21 -
1$\begingroup$ @BobHanlon I don't think there is any autocompletion in the WolframScript command line interpreter. I think your comments are worth a full answer. $\endgroup$– DurandACommented May 5, 2020 at 15:48