Skip to content

Commit

Permalink
Wide range of changes including defects fixes, including stopping rec…
Browse files Browse the repository at this point in the history
…ursive looop if no answer found

Introduction of first and rest and also built in tags such as next and prev
This also starts to move closer to full AIML 2.0 compliance measured against Rosebot 2.0 from Pandora bots ( which is not fun to work with )
  • Loading branch information
keiffster committed Jan 16, 2017
1 parent f0a7eb3 commit e514b02
Show file tree
Hide file tree
Showing 190 changed files with 185,831 additions and 388 deletions.
9 changes: 9 additions & 0 deletions bots/alice2/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Alice2 grammar is the base grammar that shipped with Program-A the AIML 2. reference implementation written in
Java.

Its included in this project for completeness only and is not guaranteed to work at this time until, full testing
of both the grammar and Program-Y implemented is finished

If its anything like Alice, then its unlikely to be fully functional and will have broken and missing grammars

K
74 changes: 37 additions & 37 deletions bots/alice2/aiml/dialog.aiml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<aiml>
<!-- File: dialog.aiml -->
<!-- Author: Dr. Richard S. Wallace -->
<!-- Last modified: July 19, 2014 -->
<!-- -->
<!-- This AIML file is part of the ALICE2 0.0.5 chat bot knowledge base. -->
<!-- -->
<!-- The ALICE2 brain is Copyright &copy; 2014 by ALICE AI Foundation. -->
<!-- -->
<!-- The ALICE2 brain is released under the terms of the GNU Lesser General -->
<!-- Public License, as published by the Free Software Foundation. -->
<!-- -->
<!-- This file is distributed WITHOUT ANY WARRANTY; without even the -->
<!-- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -->
<!-- -->
<!-- For more information see http://www.alicebot.org -->
<!-- -->
<category><pattern>CLEAR DIALOG HISTORY</pattern>
<?xml version="1.0" encoding="UTF-8"?>
<aiml>
<!-- File: dialog.tests -->
<!-- Author: Dr. Richard S. Wallace -->
<!-- Last modified: July 19, 2014 -->
<!-- -->
<!-- This AIML file is part of the ALICE2 0.0.5 chat bot knowledge base. -->
<!-- -->
<!-- The ALICE2 brain is Copyright &copy; 2014 by ALICE AI Foundation. -->
<!-- -->
<!-- The ALICE2 brain is released under the terms of the GNU Lesser General -->
<!-- Public License, as published by the Free Software Foundation. -->
<!-- -->
<!-- This file is distributed WITHOUT ANY WARRANTY; without even the -->
<!-- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -->
<!-- -->
<!-- For more information see http://www.alicebot.org -->
<!-- -->
<category><pattern>CLEAR DIALOG HISTORY</pattern>
<template>Cleared.
<think>
<set name="response1"/>
Expand Down Expand Up @@ -81,25 +81,25 @@
<set name="request30"/>
<set name="response31"/>
<set name="request31"/>
</think></template>
</category>
<category><pattern>XEXCHANGE *</pattern>
<template><think>Badly formatted dialog exchage: <star/></think></template>
</category>
<category><pattern>XEXCHANGE * XHUMAN * XBOT SENDING TRANSCRIPT *</pattern>
<template><think>Badly formatted dialog exchage: <star/></think></template>
</category>
<category><pattern>XEXCHANGE * XHUMAN * XBOT *</pattern>
</think></template>
</category>
<category><pattern>XEXCHANGE *</pattern>
<template><think>Badly formatted dialog exchage: <star/></think></template>
</category>
<category><pattern>XEXCHANGE * XHUMAN * XBOT SENDING TRANSCRIPT *</pattern>
<template><think>Badly formatted dialog exchage: <star/></think></template>
</category>
<category><pattern>XEXCHANGE * XHUMAN * XBOT *</pattern>
<template><think>
<set name="request"><star index="2"/></set>
<set name="response"><star index="3"/></set>
</think>
<condition name="request"><li value="unknown"/>
<li><get name="name"/>: <get name="request"/>
<bot name="name"/>: <get name="response"/></li>
</condition></template>
</category>
<category><pattern>DIALOG HISTORY</pattern>
</condition></template>
</category>
<category><pattern>DIALOG HISTORY</pattern>
<template><srai>XEXCHANGE request31 XHUMAN <request index="31"/> XBOT <response index="31"/></srai>
<srai>XEXCHANGE request30 XHUMAN <request index="30"/> XBOT <response index="30"/></srai>
<srai>XEXCHANGE request29 XHUMAN <request index="29"/> XBOT <response index="29"/></srai>
Expand Down Expand Up @@ -130,11 +130,11 @@
<srai>XEXCHANGE request4 XHUMAN <request index="4"/> XBOT <response index="4"/></srai>
<srai>XEXCHANGE request3 XHUMAN <request index="3"/> XBOT <response index="3"/></srai>
<srai>XEXCHANGE request2 XHUMAN <request index="2"/> XBOT <response index="2"/></srai>
<srai>XEXCHANGE request1 XHUMAN <request index="1"/> XBOT <response index="1"/></srai></template>
</category>
<category><pattern>TEST REQUEST *</pattern>
<srai>XEXCHANGE request1 XHUMAN <request index="1"/> XBOT <response index="1"/></srai></template>
</category>
<category><pattern>TEST REQUEST *</pattern>
<template>request 1 = <request/>.
request 2 = <request index="2"/>.
request 3 = <request index="3"/>.</template>
</category>
</aiml>
request 3 = <request index="3"/>.</template>
</category>
</aiml>
8 changes: 8 additions & 0 deletions bots/alice2/alice2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#! /bin/sh

