Thread: Help With A 'Memory' Program

  1. #1
    Registered User
    Join Date
    Dec 2005
    Posts
    2

    Help With A 'Memory' Program

    Does anyone know how to make an expert system using relatively basic C language? By expert system I mean that you ask a question, the computer responds with an answer, and if it doesn't know the answer then it stores the answer along with the question in a file. So when you ask the question again, it will know the answer. the tricky part is that, lets say you ask "what color is the sky?" or "the color of the sky is?" - the program should not differentiate those two questions since they are in essence the same question.

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    You'd probably want to look into fairly complex data structures and algorithms to make that. You'd have to have a program differentiate the verbs and nouns in the sentence then store it into a structure and search until it gets all the keywords. Like it would pull out "What" and go to the what questions, then it would go to color, then it would go to sky, see that there are no more real buzz words (like cloud) and give the in that node.

    There may be a really standard data structure to go about this, but right now all I can think of is a Minimax tree like what they use for Chess programs and other AI.
    Last edited by SlyMaelstrom; 12-18-2005 at 12:29 AM.
    Sent from my iPadŽ

  3. #3
    Registered User
    Join Date
    Dec 2005
    Posts
    2
    Hrm, would you know how to create a program in which the user asks the question, and if the CPU doesn't know the answer, it asks for the answer and then stores the Answer and Question in a file. So, if the question was asked again, the CPU just 'printf's the file that has the answer onto the DOS screen.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > the program should not differentiate those two questions since they are in essence the same question.
    OK, so you ask
    "What colour is the sky?"
    It doesn't know, so you answer "blue".

    What if your next question is
    "is the sky blue?"
    Are you expecting "yes" in response to this


    > the program should not differentiate those two questions since they are in essence the same question.
    True machine comprehension is still a way off, even for people who've been doing machine cognition for decades.
    Is this a question
    This is the question
    Same words, different order, completely different meaning.

    > Does anyone know how to make an expert system using relatively basic C language?
    The only basic thing you're going to be able to do is use strcmp() to compare the new question with all previous questions and answers. This will not be an expert system. Once you get into any kind of parsing of questions, you're going to lose any idea of making a simple program.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. memory not released after running program
    By lehe in forum Linux Programming
    Replies: 21
    Last Post: 01-01-2011, 03:32 AM
  2. Memory allocation overflow in c program
    By bassam_fci in forum C Programming
    Replies: 6
    Last Post: 05-19-2009, 03:35 PM
  3. Assignment Operator, Memory and Scope
    By SevenThunders in forum C++ Programming
    Replies: 47
    Last Post: 03-31-2008, 06:22 AM
  4. Pointer's
    By xlordt in forum C Programming
    Replies: 13
    Last Post: 10-14-2003, 02:15 PM