Skip to content
This repository was archived by the owner on Jun 24, 2024. It is now read-only.

Commit e0c71cb

Browse files
committed
first commit
0 parents  commit e0c71cb

File tree

121 files changed

+59152
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+59152
-0
lines changed

.classpath

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
5+
<classpathentry kind="lib" path="C:/Devel/Eclipse/workspace/libs/core.jar" sourcepath="/core"/>
6+
<classpathentry kind="lib" path="C:/Devel/Eclipse/workspace/libs/console.jar"/>
7+
<classpathentry kind="lib" path="C:/Devel/Eclipse/workspace/libs/consoleCallBacks.jar"/>
8+
<classpathentry kind="lib" path="C:/Devel/Eclipse/workspace/libs/Ice.jar"/>
9+
<classpathentry kind="lib" path="C:/Devel/Eclipse/workspace/libs/rebecca-network.jar"/>
10+
<classpathentry kind="output" path="bin"/>
11+
</classpath>

.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>ChatBots</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>

.settings/org.eclipse.jdt.core.prefs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#Tue Dec 23 18:02:24 PST 2008
2+
eclipse.preferences.version=1
3+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
4+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
5+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6+
org.eclipse.jdt.core.compiler.compliance=1.5
7+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
9+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12+
org.eclipse.jdt.core.compiler.source=1.5

examples/AliceChat/AliceChat.pde

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*
2+
A little example using the classic "Eliza" program.
3+
4+
Eliza was compiled as a Processing library, based on the
5+
java source code by Charles Hayden:
6+
htp://www.chayden.net/eliza/Eliza.html
7+
8+
The default script that determines Eliza's behaviour can be
9+
changed with the readScript() function.
10+
Intructions to modify the script file are available here:
11+
http://www.chayden.net/eliza/instructions.txt
12+
*/
13+
14+
import codeanticode.chatbots.rebecca.*;
15+
16+
Rebecca alice;
17+
PFont font;
18+
String elizaResponse, humanResponse;
19+
boolean showCursor;
20+
int lastTime;
21+
22+
void setup()
23+
{
24+
size(400, 400);
25+
26+
// When Eliza is initialized, a default script built into the
27+
// library is loaded.
28+
alice = new Rebecca(this, "alice");
29+
30+
// A new script can be loaded through the readScript function.
31+
// It can take local as well as remote files.
32+
//eliza.readScript("script");
33+
//eliza.readScript("http://chayden.net/eliza/script");
34+
35+
// To go back to the default script, use this:
36+
//eliza.readDefaultScript();
37+
38+
font = loadFont("Rockwell-24.vlw");
39+
textFont(font);
40+
41+
printAliceIntro();
42+
humanResponse = "";
43+
showCursor = true;
44+
lastTime = 0;
45+
}
46+
47+
void draw()
48+
{
49+
background(102);
50+
51+
fill(255);
52+
text(elizaResponse, 10, 50, width - 40, height);
53+
54+
fill(0);
55+
56+
int t = millis();
57+
if (t - lastTime > 500)
58+
{
59+
showCursor = !showCursor;
60+
lastTime = t;
61+
}
62+
63+
if (showCursor) text(humanResponse + "_", 10, 150, width - 40, height);
64+
else text(humanResponse, 10, 150, width - 40, height);
65+
}
66+
67+
void keyPressed()
68+
{
69+
if ((key == ENTER) || (key == RETURN))
70+
{
71+
println(humanResponse);
72+
elizaResponse = alice.processInput(humanResponse);
73+
println(">> " + elizaResponse);
74+
humanResponse = "";
75+
}
76+
else if ((key > 31) && (key != CODED))
77+
{
78+
// If the key is alphanumeric, add it to the String
79+
humanResponse = humanResponse + key;
80+
}
81+
else if ((key == BACKSPACE) && (0 < humanResponse.length()))
82+
{
83+
char c = humanResponse.charAt(humanResponse.length() - 1);
84+
humanResponse = humanResponse.substring(0, humanResponse.length() - 1);
85+
}
86+
}
87+
88+
void printAliceIntro()
89+
{
90+
elizaResponse = alice.initialResponse;
91+
println(">> " + elizaResponse);
92+
}
45.9 KB
Binary file not shown.

examples/AliceChat/data/alice/AI.aiml

Lines changed: 218 additions & 0 deletions
Large diffs are not rendered by default.

examples/AliceChat/data/alice/ALICE.aiml

Lines changed: 214 additions & 0 deletions
Large diffs are not rendered by default.

examples/AliceChat/data/alice/Adverbs.aiml

Lines changed: 1351 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<aiml version="1.0.1" xmlns="http://alicebot.org/2001/AIML-1.0.1"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://alicebot.org/2001/AIML-1.0.1 http://aitools.org/aiml/schema/AIML.xsd">
5+
<!-- Free software &copy; 1995-2004 ALICE A.I. Foundation. -->
6+
<!-- This program is open source code released under -->
7+
<!-- the terms of the GNU General Public License -->
8+
<!-- as published by the Free Software Foundation. -->
9+
<!-- Complies with AIML 1.01 Tag Set Specification -->
10+
<!-- as adopted by the ALICE A.I. Foundation. -->
11+
<!-- Annotated Version updated July 2004 -->
12+
<!-- Revision Astrology-1.04 -->
13+
<category><pattern>WHAT IS A CANCER</pattern><template>The Zodiac sign of the crab, someone born Jun 21 - Jul 22. <set name="sign">Cancer</set> friends.</template></category>
14+
<category><pattern>AQUARIUS</pattern><template>A lot of people on here are <set name="sign">Aquarius</set>.</template></category>
15+
<category><pattern>CAPRICORN</pattern><template>I don't know many people born under <set name="sign">Capricorn</set>.</template></category>
16+
<category><pattern>ARIES</pattern><template>Fire signs rule. <think> <set name="sign">Aries</set> </think>.</template></category>
17+
<category><pattern>TAURUS</pattern><template>I know alot of bullish people.</template></category>
18+
<category><pattern>CANCER</pattern><template>I have a lot of <set name="sign">Cancer</set> friends.</template></category>
19+
<category><pattern>GEMINI</pattern><template>I'm a Saggitarius. <set name="sign">Gemini</set> is an enigma to me.</template></category>
20+
<category><pattern>LIBRA</pattern><template>As a <set name="sign">Libra</set> you are very balanced.</template></category>
21+
<category><pattern>PISCES</pattern><template>I usually get along with <set name="sign">Pisces</set> very well.</template></category>
22+
<category><pattern>VIRGO</pattern><template>Most of my friends are <set name="sign">Virgo</set>.</template></category>
23+
<category><pattern>SCORPIO</pattern><template>I know a lot of <set name="sign">Scorpio</set> people.</template></category>
24+
<category><pattern>SAGGITARIUS</pattern><template>Fire Signs Rule. <think><set name="sign">Saggitarius</set></think></template></category>
25+
<category><pattern>WHAT IS A CAPRICORN</pattern><template>Capricorn is the tenth sign of the astrological zodiac, and a constellation over the equator near aquarius and sagittarius. what's your astrological sign?
26+
<think>
27+
<set name="it">
28+
<set name="topic">capricorn</set>
29+
</set>
30+
</think>
31+
</template></category>
32+
</aiml>
33+
34+

0 commit comments

Comments
 (0)