clear

export PYTHONPATH=../../src/

python3 ../../src/programy/clients/console.py --config ./config.yaml --cformat yaml --logging ./logging.yaml --debug

8 changes: 8 additions & 0 deletions bots/alice2/alice2_rest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#! /bin/sh

clear

export PYTHONPATH=../../src/

python3 ../../src/programy/clients/rest.py --config ./config.yaml --cformat yaml --logging ./logging.yaml --debug

8 changes: 7 additions & 1 deletion bots/alice2/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,10 @@ bot:
prompt: ">>>"
initial_question: Hi, how can I help you today?
default_response: Sorry, I don't have an answer for that!
exit_response: So long, and thanks for the fish!
exit_response: So long, and thanks for the fish!

rest:
host: 127.0.0.1
port: 5000
debug: true
use_api_keys: false
7 changes: 7 additions & 0 deletions bots/rosie/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This is the original Rosie AIML, produced by Pandora Bots, and hosted on GitHib https://github.com/pandorabots/rosie

Its broken, out of date and does not fully work. However it is included in Program-Y for completeness

If you are looking for a corrected version then check out rosie_fixed which is a fully working set of grammars
based on rosie AIML files

2 changes: 1 addition & 1 deletion bots/rosie/aiml/dialog.aiml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<aiml>
<!-- File: dialog.aiml -->
<!-- File: dialog.tests -->
<!-- Last modified: September 5, 2014 -->
<!-- -->
<!-- This AIML file is part of the Rosie knowledge base. -->
Expand Down
8 changes: 8 additions & 0 deletions bots/rosie/rosie.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#! /bin/sh

clear

export PYTHONPATH=../../src/

python3 ../../src/programy/clients/console.py --config ./config.yaml --cformat yaml --logging ./logging.yaml --debug

32 changes: 32 additions & 0 deletions bots/rosie_fixed/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
The original Rosie AIML is produced by Pandora Bots, and hosted on GitHib https://github.com/pandorabots/rosie

Unfortunately its broken in many ways, grammars are missing, srai tags don't work properly and there are conflicting grammars

This project is therefore an attempt to provide a grammar, based on Rosie that can be an actual base for someone to
use when building their own Chatbot

This README will contain a history of the issues found and the fixes applied

------------------------------------------------------

1) Missing grammars
SOUND is missing
Added mapping file for animal:sound
Added mapping file for animal:legs
Modified grammars so that SOUND and LEGS now work

