3
$\begingroup$

What is the equivalent of typing = at the beginning of a line to specify natural language input in WolframScript?

$\endgroup$

1 Answer 1

3
$\begingroup$

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"]
$\endgroup$
4
  • 2
    $\begingroup$ Or SemanticInterpretation["population of Switzerland"] $\endgroup$
    – Bob Hanlon
    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$
    – DurandA
    May 5, 2020 at 15:17
  • $\begingroup$ sem[str_String] := SemanticInterpretation[str]; however, the autocompletion essentially does this. $\endgroup$
    – Bob Hanlon
    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$
    – DurandA
    May 5, 2020 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.