package name.panitz.eliza;
import scala.collection.mutable.{_}
class Data {
type Answers=Box[Words]
type Words=List[String]
val CONJUGATES:Map[String,String] = new HashMap()
CONJUGATES.update("ME","you")
CONJUGATES.update("ARE","am")
CONJUGATES.update("WERE","was")
CONJUGATES.update("YOU","I")
CONJUGATES.update("YOUR","my")
CONJUGATES.update("I'VE","you've")
CONJUGATES.update("I'M","you're")
CONJUGATES.update("AM","are")
CONJUGATES.update("WAS","were")
CONJUGATES.update("I","you")
CONJUGATES.update("MY","your")
CONJUGATES.update("YOU'VE","I've")
CONJUGATES.update("YOU'RE","I'm")
val repeatMsgs :Answers
=Box(
List( "Why did you repeat yourself?"
, "Do you expect a different answer by repeating yourself?"
, "Come, come, elucidate your thoughts."
, "Please don't repeat yourself!" ))
val nokeyMsgs
=Box(
List( "I'm not sure I understand you fully."
, "What does that suggest to you?"
, "I see."
, "Can you elaborate on that?"
, "Say, do you have any psychological problems?") )
val canYou
=Box(
List( "?Don't you believe that I can"
, "?Perhaps you would like to be able to"
, "?You want me to be able to" ))
val canI
=Box(
List( "?Perhaps you don't want to"
,"?Do you want to be able to" ))
val youAre
=Box(
List( "?What makes you think I am"
, "?Does it please you to believe I am"
, "?Perhaps you would like to be"
, "?Do you sometimes wish you were"))
val iDont
=Box(
List( "?Don't you really"
, "?Why don't you"
, "?Do you wish to be able to"
, "Does that trouble you?"))
val iFeel
=Box(
List( "Tell me more about such feelings."
, "?Do you often feel"
, "?Do you enjoy feeling"))
val whyDont
=Box(
List( "?Do you really believe I don't"
, ".Perhaps in good time I will"
, "?Do you want me to"))
val whyCant
=Box(
List( "?Do you think you should be able to"
, "?Why can't you"))
val areYou
=Box(
List( "?Why are you interested in whether or not I am"
, "?Would you prefer if I were not"
, "?Perhaps in your fantasies I am"))
val iCant
=Box(
List( "?How do you know you can't"
, "Have you tried?"
, "?Perhaps you can now"))
val iAm
=Box(
List( "?Did you come to me because you are"
, "?How long have you been"
, "?Do you believe it is normal to be"
, "?Do you enjoy being"))
val you
=Box(
List( "We were discussing you --not me."
, "?Oh,"
, "You're not really talking about me, are you?" ))
val yes
=Box(
List( "You seem quite positive."
, "Are you Sure?"
, "I see."
, "I understand."))
val no
=Box(
List( "Are you saying no just to be negative?"
, "You are being a bit negative."
, "Why not?"
, "Are you sure?"
, "Why no?"))
val computer
=Box(
List( "Do computers worry you?"
, "Are you talking about me in particular?"
, "Are you frightened by machines?"
, "Why do you mention computers?"
, "What do you think machines have to do with your problems?"
, "Don't you think computers can help people?"
, "What is it about machines that worries you?" ))
val problem
=Box(
List( "Is this really a poblem?"
, "Don't you see any solution to this?"
, "Is this your only problem?"
, "Has this always been a problem?"))
val iWant
=Box(
List( "?Why do you want"
, "?What would it mean to you if you got"
, "?Suppose you got"
, "?What if you never got"
, ".I sometimes also want"))
val question
=Box(
List( "Why do you ask?"
, "Does that question interest you?"
, "What answer would please you the most?"
, "What do you think?"
, "Are such questions on your mind often?"
, "What is it that you really want to know?"
, "Have you asked anyone else?"
, "Have you asked such questions before?"
, "What else comes to mind when you ask that?" ))
val name
=Box(
List( "Names don't interest me."
, "I don't care about names --please go on."))
val because
=Box(
List( "Is that the real reason?"
, "Don't any other reasons come to mind?"
, "Does that reason explain anything else?"
, "What other reasons might there be?" ))
val sorry
=Box(
List( "Please don't apologise!"
, "Apologies are not necessary."
, "What feelings do you have when you apologise?"
, "Don't be so defensive!" ))
val dream
=Box(
List( "What does that dream suggest to you?"
, "Do you dream often?"
, "What persons appear in your dreams?"
, "Are you disturbed by your dreams?" ))
val hello
=Box( List( "How do you...please state your problem."))
val maybe
= Box(List( "You don't seem quite certain."
, "Why the uncertain tone?"
, "Can't you be more positive?"
, "You aren't sure?"
, "Don't you know?" ))
val your
= Box(
List( "?Why are you concerned about my"
, "?What about your own"))
val always
=Box(
List( "Can you think of a specific example?"
, "When?"
, "What are you thinking of?"
, "Really, always?"))
val think
=Box(
List( "Do you really think so?"
, "?But you are not sure you"
, "?Do you doubt you"))
val alike
=Box(
List( "In what way?"
, "What resemblence do you see?"
, "What does the similarity suggest to you?"
, "What other connections do you see?"
, "Cound there really be some connection?"
, "How?" ))
val friend
=Box(
List( "Why do you bring up the topic of friends?"
, "Do your friends worry you?"
, "Do your friends pick on you?"
, "Are you sure you have any friends?"
, "Do you impose on your friends?"
, "Perhaps your love for friends worries you."))
val responses:List[Pair[Words,Answers]]
= List[Pair[Words,Answers]](
Pair(List("CAN","YOU"), canYou)
,Pair(List("CAN","I"), canI)
,Pair(List("YOU","ARE"), youAre)
,Pair(List("YOU'RE"), youAre)
,Pair(List("I","DON'T"), iDont)
,Pair(List("I", "DON", "NOT"), iDont)
,Pair(List("I", "FEEL"), iFeel)
,Pair(List("WHY", "DON'T", "YOU"),whyDont)
,Pair(List("WHY", "CAN'T", "I"), whyCant)
,Pair(List("ARE", "YOU"), areYou)
,Pair(List("I", "CAN'T"), iCant)
,Pair(List("I", "CANNOT"), iCant)
,Pair(List("I", "AM"), iAm)
,Pair(List("I'M"), iAm)
,Pair(List("YOU"), you)
,Pair(List("YES"), yes)
,Pair(List("NO"), no)
,Pair(List("I", "HAVE", "A", "PROBLEM"), problem)
,Pair(List("I'VE", "A", "PROBLEM"), problem)
,Pair(List("PROBLEM"), problem)
,Pair(List("COMPUTER"), computer)
,Pair(List("COMPUTERS"), computer)
,Pair(List("I", "WANT"), iWant)
,Pair(List("WHAT"), question)
,Pair(List("HOW"), question)
,Pair(List("WHO"), question)
,Pair(List("WHERE"), question)
,Pair(List("WHEN"), question)
,Pair(List("WHY"), question)
,Pair(List("NAME"), name)
,Pair(List("BECAUSE"), because)
,Pair(List("CAUSE"), because)
,Pair(List("SORRY"), sorry)
,Pair(List("DREAM"), dream)
,Pair(List("DREAMS"), dream)
,Pair(List("HI"), hello)
,Pair(List("HELLO"), hello)
,Pair(List("MAYBE"), maybe)
,Pair(List("YOUR"), your)
,Pair(List("ALWAYS"), always)
,Pair(List("THINK"), think)
,Pair(List("ALIKE"), alike)
,Pair(List("FRIEND"), friend)
,Pair(List("FRIENDS"), friend)
,Pair(List(), nokeyMsgs))
}
|