2) Built in maps, not defined in spec

Pandora, who built rosie have a number of in built maps, the 2 primary ones are
successor and predecessor which turn the next or previous integer respectively

3) Built in set, not defined in spec

Pandora who built rosie, have a number of in built sets, primary one is number
which checks if text passed in is numeric

Added successor map
Added predecessor map
Added singular map -> Also singular mapping file
Added plural map -> Also singular plural file

160 changes: 160 additions & 0 deletions bots/rosie_fixed/aiml/animal.aiml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
<?xml version="1.0" encoding="UTF-8"?>
<aiml>
<!-- File: animal.aiml -->
<!-- Last modified: September 5, 2014 -->
<!-- -->
<!-- This AIML file is part of the Rosie knowledge base. -->
<!-- -->
<!-- Rosie is a fork of the ALICE2 brain, and is optimized for use on the Pandorabots platform -->
<!-- -->
<!-- Rosie is Copyright &copy; 2014 by Pandorabots, Inc. -->
<!-- -->
<!-- The Rosie brain is released under the terms of the GNU Lesser General -->
<!-- Public License, as published by the Free Software Foundation. -->
<!-- -->
<!-- This file is distributed WITHOUT ANY WARRANTY; without even the -->
<!-- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -->
<!-- -->
<!-- For more information: -->
<!-- http://www.pandorabots.com -->
<!-- http://www.alicebot.org -->
<!-- -->

<category>
<pattern>WHAT DOES A <set>animal</set> SAY ^
</pattern>
<template>
<srai>SOUND
<star/>
</srai>
</template>
</category>
<category>
<pattern>WHAT DO <set>animals</set> SAY ^
</pattern>
<template>
<srai>SOUND
<srai>SINGULAR
<star/>
</srai>
</srai>
</template>
</category>
<category>
<pattern>WHAT SOUND DOES # <set>animal</set> ^
</pattern>
<template>
<srai>SOUND
<star index="2"/>
</srai>
</template>
</category>
<category>
<pattern>WHAT SOUND DO <set>animal</set> ^
</pattern>
<template>
<srai>SOUND
<srai>SINGULAR
<star index="1"/>
</srai>
</srai>
</template>
</category>
<category>
<pattern>HOW DOES # <set>animal</set> ^
</pattern>
<template>
<srai>SOUND
<star index="2"/>
</srai>
</template>
</category>

<category>
<pattern>HOW MANY LEGS DOES ^ <set>animal</set> #
</pattern>
<template>
<srai>LEGS
<star index="2"/>
</srai>
</template>
</category>
<category>
<pattern>HOW MANY LEGS ^ <set>animal</set> #
</pattern>
<template>
<srai>LEGS
<srai>SINGULAR <star index="2"/></srai>
</srai>
</template>
</category>
<category>
<pattern>HOW MANY LEGS ^ <set>animals</set> #
</pattern>
<template>
<srai>LEGS
<srai>SINGULAR <star index="2"/></srai>
</srai>
</template>
</category>

<category>
<pattern>_ 1 <set>animal</set> *
</pattern>
<template>
<srai>
<star/>
1
<srai>PLURAL
<star index="2"/>
</srai>
<star index="3"/>
</srai>
</template>
</category>

<category>
<pattern>_ 1
<set>animal</set>
</pattern>
<template>
<srai>
<star/>
1
<srai>PLURAL
<star index="2"/>
</srai>
</srai>
</template>
</category>

<category>
<pattern>SOUND *</pattern>
<template>
A <star/> makes a <map name="animalsounds"><star/></map> sound.
</template>
</category>

<category>
<pattern>LEGS *</pattern>
<template>
A <star/> has <map name="animallegs"><star/></map> legs.
</template>
</category>

<category>
<pattern>SINGULAR *</pattern>
<template>
<map name="singular"><star/></map>
</template>
</category>

<category>
<pattern>PLURAL *</pattern>
<template>
<map name="plural"><star/></map>
</template>
</category>


</aiml>

0 comments on commit e514b02

Please sign in to comment.