RPGDXThe center of Indie-RPG gaming
Not logged in. [log in] [register]
 
 
Post new topic Reply to topic  
View previous topic - View next topic  
Author Message
Hajo
Demon Hunter


Joined: 30 Sep 2003
Posts: 779
Location: Between chair and keyboard.

PostPosted: Wed Feb 06, 2008 4:06 pm    Post subject: Natural language parsing [quote]

I'm looking for a tutorial on natural language parsers like used in interactive fiction and adventure games.

Can anyone help me? I have some background in parsing programming (context free) languages, but natural languages need another approach, and I'm a bit clueless there beyond scanning for known verbs, objects and subjects ...

I want to use a simple language parser in Sonnheim to let the players interact with the environment in a similar fashion that they do with other player, but writing down what they mean so say and do.
Back to top  
cowgod
Wandering Minstrel


Joined: 22 Nov 2005
Posts: 114
Location: Pittsburgh, USA

PostPosted: Wed Feb 06, 2008 6:02 pm    Post subject: [quote]

It just isn't worth it.

If you could get nature language processing to work really well, it would be worth it. But no one anywhere has gotten it to work that well yet.

The only useful recommendation I have is to limit the number of words you can use to a small pool that the player can pick out of a list somewhere. Of course, that would pretty much eliminate the point.
Back to top  
Hajo
Demon Hunter


Joined: 30 Sep 2003
Posts: 779
Location: Between chair and keyboard.

PostPosted: Thu Feb 07, 2008 9:21 am    Post subject: [quote]

I doubt I can get it better than in the old adventure games. Some of those companies were working on their parsers for several years overall.

Are there common traps, things that never worked well? I don't have much experience in that field, but if you or someone else could give me some examples what worked well and what didn't, it might help to make up my mind without diving too deep into coding.
Back to top  
Verious
Mage


Joined: 06 Jan 2004
Posts: 409
Location: Online

PostPosted: Thu Feb 07, 2008 1:44 pm    Post subject: [quote]

Hajo, there are a number of Natural Language Processing (NLP) projects on Sourceforge:

http://sourceforge.net/search/?type_of_search=soft&type_of_search=soft&words=nlp

Perhaps one of them might provide insight into a reasonable solution.
Back to top  
Hajo
Demon Hunter


Joined: 30 Sep 2003
Posts: 779
Location: Between chair and keyboard.

PostPosted: Thu Feb 07, 2008 2:13 pm    Post subject: [quote]

Thank you :) There seem to be a few interesting projects there.

I have just finished a super-simple prototype which just does pattern matching from words in the input with the names items and beings near the player, and from the players inventory.

It's amazing what it can do already. While it can't really parse language, it is pretty good in figuring what the player wants to do, just by checking what is there and what could be done with that. Drawbacks are that it needs 100% correctly typed input, misspelled item names or verbs are not recognized. Maybe some day I can try fuzzy matching there. Right now I'm very excited about how it's shaping up, but it's too early to say if it will be good enough in the long run.

Maybe I run into problems with that approach, but right now it appears very flexible and even more important "natural" to me than the usual point-and-click mouse control. Maybe with some ideas from the other projects I can improve the parser so much that it survives a real world test.

I wonder a bit if players will accept if the system asks for support if the parser encounters an ambiguous sentance, and prompts the player with a list of possible meanings?
Back to top  
cowgod
Wandering Minstrel


Joined: 22 Nov 2005
Posts: 114
Location: Pittsburgh, USA

PostPosted: Thu Feb 07, 2008 3:49 pm    Post subject: [quote]

You can download open source spellchecker code. I used something called Jazzy Spellchecker (written in Java) for one of my programs a long time ago.

I used it to change misspelled words in the input.
Back to top  
Hajo
Demon Hunter


Joined: 30 Sep 2003
Posts: 779
Location: Between chair and keyboard.

PostPosted: Fri Feb 08, 2008 9:08 am    Post subject: [quote]

cowgod wrote:
You can download open source spellchecker code. I used something called Jazzy Spellchecker (written in Java) for one of my programs a long time ago.


Good idea! Thanks for the hint :)
Back to top  
Verious
Mage


Joined: 06 Jan 2004
Posts: 409
Location: Online

PostPosted: Fri Feb 08, 2008 1:50 pm    Post subject: [quote]

Hajo wrote:
I wonder a bit if players will accept if the system asks for support if the parser encounters an ambiguous sentance, and prompts the player with a list of possible meanings?


I think players would definately embrace a function that asked for clarification. People use the "Did you mean?" function on search engines (such as Google) all the time. Just make sure to give them a simple way to respond, such as entering a numerical response, so they don't have to retype the full correct response.
Back to top  
Mattias Gustavsson
Mage


Joined: 10 Nov 2007
Posts: 457
Location: Royal Leamington Spa, UK

PostPosted: Mon Feb 11, 2008 12:25 pm    Post subject: [quote]

If you want something like the old adventure games, you might get some ideas from this:

http://www.colossusentertainment.com/Blog/MidwinterRites.html

It's an oldskool style text adventure I made for the TIG forums text-the-halls compo (written in c++, source available)


_________________
www.mattiasgustavsson.com - My blog
www.rivtind.com - My Fantasy world and isometric RPG engine
www.pixieuniversity.com - Software 2D Game Engine
Back to top  
Hajo
Demon Hunter


Joined: 30 Sep 2003
Posts: 779
Location: Between chair and keyboard.

PostPosted: Wed Feb 13, 2008 8:57 am    Post subject: [quote]

Cool :) I didn't know you had been participating in the contest, but actually I was too lazy to check it out, just heard about it.

Thanks for the link!

I'm still very uncertain which way to go, but some actions just are beyond the mouses point-and-click abilities.
Back to top  
Post new topic Reply to topic Page 1 of 1 All times are GMT
 



Display posts from previous:   
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum