Skip to content

Commit 2dcd213

Browse files
Merge pull request #16 from ContextLab/fix/eliza-sync-issue-15
Sync ELIZA with original Weizenbaum rules
2 parents e1b96f1 + 3489437 commit 2dcd213

File tree

8 files changed

+722
-1136
lines changed

8 files changed

+722
-1136
lines changed

demos/01-eliza/data/eliza-rules.json

Lines changed: 35 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,11 @@
5151
"need"
5252
],
5353
"sad": [
54-
"sad",
5554
"unhappy",
5655
"depressed",
5756
"sick"
5857
],
5958
"happy": [
60-
"happy",
6159
"elated",
6260
"glad",
6361
"better"
@@ -66,7 +64,6 @@
6664
"can't"
6765
],
6866
"everyone": [
69-
"everyone",
7067
"everybody",
7168
"nobody",
7269
"noone"
@@ -92,6 +89,30 @@
9289
"That will be $200."
9390
],
9491
"rules": [
92+
{
93+
"keyword": "sorry",
94+
"patterns": [
95+
{
96+
"pattern": "*",
97+
"responses": [
98+
"Please don't apologise.",
99+
"Apologies are not necessary.",
100+
"I've told you that apologies are not required."
101+
]
102+
}
103+
]
104+
},
105+
{
106+
"keyword": "apologise",
107+
"patterns": [
108+
{
109+
"pattern": "*",
110+
"responses": [
111+
"goto sorry"
112+
]
113+
}
114+
]
115+
},
95116
{
96117
"keyword": "remember",
97118
"patterns": [
@@ -379,7 +400,7 @@
379400
"keyword": "i",
380401
"patterns": [
381402
{
382-
"pattern": "* i *@desire*",
403+
"pattern": "* i @desire *",
383404
"responses": [
384405
"What would it mean to you if you got (3) ?",
385406
"Why do you want (3) ?",
@@ -390,7 +411,7 @@
390411
]
391412
},
392413
{
393-
"pattern": "* i am*@sad*",
414+
"pattern": "* i am * @sad *",
394415
"responses": [
395416
"I am sorry to hear that you are (3) .",
396417
"Do you think that coming here will help you not to be (3) ?",
@@ -399,7 +420,7 @@
399420
]
400421
},
401422
{
402-
"pattern": "* i am*@happy*",
423+
"pattern": "* i am * @happy *",
403424
"responses": [
404425
"How have I helped you to be (3) ?",
405426
"Has your treatment made you (3) ?",
@@ -414,15 +435,15 @@
414435
]
415436
},
416437
{
417-
"pattern": "* i *@belief* i *",
438+
"pattern": "* i @belief * i *",
418439
"responses": [
419440
"Do you really think so ?",
420441
"But you are not sure you (3) .",
421442
"Do you really doubt you (3) ?"
422443
]
423444
},
424445
{
425-
"pattern": "* i *@belief* you *",
446+
"pattern": "* i * @belief * you *",
426447
"responses": [
427448
"goto you"
428449
]
@@ -437,7 +458,7 @@
437458
]
438459
},
439460
{
440-
"pattern": "* i *@cannot*",
461+
"pattern": "* i @cannot *",
441462
"responses": [
442463
"How do you think that you can't (3) ?",
443464
"Have you tried ?",
@@ -481,8 +502,7 @@
481502
"That's quite interesting."
482503
]
483504
}
484-
],
485-
"rank": 2
505+
]
486506
},
487507
{
488508
"keyword": "you",
@@ -523,8 +543,7 @@
523543
"What are your feelings now ?"
524544
]
525545
}
526-
],
527-
"rank": 1
546+
]
528547
},
529548
{
530549
"keyword": "yes",
@@ -558,7 +577,7 @@
558577
"keyword": "my",
559578
"patterns": [
560579
{
561-
"pattern": "* my *@family*",
580+
"pattern": "* my * @family *",
562581
"responses": [
563582
"Tell me more about your family.",
564583
"Who else in your family (4) ?",
@@ -678,7 +697,7 @@
678697
"keyword": "everyone",
679698
"patterns": [
680699
{
681-
"pattern": "*@everyone*",
700+
"pattern": "* @everyone *",
682701
"responses": [
683702
"Really, (2) ?",
684703
"Surely not (2) .",
@@ -768,37 +787,13 @@
768787
"keyword": "like",
769788
"patterns": [
770789
{
771-
"pattern": "*@be* like *",
790+
"pattern": "* @be * like *",
772791
"responses": [
773792
"goto alike"
774793
]
775794
}
776795
],
777796
"rank": 10
778-
},
779-
{
780-
"keyword": "sorry",
781-
"patterns": [
782-
{
783-
"pattern": "*",
784-
"responses": [
785-
"Please don't apologise.",
786-
"Apologies are not necessary.",
787-
"I've told you that apologies are not required."
788-
]
789-
}
790-
]
791-
},
792-
{
793-
"keyword": "apologise",
794-
"patterns": [
795-
{
796-
"pattern": "*",
797-
"responses": [
798-
"goto sorry"
799-
]
800-
}
801-
]
802797
}
803798
],
804799
"fallbacks": [

0 commit comments

Comments
 (0)