Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Java Question Program?

  1. #1
    Junior Member
    Join Date
    May 2013
    Location
    Nottinghamshire
    Posts
    2
    My Mood
    Inspired
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Java Question Program?

    Hey All!,

    I've written a java code that basically returns an answer when I ask it a question! The answers are just random so I can ask it a question and it doesn't reply with a smart answer! Like "How are you today?" The program will reply with whatever pre-programmed answers I've written, so it might reply "Don't ask me again" or "Yes, but I don't like it!". It just picks a random answer!

    I want to make this so it can understand what I'm asking it and give an answer based on that? So I ask "How are you?" and it replies "I'm fine thank you!" etc. I'm guessing there is a way for the java program to understand certain words and give an answer based on those words?

    What would I need to look into to do this? Or is this out of my league at the moment as I've only started learning Java about 3 weeks ago!

    I'm the type of person who learns better by doing what I need to learn! If I sit reading books about Java it doesn't sink in unless I think of something and try to do it! (if that makes sense).

    It would be cool if this could connect to the internet and answer the questions from there, but no biggie!

    Thanks


  2. #2
    Grand Poobah
    Join Date
    Mar 2011
    Posts
    1,545
    My Mood
    Grumpy
    Thanks
    0
    Thanked 167 Times in 158 Posts

    Default Re: Java Question Program?

    If you want your program to produce a specific answer to a specific question then you could use a Map containing Strings. Use the question as a Key and the answer as the Value. When user enters a question look it up in your Map and return the answer.
    Improving the world one idiot at a time!

  3. #3
    Junior Member
    Join Date
    May 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Java Question Program?

    Thanks for sharing a good information about Java Question Program. its really helpful for all the java students.

  4. #4
    Junior Member
    Join Date
    May 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Java Question Program?

    Hey frds, Now you can clear your java doubts at ... They are offering free online java course. Just join it and solve your problems.
    Last edited by copeg; June 3rd, 2013 at 08:35 AM. Reason: Removed Link

  5. #5
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Java Question Program?

    What you're talking about is called Natural Language Processing (there's a nice google term for you), and it's a very active field of research (and becoming more and more active thanks to search engines and things like Google Now and Siri).

    Your implementation could be anything from something as simple as mapping a few canned responses to input words, or a full doctorate thesis. There's a lot of room for exploration here.

    Recommended reading: Natural language processing - Wikipedia, the free encyclopedia
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Creating Objects: A question about the Java Tutorials example program
    By chaucer345 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 12th, 2012, 05:47 PM
  2. need help for the few question for java program!!
    By vitorloke in forum Java Theory & Questions
    Replies: 10
    Last Post: April 20th, 2012, 11:17 AM
  3. Question About Program
    By metaleddie13 in forum Java Theory & Questions
    Replies: 3
    Last Post: October 14th, 2011, 06:19 PM
  4. java applet program question (on getting path fails)
    By hellocheese in forum What's Wrong With My Code?
    Replies: 6
    Last Post: March 30th, 2011, 04:34 PM
  5. [SOLVED] How to narrow down the range of input in java?
    By big_c in forum What's Wrong With My Code?
    Replies: 5
    Last Post: April 20th, 2009, 11:38 AM