Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wonder if the author of Betty has taken a look at one of the existing Inform (http://inform7.com) interpreter variants used for Interactive Fiction games (what we used to call "text adventures"). They have progressed a lot since the old text adventures of yore, and are now capable of parsing pretty complex English sentences (instead of just "take sword", you can write "examine sword, then take it and give it to the wizard", and the interpreter will even ask you about ambiguities, such as "which sword? the magic sword or the long sword?").

Then again, I'm unsure if the precision needed from command line interfaces can ever be improved with natural language. Natural language is imprecise, ambiguous, redundant, and confusing even to our human interlocutors. Why would we want to interface with computers in English, instead of using a synthetic and concise made-up language? I'm talking specifically about the command line, which is for power users anyway.

(A perfectly valid answer is "because it was fun to write Betty, and that's its own reward", of course).



No, I wasn't aware of that, but that is interesting.

Betty just grew out of my cheat sheet of commands. I was tired of repeatedly looking up things in my cheat sheet or Google, and decided to make this.

The current project has a limited number of commands, but I am hoping that by making it public, others will issue pull requests with things they'd want to use.

Its current state is command line only, which is for power users. But thinking ahead, on the roadmap I wrote that by the time it reaches v1.0, I'd like it to be extensible. This means it can be used from text-to-speech apps or whatever. Some futuristic use cases: I'm sitting on my bed, with my computer on my desk, and say "Betty: next song" and it just works. Or I'm running on my treadmill, talking aloud: I'd say "Betty: open the New York Times in Chrome" then "Betty: read me this article" and it just works. That'd be cool. I don't know specifically how to do everything I'd want to do, but those are the sorts of far future things that would be cool. In its current implementation, it's mainly for not having to keep looking up commands or options.


That would be cool indeed and I hope my comment didn't sound too negative. And you should definitely take a look at Inform (and similar), it's amazing what they can do. I think some interpreters are open source (edit: it seems it's not, I remembered incorrectly).


Ironically, with version 7, Inform itself switched to natural language syntax. The following is valid Inform 7 source code:

`The iron-barred gate is a door. It is north of the Drawbridge and south of the Entrance Hall. It is closed and openable. Before entering the castle, try entering the gate instead. Before going inside in the Drawbridge, try going north instead. Understand "door" as the gate.`

However, what makes a command like "examine sword, then take it and give it to the wizard" complex is not the parsing, but the world model. What if examining the sword reveals an engraving saying "Never hand this to a wizard"? What happens to giving if taking fails? What if the wizard himself is holding the sword? What if he attacks anyone holding a weapon? Etc.

Writing a natural language command line interface seems a lot more straightforward.


Unfortunately, as I understand it, while the "old" v6 toolset is open, the "in" tool that takes "regular" text and turns it into v6 "code" is gratis, but not open sourced:

https://groups.google.com/forum/#!topic/rec.arts.int-fiction...

Some more on how inform7 differs from more traditional interactive fiction systems:

http://www.onlamp.com/pub/a/onlamp/2006/06/08/inside-inform-...

As for this tool: I like it. I like the idea that it's simple, and that the author didn't let details like it being difficult to do "well" or "better" stand in his way. I've thought along the same lines many times, not so much "how did I do _ (solution often involves awk, sort, uniq et al) -- I'm too familiar with the command line for that, but rather: Jeez, you've got a smart phone. The one guaranteed interface that works is audio in/out. How hard could it be to deploy solid limited domain voice control coupled with a dead simple state-machine for doing stuff like "next song", "stop", "play", "accept call".

I wonder if these projects (there must have been projects, right, ever since the first uptake of mp3s) get the first part working, then some moron suggests that the user will expect to be able to do "play song such-and-such by such-and-such" -- and then it's no longer (strictly) limited domain, and that doesn't work, so the scrap the whole thing.

[edit: Some more on "newstyle" inform vs traditional IF:] "A Comparison of TADS 3 and Inform 7" http://brasslantern.org/writers/iftheory/tads3andi7.html


Inform was my very first programming language. Now that I code in Ruby all day, I'd probably find something like TADS less frustration prone, but Inform is incredibly powerful for its domain.


Here is another modern interactive fiction system of which I'm the creator and maintainer. It is fully opensource (BSD license): http://code.google.com/p/aetheria/

It can also parse sentences like the one with the sword and the wizard shown above. It's really not very difficult to achieve those things, as imperative sentences have pretty uniform characteristics that make the problem of parsing imperatives much easier than general parsing. As said in another comment, the bulk of the complexity of these systems is in the world model, not in the parsing.

A drawback is that, although the system works for several languages including English, the documentation for game developers/IF writers is only in Spanish at the moment. Collaboration for translating it to English would be very welcome.



The very smart people at Wit.AI[1] are building a backend for this sort of thing. You could do worse than hook into that in the short term.

https://wit.ai/


My favorite command-line parser was in the (now-defunct) Ubiquity [edit: not unity] project from Mozilla. It had internationalized parsing, extendable verbs and noun types.

http://mitcho.com/blog/projects/a-demonstration-of-ubiquity-...

edit2: another link https://wiki.mozilla.org/Labs/Ubiquity/Parser_2


Yes! I remember this!

http://vimeo.com/1561578


And "Parser 2" was much better than that! It could predict verbs from nouns and use multi-word verbs without hyphens.


The historical problem with things that parse almost English is that it's hard to remember where the line is drawn between stuff the system will and will not understand. Once upon a time, reading about this stuff, that seemed significant. On reflection, I'm not actually sure how to weight it, relative to the benefits.


What about for the blind?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: