# Is there a function to convert an English description to an expression?

I know I can write:

SpokenString[a + b^2]


And then obtain as output:

"a plus b squared"


What about the opposite, something like:

ReadString["a plus b squared"]


And then obtain as output (without access to the internet, e.g., calling Wolfram Alpha):

a + b^2

• – kglr Apr 18 '18 at 22:59
• Yes, found it right after. Changed my question to ask if there is a way to do the reverse without calling WolframAlpha – Luxspes Apr 18 '18 at 23:01
• SpokenString is a great suggestion to go from code -> prose. If you want to go from prose -> code, I recommend checking out inputs in wolframalpha, like wolframalpha.com/input/…. – enano9314 Apr 18 '18 at 23:01
• @Luxspes I unfortunately seemed to have missed your edit by a few minutes. If you don't want to call W|A I am not sure your problem is solvable without MUCH work – enano9314 Apr 18 '18 at 23:02
• if you want to restrict input to a handful of "operators" maybe you could do it. Otherwise to be really general you would pretty much be reinventing alpha. – george2079 Apr 19 '18 at 0:00

Assuming:

without calling Wolfram Alpha

means you just want an in-product approach as opposed to a web based approach, you could use Ctrl+= or the WolframAlpha function. For example:

WolframAlpha["a plus b squared", "MathematicaParse"]


HoldComplete[a + b^2]

If you really mean that you don't want to use anything based on Wolfram|Alpha, then I think you will need to create your own parser.

• I just want to know if a local function to do it exists – Luxspes Apr 19 '18 at 0:02
• @Luxspes Meaning you want a function that you can use without access to the internet? If so, I think you're out of luck. – Carl Woll Apr 19 '18 at 0:29
• Is there a way to be sure? – Luxspes Apr 19 '18 at 1:36