I've been playing around with dynamic input fields; here's a basic example, which just consists of an input field where the user can enter a function and then a button that can be clicked to graph the function. What I'm wondering is: is there a way to allow free-form linguistic input to be entered in the input field? Right now, I must enter regular Mathematica syntax like Cos[x] to get a graph, but I'd really like to be able to enter something like "cos x". (Ultimately, I'd like my dynamic module to do more than just graph the function, which is why I don't want to just use Wolfram Alpha directly.)
DynamicModule[{graph, f, button},
graph = Plot[1, {x, 0, 1}, PlotRange -> {0, 0.1}, Axes -> False,
ImageSize -> 480, Background -> White];
f = Cos[x];
button = Button["Graph!",
graph = Plot[f, {x, -3, 3}, ImageSize -> 480, Background -> White];
];
Panel[
Grid[{
{InputField[Dynamic[f]], button},
{Dynamic[graph], SpanFromLeft}},
Spacings -> {2, 1}, Alignment -> {Left, Baseline}
]
]
]
Thanks!