--- /dev/null
+*.py[cod]
+
+# C extensions
+*.so
+
+# Packages
+*.egg
+*.egg-info
+dist
+build
+eggs
+parts
+bin
+var
+sdist
+develop-eggs
+.installed.cfg
+lib
+lib64
+__pycache__
+
+# Installer logs
+pip-log.txt
+
+# Unit test / coverage reports
+.coverage
+.tox
+nosetests.xml
+
+# Translations
+*.mo
+
+# Mr Developer
+.mr.developer.cfg
+.project
+.pydevproject
+
+# IPython
+.ipynb*
+
+# Sublime text
+*.sublime-workspace
+
+# Logs
+*.log
--- /dev/null
+##### Signed by https://keybase.io/neilnjae
+```
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2
+
+iQIcBAABCAAGBQJWjqGHAAoJEJPB2e07PgbqD0kP/REkohoCWKhscZzHwfgQFv7d
+V1f4UeeUCaJaajG+jFkaBxOFcCnuvmihei0iUYe8uX69MWB7QHI4ogK9iKjxXnvH
+LLw2FCR2nCwwJkzU4A2S78cr0ytmT8pzkc+iI/E30xhwnVaYv1QOVR1msZL+VO4L
+BxM7icHqNvQJAuLy+en5bMacvUbcFDIPsogHPAGw8Ot9RtbCXndeCDXKuBLFovQn
+R1mIVtJd/05ZnZk2JUmrknrW3t4aO9VYTocDLTFoC1SjyIVYRBP43DsFE5MQgOhh
+sytxhod6cPI9jPybQY8Carhh0tTTBd4jHVdthroziKgG9aiU9bIBmMC4L2lfzLHz
+qO7seltMHdI7SYyJxwmz9xSd5dHKW5NvPPKxzYVuPVc83yEj8GDjl6M5OxKUoyEH
+XKYfIWm6itGvCo9YtbvrtlwEVD5sBdh5C0wM4RuGBHJBW3CSdbc904mmkjeiWB8q
+QjIRrC4OHJlyk+BUO4u8QvFld8QmyVaVdLsjL3KtSM1UFIaS5cBA/Nm2PwdUuyvt
+0UUJuFeMI+KljH62g7LU17UL2zV19+/hXG1amKkwvZIBXYXUR2fFRqxF3bjl767s
+wR/cRkCQjkaHcZAifKt8f4rndCfmp+cPPVXcxyofUXVzXCo6dM3rQBluT7tAHLJ6
+8Ykhk55Q3in5HqSbK/Lp
+=7jJ5
+-----END PGP SIGNATURE-----
+
+```
+
+<!-- END SIGNATURES -->
+
+### Begin signed statement
+
+#### Expect
+
+```
+size exec file contents
+ ./
+384 .gitignore a93de2ae5c2a47a38599751d1f914566569dfa09dd1778e207117db6c71421dd
+10642 eliza.scm 6583dab3d3a738f7c30ecc466173a87493d8688a38e3a6d3119dcabccd19fb70|05535b9b3ecfd4ed59930bac2aecf07187d0b17598cd5631449c25f33d4a90bc
+1219320 p36-weizenabaum.pdf 3b18ed3ebf7c28670c215709e778c9b339055fb225b0286796bd0767197be041|2193a46558e12df2a2935889418defe494925feea31711675393d97b08cf0950
+8951 read-yaml-rules.ipynb 98abea4ef566c47ac645d82d7ee66bd9391340620d192a036ef493d144a25c70
+5684 rules.yaml 33b053eafd822384a60b782859a9c056bb558a81f4e85b4e7d9db87521a37e57
+348 rules2.yaml~ 71753ea7113018d1409c29990714b39e3601bb0280e05420c5f85aa88aea150b
+4804 rules3.yaml~ 81b9f4401883b61ffaef2228ddd55fdac5adc76281d5f34d9edd57ed3688fa10
+```
+
+#### Ignore
+
+```
+/SIGNED.md
+```
+
+#### Presets
+
+```
+git # ignore .git and anything as described by .gitignore files
+```
+
+<!-- summarize version = 0.0.9 -->
+
+### End signed statement
+
+<hr>
+
+#### Notes
+
+With keybase you can sign any directory's contents, whether it's a git repo,
+source code distribution, or a personal documents folder. It aims to replace the drudgery of:
+
+ 1. comparing a zipped file to a detached statement
+ 2. downloading a public key
+ 3. confirming it is in fact the author's by reviewing public statements they've made, using it
+
+All in one simple command:
+
+```bash
+keybase dir verify
+```
+
+There are lots of options, including assertions for automating your checks.
+
+For more info, check out https://keybase.io/docs/command_line/code_signing
\ No newline at end of file
--- /dev/null
+;;; eliza.scm Dave Reed 1/28/03\r
+;;;\r
+;;; This program implements the Eliza psychologist as described in\r
+;;; "Paradigms in Artificial Intelligence Programming" by Norvig.\r
+;;; The call (eliza) starts up the psychologist and produces the\r
+;;; "Eliza>" prompt. The user then must type questions/statements to\r
+;;; which Eliza responds. As is, the user must type questions/statements\r
+;;; as words in a list (letter case is not important). Punctuation should\r
+;;; not be included, as this can sometimes impede matching. To stop the \r
+;;; program, the user must enter a BREAK. (Clearly, there are lots\r
+;;; of improvements to be made).\r
+;;;\r
+\r
+(define (eliza)\r
+ (begin (display 'Eliza>)\r
+ (display (apply-rule ELIZA-RULES (read)))\r
+ (newline)\r
+ (eliza)))\r
+\r
+(define (apply-rule rules input)\r
+ (let ((result (pattern-match (caar rules) input '())))\r
+ (if (equal? result 'failed) \r
+ (apply-rule (cdr rules) input)\r
+ (apply-substs (switch-viewpoint result)\r
+ (random-ele (cdar rules))))))\r
+\r
+(define (apply-substs substs target)\r
+ (cond ((null? target) '())\r
+ ((and (list? (car target)) (not (variable? (car target))))\r
+ (cons (apply-substs substs (car target))\r
+ (apply-substs substs (cdr target))))\r
+ (else (let ((value (assoc (car target) substs)))\r
+ (if (list? value)\r
+ (append (cddr value) \r
+ (apply-substs substs (cdr target)))\r
+ (cons (car target)\r
+ (apply-substs substs (cdr target))))))))\r
+\r
+(define (switch-viewpoint words)\r
+ (apply-substs '((i <-- you) (you <-- i) (me <-- you) \r
+ (you <-- me) (am <-- are) (are <-- am) \r
+ (my <-- your) (your <-- my)\r
+ (yourself <-- myself) (myself <-- yourself)) words))\r
+\r
+\r
+(define (variable? x)\r
+ (and (list? x) (equal? (car x) 'VAR)))\r
+\r
+\r
+\r
+;;;\r
+;;; This function performs pattern matching, where the pattern (containing\r
+;;; variables represented as (VAR X)) is matched with the input, resulting\r
+;;; in the appropriate substitutions.\r
+;;;\r
+\r
+(define (pattern-match pattern input substs)\r
+\r
+ (define (match-variable var input substs)\r
+ (let ((subst (assoc var substs)))\r
+ (cond ((equal? subst #f)\r
+ (if (symbol? input)\r
+ (cons (list var input) substs)\r
+ (cons (cons var (cons '<-- input)) substs)))\r
+ ((equal? input (cdr subst)) substs)\r
+ (else 'failed))))\r
+\r
+ (define (segment-match pattern input substs start)\r
+ (let ((var (car pattern)) (pat (cdr pattern)))\r
+ (if (null? pat)\r
+ (match-variable var input substs)\r
+ (let ((pos (position-from (car pat) input start)))\r
+ (if (zero? pos)\r
+ 'failed\r
+ (let ((b2 (pattern-match \r
+ pat\r
+ (subseq input pos (length input))\r
+ (match-variable \r
+ var \r
+ (subseq input 1 (- pos 1))\r
+ substs))))\r
+ (if (equal? b2 'failed)\r
+ (segment-match pattern input substs (+ pos 1))\r
+ b2)))))))\r
+\r
+ (cond\r
+ ((equal? substs 'failed) 'failed)\r
+ ((equal? pattern input) substs)\r
+ ((and (list? pattern) (not (null? pattern))\r
+ (variable? (car pattern)))\r
+ (segment-match pattern input substs 1))\r
+ ((and (list? pattern) (not (null? pattern))\r
+ (list? input) (not (null? input)))\r
+ (pattern-match (cdr pattern) (cdr input)\r
+ (pattern-match (car pattern) (car input) substs)))\r
+ (else 'failed)))\r
+\r
+\r
+\r
+;;;\r
+;;; Utilities\r
+;;;\r
+\r
+\r
+(define (random-ele elelist)\r
+ (list-ref elelist (random (length elelist))))\r
+\r
+(define (position-from ele elelist start)\r
+ (define (position-from-help count cdrlist)\r
+ (cond ((null? cdrlist) 0)\r
+ ((and (>= count start) (equal? ele (car cdrlist))) count)\r
+ (else (position-from-help (+ 1 count) (cdr cdrlist)))))\r
+ (position-from-help 1 elelist))\r
+\r
+(define (subseq elelist i j)\r
+ (define (subseq-help count cdrlist)\r
+ (cond ((or (null? cdrlist) (> count j)) '())\r
+ ((< count i) (subseq-help (+ 1 count) (cdr cdrlist)))\r
+ (else (cons (car cdrlist)\r
+ (subseq-help (+ 1 count) (cdr cdrlist))))))\r
+ (subseq-help 1 elelist))\r
+\r
+\r
+\r
+;;;\r
+;;; These are the original rules for the Eliza pyschologist as described in\r
+;;; "Paradigms in Artificial Intelligence Programming" by Norvig. \r
+;;;\r
+\r
+(define ELIZA-RULES\r
+ '((((VAR X) hello (VAR Y))\r
+ (how do you do. please state your problem))\r
+ (((VAR X) computer (VAR Y))\r
+ (do computers worry you)\r
+ (what do you think about machines)\r
+ (why do you mention computers)\r
+ (what do you think machines have to do with your problem))\r
+ (((VAR X) name (VAR Y))\r
+ (i am not interested in names))\r
+ (((VAR X) sorry (VAR Y))\r
+ (please don't apologize)\r
+ (apologies are not necessary)\r
+ (what feelings do you have when you apologize))\r
+ (((VAR X) i remember (VAR Y))\r
+ (do you often think of (VAR Y))\r
+ (does thinking of (VAR Y) bring anything else to mind)\r
+ (what else do you remember?)\r
+ (why do you recall (VAR Y) right now)\r
+ (what in this present situation reminds you of (VAR Y))\r
+ (what is the connection between me and (VAR Y)))\r
+ (((VAR X) do you remember (VAR Y))\r
+ (did you think i would forget (VAR Y))\r
+ (why do you think i should recall (VAR Y))\r
+ (what about (VAR Y))\r
+ (you mentioned (VAR Y)))\r
+ (((VAR X) if (VAR Y))\r
+ (do you really think it is likely that (VAR Y))\r
+ (do you wish that (VAR Y))\r
+ (what do you think about (VAR Y))\r
+ (really -- if (VAR Y)))\r
+ (((VAR X) i dreamt (VAR Y))\r
+ (really -- (VAR Y))\r
+ (have you ever fantasized (VAR Y) while you were awake)\r
+ (have you dreamt (VAR Y) before))\r
+ (((VAR X) i dreamed (VAR Y))\r
+ (really -- (VAR Y))\r
+ (have you ever fantasized (VAR Y) while you were awake)\r
+ (have you dreamed (VAR Y) before))\r
+ (((VAR X) dream (VAR Y))\r
+ (what does this dream suggest to you)\r
+ (do you dream often)\r
+ (what persons appear in your dreams)\r
+ (don't you believe that dream has to do with your problem))\r
+ (((VAR X) my mother (VAR Y))\r
+ (who else is in your family (VAR Y))\r
+ (tell me more about your family))\r
+ (((VAR X) my father (VAR Y))\r
+ (your father)\r
+ (does he influence you strongly)\r
+ (what else comes to mind when you think of your father))\r
+ (((VAR X) i want (VAR Y))\r
+ (what would it mean if you got (VAR Y))\r
+ (why do you want (VAR Y))\r
+ (suppose you got (VAR Y) soon))\r
+ (((VAR X) i am glad (VAR Y))\r
+ (how have i helped you to be (VAR Y))\r
+ (what makes you happy just now)\r
+ (can you explain why you are suddenly (VAR Y)))\r
+ (((VAR X) i am happy (VAR Y))\r
+ (how have i helped you to be (VAR Y))\r
+ (what makes you glad just now)\r
+ (can you explain why you are suddenly (VAR Y)))\r
+ (((VAR X) i am sad (VAR Y))\r
+ (i am sorry to hear you are depressed)\r
+ (i'm sure it's not pleasant to be sad))\r
+ (((VAR X) i am unhappy (VAR Y))\r
+ (i am sorry to hear you are depressed)\r
+ (i'm sure it's not pleasant to be unhappy))\r
+ (((VAR X) are like (VAR Y))\r
+ (what resemblence do you see between (VAR X) and (VAR Y)))\r
+ (((VAR X) is like (VAR Y))\r
+ (in what way is it that (VAR X) is like (VAR Y))\r
+ (what resemblence do you see)\r
+ (could there really be some connection)\r
+ (how))\r
+ (((VAR X) alike (VAR Y))\r
+ (in what way)\r
+ (what similarities are there))\r
+ (((VAR X) same (VAR Y))\r
+ (what other connections do you see))\r
+ (((VAR X) i was (VAR Y))\r
+ (were you really)\r
+ (perhaps i already knew you were (VAR Y))\r
+ (why do you tell me you were (VAR Y) now))\r
+ (((VAR X) was i (VAR Y))\r
+ (what if you were (VAR Y))\r
+ (do you think you were (VAR Y))\r
+ (what would it mean if you were (VAR Y)))\r
+ (((VAR X) i am (VAR Y))\r
+ (in what way are you (VAR Y))\r
+ (do you want to be (VAR Y)))\r
+ (((VAR X) am i (VAR Y))\r
+ (do you believe you are (VAR Y))\r
+ (would you want to be (VAR Y))\r
+ (you wish i would tell you you are (VAR Y))\r
+ (what would it mean if you were (VAR Y)))\r
+ (((VAR X) am (VAR Y))\r
+ (why do you say "am")\r
+ (i don't understand that))\r
+ (((VAR X) are you (VAR Y))\r
+ (why are you interested in whether i am (VAR Y) or not)\r
+ (would you prefer it if i weren't (VAR Y))\r
+ (perhaps i am (VAR Y) in your fantasies))\r
+ (((VAR X) you are (VAR Y))\r
+ (what makes you think i am (VAR Y)))\r
+ (((VAR X) because (VAR Y))\r
+ (is that the real reason)\r
+ (what other reason might there be)\r
+ (does that reason seem to explain anything else))\r
+ (((VAR X) were you (VAR Y))\r
+ (perhaps i was (VAR Y))\r
+ (what do you think)\r
+ (what if i had been (VAR Y)))\r
+ (((VAR X) i can't (VAR Y))\r
+ (maybe you could (VAR Y) now)\r
+ (what if you could (VAR Y)))\r
+ (((VAR X) i feel (VAR Y))\r
+ (do you often feel (VAR Y)))\r
+ (((VAR X) i felt (VAR Y))\r
+ (what other feelings do you have))\r
+ (((VAR X) i (VAR Y) you (VAR Z))\r
+ (perhaps in your fantasies we (VAR Y) each other))\r
+ (((VAR X) why don't you (VAR Y))\r
+ (should you (VAR Y) yourself)\r
+ (do you believe i don't (VAR Y))\r
+ (perhaps i will (VAR Y) in good time))\r
+ (((VAR X) yes (VAR Y))\r
+ (you seem quite positive)\r
+ (you are sure)\r
+ (i understand))\r
+ (((VAR X) no (VAR Y))\r
+ (why not)\r
+ (you are being a bit negative)\r
+ (are you saying "no" just to be negative))\r
+ (((VAR X) someone (VAR Y))\r
+ (can you be more specific))\r
+ (((VAR X) everyone (VAR Y))\r
+ (surely not everyone)\r
+ (can you think of anyone in particular)\r
+ (who for example)\r
+ (you are thinking of a special person))\r
+ (((VAR X) always (VAR Y))\r
+ (can you think of a specific example)\r
+ (when)\r
+ (what incident are you thinking of)\r
+ (really -- always))\r
+ (((VAR X) what (VAR Y))\r
+ (why do you ask)\r
+ (does that question interest you)\r
+ (what is it you really want to know)\r
+ (what do you think)\r
+ (what comes to your mind when you ask that))\r
+ (((VAR X) perhaps (VAR Y))\r
+ (you do not seem quite certain))\r
+ (((VAR X) are (VAR Y))\r
+ (do you think they might not be (VAR Y))\r
+ (possibly they are (VAR Y)))\r
+ (((VAR X))\r
+ (very interesting)\r
+ (i am not sure i understand you fully)\r
+ (what does that suggest to you)\r
+ (please continue)\r
+ (go on)\r
+ (do you feel strongly about discussing such things))))\r
+\r
--- /dev/null
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "import yaml"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "[{'pattern': '?X hello ?Y',\n",
+ " 'responses': ['how do you do. please state your problem']},\n",
+ " {'pattern': '?X computer ?Y',\n",
+ " 'responses': ['do computers worry you',\n",
+ " 'what do you think about machines',\n",
+ " 'why do you mention computers',\n",
+ " 'what do you think machines have to do with your problem']},\n",
+ " {'pattern': '?X name ?Y', 'responses': ['i am not interested in names']},\n",
+ " {'pattern': '?X sorry ?Y',\n",
+ " 'responses': [\"please don't apologize\",\n",
+ " 'apologies are not necessary',\n",
+ " 'what feelings do you have when you apologize']},\n",
+ " {'pattern': '?X i remember ?Y',\n",
+ " 'responses': ['do you often think of ?Y',\n",
+ " 'does thinking of ?Y bring anything else to mind',\n",
+ " 'what else do you remember?',\n",
+ " 'why do you recall ?Y right now',\n",
+ " 'what in this present situation reminds you of ?Y',\n",
+ " 'what is the connection between me and ?Y']},\n",
+ " {'pattern': '?X do you remember ?Y',\n",
+ " 'responses': ['did you think i would forget ?Y',\n",
+ " 'why do you think i should recall ?Y',\n",
+ " 'what about ?Y',\n",
+ " 'you mentioned ?Y']},\n",
+ " {'pattern': '?X if ?Y',\n",
+ " 'responses': ['do you really think it is likely that ?Y',\n",
+ " 'do you wish that ?Y',\n",
+ " 'what do you think about ?Y',\n",
+ " 'really -- if ?Y']},\n",
+ " {'pattern': '?X i dreamt ?Y',\n",
+ " 'responses': ['really -- ?Y',\n",
+ " 'have you ever fantasized ?Y while you were awake',\n",
+ " 'have you dreamt ?Y before']},\n",
+ " {'pattern': '?X i dreamed ?Y',\n",
+ " 'responses': ['really -- ?Y',\n",
+ " 'have you ever fantasized ?Y while you were awake',\n",
+ " 'have you dreamed ?Y before']},\n",
+ " {'pattern': '?X dream ?Y',\n",
+ " 'responses': ['what does this dream suggest to you',\n",
+ " 'do you dream often',\n",
+ " 'what persons appear in your dreams',\n",
+ " \"don't you believe that dream has to do with your problem\"]},\n",
+ " {'pattern': '?X my mother ?Y',\n",
+ " 'responses': ['who else is in your family ?Y',\n",
+ " 'tell me more about your family']},\n",
+ " {'pattern': '?X my father ?Y',\n",
+ " 'responses': ['your father',\n",
+ " 'does he influence you strongly',\n",
+ " 'what else comes to mind when you think of your father']},\n",
+ " {'pattern': '?X i want ?Y',\n",
+ " 'responses': ['what would it mean if you got ?Y',\n",
+ " 'why do you want ?Y',\n",
+ " 'suppose you got ?Y soon']},\n",
+ " {'pattern': '?X i am glad ?Y',\n",
+ " 'responses': ['how have i helped you to be ?Y',\n",
+ " 'what makes you happy just now',\n",
+ " 'can you explain why you are suddenly ?Y']},\n",
+ " {'pattern': '?X i am happy ?Y',\n",
+ " 'responses': ['how have i helped you to be ?Y',\n",
+ " 'what makes you glad just now',\n",
+ " 'can you explain why you are suddenly ?Y']},\n",
+ " {'pattern': '?X i am sad ?Y',\n",
+ " 'responses': ['i am sorry to hear you are depressed',\n",
+ " \"i'm sure it's not pleasant to be sad\"]},\n",
+ " {'pattern': '?X i am unhappy ?Y',\n",
+ " 'responses': ['i am sorry to hear you are depressed',\n",
+ " \"i'm sure it's not pleasant to be unhappy\"]},\n",
+ " {'pattern': '?X are like ?Y',\n",
+ " 'responses': ['what resemblence do you see between ?X and ?Y']},\n",
+ " {'pattern': '?X is like ?Y',\n",
+ " 'responses': ['in what way is it that ?X is like ?Y',\n",
+ " 'what resemblence do you see',\n",
+ " 'could there really be some connection',\n",
+ " 'how']},\n",
+ " {'pattern': '?X alike ?Y',\n",
+ " 'responses': ['in what way', 'what similarities are there']},\n",
+ " {'pattern': '?X same ?Y', 'responses': ['what other connections do you see']},\n",
+ " {'pattern': '?X i was ?Y',\n",
+ " 'responses': ['were you really',\n",
+ " 'perhaps i already knew you were ?Y',\n",
+ " 'why do you tell me you were ?Y now']},\n",
+ " {'pattern': '?X was i ?Y',\n",
+ " 'responses': ['what if you were ?Y',\n",
+ " 'do you think you were ?Y',\n",
+ " 'what would it mean if you were ?Y']},\n",
+ " {'pattern': '?X i am ?Y',\n",
+ " 'responses': ['in what way are you ?Y', 'do you want to be ?Y']},\n",
+ " {'pattern': '?X am i ?Y',\n",
+ " 'responses': ['do you believe you are ?Y',\n",
+ " 'would you want to be ?Y',\n",
+ " 'you wish i would tell you you are ?Y',\n",
+ " 'what would it mean if you were ?Y']},\n",
+ " {'pattern': '?X am ?Y',\n",
+ " 'responses': ['why do you say \"am\"', \"i don't understand that\"]},\n",
+ " {'pattern': '?X are you ?Y',\n",
+ " 'responses': ['why are you interested in whether i am ?Y or not',\n",
+ " \"would you prefer it if i weren't ?Y\",\n",
+ " 'perhaps i am ?Y in your fantasies']},\n",
+ " {'pattern': '?X you are ?Y', 'responses': ['what makes you think i am ?Y']},\n",
+ " {'pattern': '?X because ?Y',\n",
+ " 'responses': ['is that the real reason',\n",
+ " 'what other reason might there be',\n",
+ " 'does that reason seem to explain anything else']},\n",
+ " {'pattern': '?X were you ?Y',\n",
+ " 'responses': ['perhaps i was ?Y',\n",
+ " 'what do you think',\n",
+ " 'what if i had been ?Y']},\n",
+ " {'pattern': \"?X i can't ?Y\",\n",
+ " 'responses': ['maybe you could ?Y now', 'what if you could ?Y']},\n",
+ " {'pattern': '?X i feel ?Y', 'responses': ['do you often feel ?Y']},\n",
+ " {'pattern': '?X i felt ?Y', 'responses': ['what other feelings do you have']},\n",
+ " {'pattern': '?X i ?Y you ?Z',\n",
+ " 'responses': ['perhaps in your fantasies we ?Y each other']},\n",
+ " {'pattern': \"?X why don't you ?Y\",\n",
+ " 'responses': ['should you ?Y yourself',\n",
+ " \"do you believe i don't ?Y\",\n",
+ " 'perhaps i will ?Y in good time']},\n",
+ " {'pattern': '?X yes ?Y',\n",
+ " 'responses': ['you seem quite positive', 'you are sure', 'i understand']},\n",
+ " {'pattern': '?X no ?Y',\n",
+ " 'responses': ['why not',\n",
+ " 'you are being a bit negative',\n",
+ " 'are you saying \"no\" just to be negative']},\n",
+ " {'pattern': '?X someone ?Y', 'responses': ['can you be more specific']},\n",
+ " {'pattern': '?X everyone ?Y',\n",
+ " 'responses': ['surely not everyone',\n",
+ " 'can you think of anyone in particular',\n",
+ " 'who for example',\n",
+ " 'you are thinking of a special person']},\n",
+ " {'pattern': '?X always ?Y',\n",
+ " 'responses': ['can you think of a specific example',\n",
+ " 'when',\n",
+ " 'what incident are you thinking of',\n",
+ " 'really -- always']},\n",
+ " {'pattern': '?X what ?Y',\n",
+ " 'responses': ['why do you ask',\n",
+ " 'does that question interest you',\n",
+ " 'what is it you really want to know',\n",
+ " 'what do you think',\n",
+ " 'what comes to your mind when you ask that']},\n",
+ " {'pattern': '?X perhaps ?Y', 'responses': ['you do not seem quite certain']},\n",
+ " {'pattern': '?X are ?Y',\n",
+ " 'responses': ['do you think they might not be ?Y', 'possibly they are ?Y']},\n",
+ " {'pattern': '?X',\n",
+ " 'responses': ['very interesting',\n",
+ " 'i am not sure i understand you fully',\n",
+ " 'what does that suggest to you',\n",
+ " 'please continue',\n",
+ " 'go on',\n",
+ " 'do you feel strongly about discussing such things']}]"
+ ]
+ },
+ "execution_count": 2,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "with open('rules.yaml') as f:\n",
+ " rules = yaml.load(f)\n",
+ "rules"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.4.3"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
--- /dev/null
+- pattern: ?X hello ?Y
+ responses:
+ - how do you do. please state your problem
+
+- pattern: ?X computer ?Y
+ responses:
+ - do computers worry you
+ - what do you think about machines
+ - why do you mention computers
+ - what do you think machines have to do with your problem
+
+- pattern: ?X name ?Y
+ responses:
+ - i am not interested in names
+
+- pattern: ?X sorry ?Y
+ responses:
+ - please don't apologize
+ - apologies are not necessary
+ - what feelings do you have when you apologize
+
+- pattern: ?X i remember ?Y
+ responses:
+ - do you often think of ?Y
+ - does thinking of ?Y bring anything else to mind
+ - what else do you remember?
+ - why do you recall ?Y right now
+ - what in this present situation reminds you of ?Y
+ - what is the connection between me and ?Y
+
+- pattern: ?X do you remember ?Y
+ responses:
+ - did you think i would forget ?Y
+ - why do you think i should recall ?Y
+ - what about ?Y
+ - you mentioned ?Y
+
+- pattern: ?X if ?Y
+ responses:
+ - do you really think it is likely that ?Y
+ - do you wish that ?Y
+ - what do you think about ?Y
+ - really -- if ?Y
+
+- pattern: ?X i dreamt ?Y
+ responses:
+ - really -- ?Y
+ - have you ever fantasized ?Y while you were awake
+ - have you dreamt ?Y before
+
+- pattern: ?X i dreamed ?Y
+ responses:
+ - really -- ?Y
+ - have you ever fantasized ?Y while you were awake
+ - have you dreamed ?Y before
+
+- pattern: ?X dream ?Y
+ responses:
+ - what does this dream suggest to you
+ - do you dream often
+ - what persons appear in your dreams
+ - don't you believe that dream has to do with your problem
+
+- pattern: ?X my mother ?Y
+ responses:
+ - who else is in your family ?Y
+ - tell me more about your family
+
+- pattern: ?X my father ?Y
+ responses:
+ - your father
+ - does he influence you strongly
+ - what else comes to mind when you think of your father
+
+- pattern: ?X i want ?Y
+ responses:
+ - what would it mean if you got ?Y
+ - why do you want ?Y
+ - suppose you got ?Y soon
+
+- pattern: ?X i am glad ?Y
+ responses:
+ - how have i helped you to be ?Y
+ - what makes you happy just now
+ - can you explain why you are suddenly ?Y
+
+- pattern: ?X i am happy ?Y
+ responses:
+ - how have i helped you to be ?Y
+ - what makes you glad just now
+ - can you explain why you are suddenly ?Y
+
+- pattern: ?X i am sad ?Y
+ responses:
+ - i am sorry to hear you are depressed
+ - i'm sure it's not pleasant to be sad
+
+- pattern: ?X i am unhappy ?Y
+ responses:
+ - i am sorry to hear you are depressed
+ - i'm sure it's not pleasant to be unhappy
+
+- pattern: ?X are like ?Y
+ responses:
+ - what resemblence do you see between ?X and ?Y
+
+- pattern: ?X is like ?Y
+ responses:
+ - in what way is it that ?X is like ?Y
+ - what resemblence do you see
+ - could there really be some connection
+ - how
+
+- pattern: ?X alike ?Y
+ responses:
+ - in what way
+ - what similarities are there
+
+- pattern: ?X same ?Y
+ responses:
+ - what other connections do you see
+
+- pattern: ?X i was ?Y
+ responses:
+ - were you really
+ - perhaps i already knew you were ?Y
+ - why do you tell me you were ?Y now
+
+- pattern: ?X was i ?Y
+ responses:
+ - what if you were ?Y
+ - do you think you were ?Y
+ - what would it mean if you were ?Y
+
+- pattern: ?X i am ?Y
+ responses:
+ - in what way are you ?Y
+ - do you want to be ?Y
+
+- pattern: ?X am i ?Y
+ responses:
+ - do you believe you are ?Y
+ - would you want to be ?Y
+ - you wish i would tell you you are ?Y
+ - what would it mean if you were ?Y
+
+- pattern: ?X am ?Y
+ responses:
+ - why do you say "am"
+ - i don't understand that
+
+- pattern: ?X are you ?Y
+ responses:
+ - why are you interested in whether i am ?Y or not
+ - would you prefer it if i weren't ?Y
+ - perhaps i am ?Y in your fantasies
+
+- pattern: ?X you are ?Y
+ responses:
+ - what makes you think i am ?Y
+
+- pattern: ?X because ?Y
+ responses:
+ - is that the real reason
+ - what other reason might there be
+ - does that reason seem to explain anything else
+
+- pattern: ?X were you ?Y
+ responses:
+ - perhaps i was ?Y
+ - what do you think
+ - what if i had been ?Y
+
+- pattern: ?X i can't ?Y
+ responses:
+ - maybe you could ?Y now
+ - what if you could ?Y
+
+- pattern: ?X i feel ?Y
+ responses:
+ - do you often feel ?Y
+
+- pattern: ?X i felt ?Y
+ responses:
+ - what other feelings do you have
+
+- pattern: ?X i ?Y you ?Z
+ responses:
+ - perhaps in your fantasies we ?Y each other
+
+- pattern: ?X why don't you ?Y
+ responses:
+ - should you ?Y yourself
+ - do you believe i don't ?Y
+ - perhaps i will ?Y in good time
+
+- pattern: ?X yes ?Y
+ responses:
+ - you seem quite positive
+ - you are sure
+ - i understand
+
+- pattern: ?X no ?Y
+ responses:
+ - why not
+ - you are being a bit negative
+ - are you saying "no" just to be negative
+
+- pattern: ?X someone ?Y
+ responses:
+ - can you be more specific
+
+- pattern: ?X everyone ?Y
+ responses:
+ - surely not everyone
+ - can you think of anyone in particular
+ - who for example
+ - you are thinking of a special person
+
+- pattern: ?X always ?Y
+ responses:
+ - can you think of a specific example
+ - when
+ - what incident are you thinking of
+ - really -- always
+
+- pattern: ?X what ?Y
+ responses:
+ - why do you ask
+ - does that question interest you
+ - what is it you really want to know
+ - what do you think
+ - what comes to your mind when you ask that
+
+- pattern: ?X perhaps ?Y
+ responses:
+ - you do not seem quite certain
+
+- pattern: ?X are ?Y
+ responses:
+ - do you think they might not be ?Y
+ - possibly they are ?Y
+
+- pattern: ?X
+ responses:
+ - very interesting
+ - i am not sure i understand you fully
+ - what does that suggest to you
+ - please continue
+ - go on
+ - do you feel strongly about discussing such things
+
+
+