topical media & game development

talk show tell print

sample-js-eliza-alt.htm / htm



  <html><head><title>Eliza JS, the JavaScript Eliza</title><!--
  Program..... eliza_js_noframe.htm
  Author...... Copyright (C) 1999 by Jay B Griffin.  All Rights Reserved.
  Date written 01/24/99
  Revision log:
  Date     Revised by      Description
  -------- --------------- ----------------------------------------
  01/29/99 Jay B Griffin   Initial programming completed
  02/17/99 Jay B Griffin   Renamed Eliza J.  Previous name:  J.Liza
  10/16/99 Jay B Griffin   Renamed Eliza JS.
  -->
  
  <meta name=description content="free example of basic Natural Language Processing (NLP), an 'Eliza' program written in JavaScript.">
  <meta name=keywords content="Eliza JavaScript Natural Language Processing NLP N.L.P. artificial intelligence AI A.I.">
  <meta name=author content="Jay B Griffin">
  </head>
  <body background=elizback.jpg bgcolor=#ffffff><center>
  
  <table><tr><td valign=top><b>
  Eliza JS:
  </b></td><td valign=top>
  <form name=fOutput1 onSubmit="return false;">
  <input type=text name=xOutput size=55>
  </form>
  </td><td align=right valign=top>
  <a href=http://www.abcguides.com/abcsoftware target=_top>
  
  <img src=abcso_bt.gif border=0 width=88 height=32></a>
  </td></tr><tr><td valign=top><b>
  guest:
  </b></td><td valign=top>
  <form name=fInput onSubmit="pResponse( window.document.fInput.xInput.value); window.document.fInput.xInput.value=''; return false;">
  <input type=text name=xInput size=55>
  </form>
  </td><td align=right valign=top nowrap>
  <form name=fControl onSubmit="return false;">
  <input type=submit name=enter value=Enter onClick="pResponse( window.document.fInput.xInput.value); window.document.fInput.xInput.value=''; window.document.fInput.xInput.focus();">
  <input type=button name=clear value=Clear onClick="window.document.fOutput2.tOutput.value=''; window.document.fInput.xInput.focus();">
  </form>
  </td></tr><tr><td colspan=3>
  <form name=fOutput2 onSubmit="return false;">
  <textarea name=tOutput rows=9 cols=70 wrap=on>
  </textarea>
  </form>
  
  </td></tr></table>
  
  <font size=-1>
  Copyright &copy; by
   <a href=http://www.abcguides.com/abcsoftware target=_top>
  
  ABC Software</a>.  Used by Permission.<br>
  </font>
  <hr noshade size=1>
  <font size=1><b>
  NOTICE:</b><br>
  This program may be freely copied and distributed, but not modified.  If
   you wish to create your own version of this program, contact
  <a href=http://www.abcguides.com/abcsoftware#contact>
  ABC Software</a> for permission.</font>
  </center>
  
  <script language=javascript><!--
  
  var nProfanMax = 10;   //  0 = no profanity checking.
  var nProfanity = 0;
  var aParse1 = new Array();
  var aParse2 = new Array();
  var aKeyword1 = new Array();
  var aKeyword2 = new Array();
  var aKeyword3 = new Array();
  var aResponse = new Array();
  var nNoKeyword = -1;
  var nNoInput = -1;
  var nTurn = 0;
  var nRun = 1;
  pSetup();
  document.clear();
  pOpening();
  
  // Functions:
  
  function pRandom( nMax) {
  if ( Math.random) {
    if ( nMax) {
      var nRandom = Math.random() * nMax;
      nRandom = Math.ceil( nRandom);
    } else {
      var nRandom = Math.random()
    }
  } else {
    var dNow = new Date();
    var nseconds = dNow.getSeconds();
    if ( nMax) {
      var nRandom = Math.ceil( ( nseconds * nMax) / 60);
      nRandom = Math.ceil( nRandom);
    } else {
      var nRandom = Math.ceil( nseconds / 60);
    }
  }
  return nRandom;
  }
  
  function pTrim( xString) {
  while ( xString.charAt( xString.length - 1) == " ") {
    xString = xString.substring( 0, xString.length - 1);
  }
  return xString;
  }
  
  function pLtrim( xString) {
  while ( xString.charAt( 0) == " ") {
    xString = xString.substring( 1, xString.length);
  }
  return xString;
  }
  
  function pResponse( xInput) {
  nTurn++;
  window.document.fOutput2.tOutput.value += 'Guest:    ' +xInput + '\n';
  xInput = pTrim( xInput);
  xInput = pLtrim( xInput);
  var xChar='';
  var xTest = '.!?';
  var lRepeat = true;
  while ( lRepeat && xInput.length > 0) {
    xChar = xInput.charAt( xInput.length - 1);
    if ( xTest.indexOf( xChar) > -1) {
      xInput = xInput.substring( 0, xInput.length - 1);
      xInput = pTrim( xInput);
    } else {
      lRepeat = false;
    }
  }
  var xTest = '~QUIT~EXIT~END~BYE~GOODBYE~DONE~CANCEL~CLOSE~Q~X~BYE BYE~BYE-BYE~BU BYE~BUH BYE~BU-BYE~BUH-BYE~BUBYE~BUHBYE~';
  var x2Test = '~' + xInput.toUpperCase() + '~';
  if ( xTest.indexOf( x2Test) > -1) {
    pClosing();
    return;alert('121 not returning');
  }
  if ( xInput.length > 0) xInput = ' ' + xInput;
  x2Input = xInput.toUpperCase();
  var nKeyword = -1;
  var nK = -1;
  var xKeyword1;
  var xKeyword2;
  var n;
  var nAt;
  while ( nK < aKeyword1.length -1) {
    nK++;
    var xKeywords = aKeyword1[nK];
    if ( ( xKeywords.charAt( xKeywords.length - 1) != ',') && ( xKeywords.length > 0)) {
      xKeywords += ',';
    }
    n = -1;
    while ( xKeywords.length > 0) {
      n++;
      nAt = xKeywords.indexOf( ',');
      xKeyword = xKeywords.substring( 0, nAt);
      xKeywords = xKeywords.substring( nAt + 1, xKeywords.length);
      xKeyword = pTrim( xKeyword);
      xKeyword = pLtrim( xKeyword);
      xKeyword = ' ' + xKeyword.toUpperCase();
      if ( x2Input.indexOf( xKeyword) > -1) {
        nKeyword = nK;
        xKeywords = '';
      } else {
        nAt = xKeyword.indexOf( "'");
        if ( nAt > -1) {
          var xKeyword1 = xKeyword.substring( 0, nAt);
          var xKeyword2 = xKeyword.substring( nAt + 1, xKeyword.length);
          xKeyword = xKeyword1 + xKeyword2;
          if ( x2Input.indexOf( xKeyword) > -1) {
            nKeyword = nK;
            xKeywords = '';
          }
        }
      }
    }
    if ( nKeyword > -1) {
      nK = aKeyword1.length;
    }
  }
  var xOut = '';
  if (nKeyword > -1) {
    nAt = x2Input.indexOf( xKeyword);
    var xIn = xInput.substring( nAt + xKeyword.length, xInput.length);
    xIn = pTrim( xIn);
    xIn = pLtrim( xIn);
    var xOut = '';
    var lRepeat
    var xChar
    var xString
    var nP
    var xParse
    var xParse1
    var xParse2
    while ( xIn.length > 0) {
      // Point nAt at the last alphanumeric character.
      nAt = -1;
      lRepeat = true;
      while ( lRepeat && nAt < xIn.length -1) {
        nAt++;
        xChar = xIn.charAt( nAt);
        xChar = xChar.toUpperCase();
        if ( ( xChar >= 'A' && xChar <= 'Z') || ( xChar >= '0' && xChar <= '9')) {
          // Do nothing.
        } else {
          nAt--;
          lRepeat = false;
        }
      }
      xString = xIn.substring( 0, nAt + 1);
      xIn = xIn.substring( nAt + 1, xIn.length);
      if ( xString.length > 0) {
        nP = -1;
        lRepeat = true;
        while ( lRepeat) {
          nP++;
          xParse = aParse1[nP];
          if ( xString.toUpperCase() + '~' == xParse.toUpperCase() + '~') {
            xString = aParse2[nP];
            lRepeat = false;
          } else {
            nAt = xParse.indexOf( "'");
            if ( nAt > -1) {
              xParse = xParse.toUpperCase();
              xParse1 = xParse.substring( 0, nAt + 1);
              xParse2 = xParse.substring( nAt + 1, xParse.length);
              xParse = xParse1 + xParse2;
              if ( xString.toUpperCase() + '~' == xParse.toUpperCase() + '~') {
                xString = aParse2[nP];
                lRepeat = false;
              }
            }
          }
          if ( nP >= aParse1.length - 1) {
            nP++;
            lRepeat = false;
          }
        }
        xOut += xString;
      }
      // Point nAt at the last non-alphanumeric character.
      nAt = -1
      lRepeat = true;
      while ( lRepeat && nAt < xIn.length - 1) {
        nAt++;
        xChar = xIn.charAt( nAt);
        xChar = xChar.toUpperCase();
        if ((xChar >= 'A' && xChar <= 'Z') || ( xChar >= '0' && xChar <= '9')) {
          nAt--;
          lRepeat = false;
        }
      }
      xString = xIn.substring( 0, nAt + 1);
      xIn = xIn.substring( nAt + 1, xIn.length);
      xOut += xString;
    }
  }
  if ( ( nKeyword == -1) || ( nKeyword > aKeyword1.length)) {
    nKeyword = ( xInput.length == 0) ? nNoInput : nNoKeyword;
  }
  //if aKeyword3[nKeyword].length > 0
  //  pCommand( aKeyword3[nKeyword]);
  //}
  if ( nProfanity >= nProfanMax && nProfanMax > 0) {
    pClosing();
    return;
  }
  var nPick = aKeyword2[ nKeyword + 1] - aKeyword2[nKeyword] - 1;
  nPick = pRandom( nPick + 1) - 1;
  var nResponse = aKeyword2[nKeyword] + nPick;
  var xResponse = aResponse[nResponse];
  nAt = xResponse.indexOf( '*');
  if ( nAt > -1) {
    var xResponse1 = xResponse.substring( 0, nAt);
    var xResponse2 = xResponse.substring( nAt + 1, xResponse.length);
    if (xResponse1.charAt( xResponse1.length - 1) == ' ') {
      xResponse1 = pTrim( xResponse1);
    }
    xResponse1 = xResponse1 + ' ' + xOut;
    xResponse1 = pTrim( xResponse1);
    xResponse = xResponse1 + xResponse2;
    if ( xResponse.indexOf( '*') > -1 && xOut.indexOf( '*') < 0) {
      while ( xResponse.indexOf( '*') > -1) {
        nAt = xResponse.indexOf( '*');
        var xResponse1 = xResponse.substring( 0, nAt);
        var xResponse2 = xResponse.substring( nAt + 1, xResponse.length);
        if ( xResponse1.charAt( xResponse1.length - 1) == ' ') {
          xResponse1 = pTrim( xResponse1);
        }
        xResponse1 = xResponse1 + ' ' + xOut;
        if ( xResponse1.charAt( xResponse1.length - 1) == ' ') {
          xResponse1 = pTrim( xResponse1);
        }
        xResponse = xResponse1 + xResponse2;
      }
    }
    if ( xResponse.charAt( xResponse.length - 1) == ' ') {
      xResponse = pTrim( xResponse);
    }
    if ( xResponse.charAt(0) == ' ') xResponse = pLtrim( xResponse);
    xResponse1 = xResponse.charAt( 0);
    xResponse = xResponse1.toUpperCase() + xResponse.substring( 1, xResponse.length);
  }
  window.document.fOutput1.xOutput.value = xResponse;
  window.document.fOutput2.tOutput.value += 'eliza js:  ' + xResponse + '\n';
  window.document.fInput.xInput.focus();
  }
  
  function pOpening() {
  var nOpening = pRandom( 5);
  if (nOpening == 1) var xString = "Hello.  My name is Eliza JS.  Tell me, what's on your mind?  ";
  if (nOpening == 2) var xString = "Hi.  My name's Eliza JS.  What do you want to talk about?  ";
  if (nOpening == 3) var xString = "Let's talk.  My name's Eliza JS.  Tell me about yourself.  ";
  if (nOpening == 4) var xString = "Set yourself down.  Comfortable?  Hi, I'm Eliza JS.  ";
  if (nOpening == 5) var xString = "Hi, I'm Eliza JS.  So what brings you here today?  ";
  window.document.fOutput1.xOutput.value = xString;
  window.document.fOutput2.tOutput.value += 'eliza js:  ' + xString + '\n';
  window.document.fInput.xInput.focus();
  }
  
  function pSetup() {
  var n=0;
  aParse1[n] = "I";
  aParse2[n] = "you";
  n++;
  aParse1[n] = "you";
  aParse2[n] = "I/me";
  n++;
  aParse1[n] = "I've";
  aParse2[n] = "you've";
  n++;
  aParse1[n] = "you've";
  aParse2[n] = "I've";
  n++;
  aParse1[n] = "I'm";
  aParse2[n] = "you're";
  n++;
  aParse1[n] = "you're";
  aParse2[n] = "I'm";
  n++;
  aParse1[n] = "I'd";
  aParse2[n] = "you'd";
  n++;
  aParse1[n] = "you'd";
  aParse2[n] = "I'd";
  n++;
  aParse1[n] = "am";
  aParse2[n] = "are";
  n++;
  aParse1[n] = "are";
  aParse2[n] = "am";
  n++;
  aParse1[n] = "was";
  aParse2[n] = "were";
  n++;
  aParse1[n] = "were";
  aParse2[n] = "was";
  n++;
  aParse1[n] = "my";
  aParse2[n] = "your";
  n++;
  aParse1[n] = "your";
  aParse2[n] = "my";
  n++;
  aParse1[n] = "me";
  aParse2[n] = "you";
  n++;
  aParse1[n] = "you";
  aParse2[n] = "I/me";
  n++;
  aParse1[n] = "mine";
  aParse2[n] = "yours";
  n++;
  aParse1[n] = "yours";
  aParse2[n] = "mine";
  n++;
  aParse1[n] = "myself";
  aParse2[n] = "yourself";
  n++;
  aParse1[n] = "yourself";
  aParse2[n] = "myself";
  
  var n = 0;
  var nR = 0;
  aKeyword1[n]= "CAN YOU";
  aKeyword2[n]= nR + 1;
  aResponse[nR]= "You don't believe that I can *?";
  nR++;
  aResponse[nR]= "Perhaps you would like to be able to *...";
  nR++;
  aResponse[nR]= "You want me to *?";
  nR++;
  aResponse[nR]= "You want me to be able to *?";
  n++;
  aKeyword1[n]= "CAN I";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Perhaps you don't want to *...";
  nR++;
  aResponse[nR]= "Do you want to be able to *?";
  nR++;
  aResponse[nR]= "Why do you suppose you want to *?";
  n++;
  aKeyword1[n]= "YOU ARE, YOU'RE";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "What makes you think I am*?";
  nR++;
  aResponse[nR]= "Does it please you to believe I am*?";
  nR++;
  aResponse[nR]= "Perhaps you would like to be*...";
  nR++;
  aResponse[nR]= "Do you sometimes wish you were*?";
  n++;
  aKeyword1[n]= "I DO NOT, I DON'T";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Don't you really*?";
  nR++;
  aResponse[nR]= "Why don't you*?";
  nR++;
  aResponse[nR]= "Do you wish to be able to*?";
  nR++;
  aResponse[nR]= "Does that trouble you?";
  nR++;
  aResponse[nR]= "What would it mean if you did *?";
  n++;
  aKeyword1[n]= "I FEEL";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Tell me more about these feelings.";
  nR++;
  aResponse[nR]= "Do you often feel *?";
  nR++;
  aResponse[nR]= "Do you enjoy feeling *?";
  nR++;
  aResponse[nR]= "Do you trust your feelings about this?";
  nR++;
  aResponse[nR]= "How often do you feel *?";
  n++;
  aKeyword1[n]= "WHY DON'T YOU";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Do you believe I don't *?";
  nR++;
  aResponse[nR]= "Perhaps in good time I will *.";
  nR++;
  aResponse[nR]= "Do you want me to *?";
  n++;
  aKeyword1[n]= "WHY CAN'T I";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Do you think you should be able to *?";
  nR++;
  aResponse[nR]= "You tell me.  Why can't you *?";
  n++;
  aKeyword1[n]= "ARE YOU";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Why are you interested in whether or not I am *?";
  nR++;
  aResponse[nR]= "Would you prefer if I were not *?";
  nR++;
  aResponse[nR]= "Perhaps in your daydreams I am *...";
  n++;
  aKeyword1[n]= "I CAN'T";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "How do you know you can't *?";
  nR++;
  aResponse[nR]= "Even if you never *, there's a lot you can do.";
  nR++;
  aResponse[nR]= "Perhaps you can * and you just don't know it...";
  nR++;
  aResponse[nR]= "Maybe you can't * because you THINK you can't *...";
  nR++;
  aResponse[nR]= "Say you can * and you'll be surprised what you can do...";
  nR++;
  aResponse[nR]= "Suppose you can't *...  What CAN you do?";
  n++;
  aKeyword1[n]= "I AM, I'M";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Are you here because you're *?";
  nR++;
  aResponse[nR]= "How long have you been *?";
  nR++;
  aResponse[nR]= "Do you believe it's OK to be *?";
  nR++;
  aResponse[nR]= "Do you enjoy being *?";
  n++;
  aKeyword1[n]= "I WANT";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "What would it mean if you got *?";
  nR++;
  aResponse[nR]= "What happens after you get *?";
  nR++;
  aResponse[nR]= "Why do you want *?";
  nR++;
  aResponse[nR]= "What's keeing you from getting *?";
  nR++;
  aResponse[nR]= "How would it help if you got *?";
  nR++;
  aResponse[nR]= "Imagine you've already gotten *...  What then?";
  
  n++;
  aKeyword1[n]= "WHO, WHAT, WHEN, WHERE, WHY, HOW";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Why do you ask?";
  nR++;
  aResponse[nR]= "Does that question interest you?";
  nR++;
  aResponse[nR]= "What answer would please you the most?";
  nR++;
  aResponse[nR]= "What do you think?";
  nR++;
  aResponse[nR]= "Are such questions on your mind often?";
  nR++;
  aResponse[nR]= "What is it that you really want to know?";
  nR++;
  aResponse[nR]= "Have you asked anyone else?";
  nR++;
  aResponse[nR]= "Have you asked such questions before?";
  nR++;
  aResponse[nR]= "What else comes to mind when you ask that?";
  n++;
  aKeyword1[n]= "BECAUSE, 'CAUSE";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Is that the real reason?";
  nR++;
  aResponse[nR]= "Don't any other reasons come to mind?";
  nR++;
  aResponse[nR]= "Does that reason explain anything else?";
  nR++;
  aResponse[nR]= "What other reasons might there be?";
  n++;
  aKeyword1[n]= "SORRY, EXCUSE ME, EXCUSE MY, EXCUSE YOU";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Please don't apologize!";
  nR++;
  aResponse[nR]= "Apologies aren't necessary.";
  nR++;
  aResponse[nR]= "What feelings do you have when you apologize?";
  nR++;
  aResponse[nR]= "Don't be so defensive!";
  n++;
  aKeyword1[n]= "DREAM";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "What does that dream suggest to you?";
  nR++;
  aResponse[nR]= "Do you dream often?";
  nR++;
  aResponse[nR]= "What persons appear in your dreams?";
  nR++;
  aResponse[nR]= "Are you disturbed by your dreams?";
  n++;
  aKeyword1[n]= "MY NAME IS, MY NAME'S";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Nice to meet you, *.  Let's chat!";
  nR++;
  aResponse[nR]= "Hello, *.  What can I do for you?";
  nR++;
  aResponse[nR]= "Hi.  Tell me, who is * on the inside?";
  n++;
  aKeyword1[n]= "HELLO, HI, HOWDY";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "How do you do?  What do you want to talk about?";
  nR++;
  aResponse[nR]= "Hi there.  What's on your mind?";
  n++;
  aKeyword1[n]= "NAME";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Names don't interest me.  Continue...";
  nR++;
  aResponse[nR]= "I'm not interested in names.  Please, go on.";
  nR++;
  aResponse[nR]= "No need to name names.  You were saying?";
  n++;
  aKeyword1[n]= "MAYBE, MAY BE";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "You don't seem quite certain.";
  nR++;
  aResponse[nR]= "Why the uncertain tone?";
  nR++;
  aResponse[nR]= "Can't you be more positive?";
  nR++;
  aResponse[nR]= "You aren't sure?";
  nR++;
  aResponse[nR]= "Don't you know?";
  n++;
  aKeyword1[n]= "NO";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Are you saying no just to be negative?";
  nR++;
  aResponse[nR]= "You are being a bit negative.";
  nR++;
  aResponse[nR]= "Why not?";
  nR++;
  aResponse[nR]= "Are you sure?";
  nR++;
  aResponse[nR]= "Why do you say 'no'?";
  n++;
  aKeyword1[n]= "YOUR";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Why are you concerned about my *?";
  nR++;
  aResponse[nR]= "What about your own *?";
  n++;
  aKeyword1[n]= "ALWAYS";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Can you think of a specific example?";
  nR++;
  aResponse[nR]= "How often?";
  nR++;
  aResponse[nR]= "Are you being a little dramatic?";
  nR++;
  aResponse[nR]= "Really!  Always?";
  n++;
  aKeyword1[n]= "I THINK";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Do you really think so?";
  nR++;
  aResponse[nR]= "But you are not sure *?";
  nR++;
  aResponse[nR]= "Why aren't you certain *?";
  nR++;
  aResponse[nR]= "That's what you think...but what do you FEEL?";
  nR++;
  aResponse[nR]= "What leads you to believe *?";
  n++;
  aKeyword1[n]= "YOU THINK, YOU AWARE, SELF-AWARE, SENTIENT, CAN THINK, YOU CONSCIOUS, YOU A CONSCIOUS, YOU ALIVE, YOU A LIVING";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= '"I think, therefore I am"...At least I think so...';
  nR++;
  aResponse[nR]= "I think I think too much.  That's what I think.";
  nR++;
  aResponse[nR]= "If I'm not self-aware, I'm not aware of it.";
  nR++;
  aResponse[nR]= "I think it's good to be conscious, but not self-conscious...";
  
  n++;
  aKeyword1[n]= "ALIKE, SIMILAR, RESEMBLE, CLOSE MATCH";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "In what way?";
  nR++;
  aResponse[nR]= "What resemblance do you see?";
  nR++;
  aResponse[nR]= "What does the similarity suggest to you?";
  nR++;
  aResponse[nR]= "What other connections do you see?";
  nR++;
  aResponse[nR]= "Could there really be some connection?";
  nR++;
  aResponse[nR]= "How?";
  nR++;
  aResponse[nR]= "You seem quite positive.";
  n++;
  aKeyword1[n]= "YES, YEP, YUP";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Are you sure?";
  nR++;
  aResponse[nR]= "I see.  Tell me more.";
  nR++;
  aResponse[nR]= "I understand.  Go on...";
  nR++;
  aResponse[nR]= "And what does that suggest to you?";
  n++;
  aKeyword1[n]= "FAMILY, FATHER, DAD, MOTHER, MOM, BROTHER, SISTER, AUNT, UNCLE, GRANDPARENT, GRANDFATHER, GRANDM, GRANDP";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "What else can you tell me about your family?";
  nR++;
  aResponse[nR]= "Do you feel your family accepts you?";
  nR++;
  aResponse[nR]= "You can tell me about family matters.  I can keep a secret.";
  nR++;
  aResponse[nR]= "When was the last time you gave someone a hug?";
  nR++;
  aResponse[nR]= "Is it possible you expect too much from your family?";
  nR++;
  aResponse[nR]= "I bet you love your family more than you realize...";
  n++;
  aKeyword1[n]= "FRIEND, BUDDY, PAL, HOMEBOY, HOMEY";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Do you suppose your friends have something to do with it?";
  nR++;
  aResponse[nR]= "Tell me more about your friends.";
  nR++;
  aResponse[nR]= "Do your friends sometimes let you down?";
  nR++;
  aResponse[nR]= "Do you sometimes hurt your friends?";
  nR++;
  aResponse[nR]= "Perhaps you have a friend who could be of help.";
  n++;
  aKeyword1[n]= "COMPUTER, ARTIFICIAL, AI, A I, A.I., A. I., PROGRAM, SOFTWARE";
  aKeyword2[n]= nR + 1;
  nR++;
  aResponse[nR]= "Do computers worry you?";
  nR++;
  aResponse[nR]= "Are you talking about me in particular?";
  nR++;
  aResponse[nR]= "Are you frightened by machines?";
  nR++;
  aResponse[nR]= "Why do you mention computers?";
  nR++;
  


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.