4 ms·
Discoverability of GUI components is definitely a big advantage of graphical programs. A bit of NLP magic could help. Most CLIs have this at an extremely basic
by LiveTheDream 15y ago
Discoverability of GUI components is definitely a big advantage of graphical programs. A bit of NLP magic could help. Most CLIs have this at an extremely basic level -- invoke the command with invalid arguments and it will print out a short "help" blurb.
Some tools (e.g. git, sbt) take it a step further and will suggest alternatives based on similar commands. 'git sattus' will ask if you mean 'git status', for example.
WolframAlpha has a particularly interesting interface where you basically type natural language and it tries to parse it into a formal language. It then shows you the formal input interpretation (in addition to the output). This lets you immediately see if the program interpreted your command correctly, because a person can understand the formal specification of the command very easily. If you, the person, detect a misunderstanding it is then very simple to update your input so it's parsed correctly the next time.
For example, look at these queries. Note the formal input interpretation of the first, and the "closest interpretation" of the second:
http://www.wolframalpha.com/input/?i=is+10+percent+of+the+population+of+united+states+%3E+25+million%3F http://www.wolframalpha.com/input/?i=is+10+percent+of+the+po...
http://www.wolframalpha.com/input/?i=combinations+of+1%2C+2%2C+3 http://www.wolframalpha.com/input/?i=combinations+of+1%2C+2%...
- pluies 15y agoStrangely enough, WolframAlpha seems to understand your first query but gives the wrong answer nonetheless. "is 10 percent of the population of united states > 25 million?" => WolframAlpha says "false". But the population it uses is 309 million, so 10% of it is 30.9 million, which is actually greater than 25 million. Apparently it's a syntax problem: http://www.wolframalpha.com/input/?i=is+population+of+united+states+%3E+25+million%3F http://www.wolframalpha.com/input/?i=is+population+of+united... False. But surely 309 million is greater than 25 million, right? Wait, 25 million, but it doesn't have any unit. So let's add "people". http://www.wolframalpha.com/input/?i=is+population+of+united+states+%3E+25+million+people%3F http://www.wolframalpha.com/input/?i=is+population+of+united... True. Ah-ah! So let's get back to those 10 percent... http://www.wolframalpha.com/input/?i=is+10+percent+of+the+population+of+united+states+%3E+25+million+people%3F http://www.wolframalpha.com/input/?i=is+10+percent+of+the+po... i.e. your example plus "people". Still says false. http://www.wolframalpha.com/input/?i=is+10+percent+population+of+united+states+%3E+25+million+people%3F http://www.wolframalpha.com/input/?i=is+10+percent+populatio... Finally, it works. But it highlights the fact that your syntax has to be very specific to be understood by Wolfram. Which makes the whole thing very error-prone and not discoverable. (Which is a shame because I love CLIs too!)
- LiveTheDream 15y agoGood catch! Guess we have a ways to go before this sort of system works. The key is having the formal specification unambiguous. I guess this proved the a human cannot, in fact, parse the formal interpretation easily :) Identifying common types of errors (e.g. mismatching units) could strengthen the process by showing the closest interpretation and "did you mean"-style suggestions.