Go Back   nV News Forums > Software Forums > Software Development

Newegg Daily Deals

Reply
 
Thread Tools
Old 05-15-08, 05:41 PM   #1
XDanger
Whaaat?
 
XDanger's Avatar
 
Join Date: Nov 2005
Posts: 5,728
Default I want to make a simple parser that I can teach more every day.

Like an old text based adventure parser

it would have a set number of feelings that would change as I speak to it
The text it speaks would be a mix and match based on these variable feelings plus a random element.

I would keep adding to it a few lines every day.

What can I use to do this?

I want to be able to use vista speech recognition with it.

When it gets fat I would hope to change it slightly to start teaching it when its making sense.
__________________
2500K 4.7ghz,P8P67Pro,120gb Force3, 8gb Vengeance,R9290,TX850v2,W7HP,LaCie Blue 22" crt COMMODORE 64 Silver Label 1Mhz/128D 4Mhz(Z80)
XDanger is offline   Reply With Quote
Old 05-15-08, 06:14 PM   #2
ViN86
 
Join Date: Mar 2004
Posts: 15,486
Default Re: I want to make a simple parser that I can teach more every day.

why not use C?

you can use cygwin to compile the code and execute it and run it in a command line. save the data to a text file.
ViN86 is offline   Reply With Quote
Old 05-18-08, 03:10 PM   #3
XDanger
Whaaat?
 
XDanger's Avatar
 
Join Date: Nov 2005
Posts: 5,728
Default Re: I want to make a simple parser that I can teach more every day.

I was hoping there would be something a bit more BASIC I could use.

I need something very low level like
XX if a is => 20 then "Hello"
XX if b is => 20 then "Yes"
if c is => 20 then "No"
if a is <= 20 then "I dunno"
if a is <= 10 then "Mind your own biznis"

List of nice words
All ## "Thankyou", "Your Welcome", etc

if input ## then a = a+1

Could have a mood face image also

I remember being able to do this kind of thing on my commodore or spectrum, will I have to use an emulator????
__________________
2500K 4.7ghz,P8P67Pro,120gb Force3, 8gb Vengeance,R9290,TX850v2,W7HP,LaCie Blue 22" crt COMMODORE 64 Silver Label 1Mhz/128D 4Mhz(Z80)
XDanger is offline   Reply With Quote
Old 05-26-08, 11:46 PM   #4
ViN86
 
Join Date: Mar 2004
Posts: 15,486
Default Re: I want to make a simple parser that I can teach more every day.

Quote:
Originally Posted by XDanger
I was hoping there would be something a bit more BASIC I could use.

I need something very low level like
XX if a is => 20 then "Hello"
XX if b is => 20 then "Yes"
if c is => 20 then "No"
if a is <= 20 then "I dunno"
if a is <= 10 then "Mind your own biznis"

List of nice words
All ## "Thankyou", "Your Welcome", etc

if input ## then a = a+1

Could have a mood face image also

I remember being able to do this kind of thing on my commodore or spectrum, will I have to use an emulator????
you could do it in PHP and use the switch() statement. that way you could also put it online and share it with us
ViN86 is offline   Reply With Quote
Old 07-10-08, 02:25 PM   #5
fizzleborth
Registered User
 
Join Date: Jul 2008
Posts: 1
Default Re: I want to make a simple parser that I can teach more every day.

You're looking to write a copy of ELIZA? That didn't actually have "feelings," or any sort of "memory" at all from one response to the next, so I suppose that means you'll be advancing the state of the art .

I think Prolog is made for exactly this sort of thing, though I've never used it myself. But your example of how you imagine the code looking is pretty declarative, if you ignore the if/then/else boilerplate. No idea of how you'd go about learning Prolog though, and I imagine it isn't a great first language, if you've never programmed before.

On the other hand, you seem to have a grasp of basic imperative control structures (if/then/else) already (although in most imperative languages, you'd be assigning the "Hello"/"Yes"/etc. responses to a variable, as in if happiness < 10 and responses_given > 5: response = "Go away", and then have a step of explicitly printing the response, not to mention a step before all that of parsing the user's reply and adjusting the "feelings" variables based on what was typed). So sticking with an imperative language would probably have you up and running the fastest, not to mention that any given imperative language will probably be easier to learn (with many more tutorials and helpful communities) than Prolog (or any other declarative language).

I'll recommend Python since you don't say if/what programming language(s) you know. In python, you can just load up the interpreter and try code out interactively to see what works and what it returns, right away, which really accelerates prototyping and learning. It also has a ton of tutorials on the net and tons of books for sale about learning python. It's pretty easy to get running on whatever sort of system you're using (just download and run a singler installer on Windows, and it registers itself to run all .py files, and includes the GUI interpreter in your start menu, and you're ready to go), and there's no extra setup (like getting a web server running locally to do PHP development). Especially for a console-based program like you're describing, it should be well-suited.

There are also a great many third-party "modules" for it, so it is pretty simple to add, say, a PyGame-based graphical component if you want, or a couple of XMPP modules if you want to turn it into an IM bot/twitter bot. And I'm sure it's possible to link it into Vista's speech recognition (though it might not be easy or pretty to do so; also, does Vista do general speech-to-text, or only recognize a set of commands?). Plus if Python becomes your general everyday hammer, that won't be too bad, since it's pretty good at hitting most nails (scripts to do file management, a program to gather statistics on your MP3s' ID3 tags, a webapp for managing your schedule, it's pretty versatile).

On the other hand, if having it on the web so that anyone with a web browser can use your program sounds like a fun idea (and many more people will visit a web page than will be willing to download and install a program), I'd recommend PHP too. Nothing beats PHP for a first-time web programmer, and (if it includes what you want) HTML is the easiest way to add a GUI that there is. Also it's super easy to find cheap hosting with PHP support. Python does have web programming, but it's more complicated, most packages are aimed more at database-driven sites, and it's not so easy to find a host for a python script. There is Google's App Engine of course, and that has the added advantage of being free, but it's still just not as easy and quick as PHP.

That said, if all you want is a pre-made ELIZA, a google search should get you one pretty quickly. There's also an example of ELIZA written in python, but it's pretty... concise, and not so easy to understand for a Python beginner (in part because it's trying to include the responses in a declarative manner).
fizzleborth is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bring Your Valve To School Day: Teach With Portals News Gaming Headlines 0 06-21-12 09:30 AM
E3 round-up: day three News Archived News Items 0 06-07-12 07:50 AM
Make This Father's Day National GeekDad Day! News Archived News Items 0 05-24-12 03:50 AM

All times are GMT -5. The time now is 11:46 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.