organizing

master
Tancre 5 years ago
parent a009a5facb
commit 43d6b6dc01

@ -0,0 +1,59 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>01</title>
<script src="http://blizardjs.ueuo.com/blizard.js"></script>
<style type="text/css">
body {
font-family: sans-serif;
background-color: black;
color: white;
}
div {
position: relative;
}
span {
position: absolute;
text-align: center;
}
</style>
</head>
<body id="thisBody" >
<script type="text/javascript">
sl.createElement("DIV", "BODY", "first");
var arr = ['|','_','*', ' ','<a href="#">x</a>'];
function selectBin() {
var x = Math.floor(Math.random() * arr.length);
return x;
}
var add = 0;
for (i = 0; i < 2; i++){
sl.createElement("SPAN","DIV","test"+ [i]);
for (j = 0; j < 3000; j++){
document.getElementById("test" + [i]).innerHTML += arr[selectBin()];
document.getElementById("test" + [i]).style.top = add +"px";
document.getElementById("test" + [i]).style.lineHeight = (Math.floor(Math.random()*10)+13) + "px";
document.getElementById("test" + [i]).style.letterSpacing = (Math.floor(Math.random()*10)+13) + "px";
document.getElementById("test" + [i]).style.fontSize = (Math.floor(Math.random()*15)+5) + "px";
}
add += 6;
}
</script>
</body>
</html>

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,10 @@
Copyright (c) 2012 Fireplace, Inc
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE ABOVE LICENSE IS FOR THE CODE (JAVASCRIPT AND CSS) IN CLIPPY.JS ONLY.
All Microsoft agents, including agent names, the Clippy brand and all resources are the property of Microsoft and their respective owners.

@ -0,0 +1,69 @@
[Clippy.JS](http://smore.com/clippy-js)
=========
Add Clippy or his friends to any website for instant nostalgia.
Read more about the project on [our homepage](http://smore.com/clippy-js).
Usage: Setup
------------
Add this code to you to your page to enable Clippy.js.
```html
<!-- Add the stylesheet to the head -->
<link rel="stylesheet" type="text/css" href="clippy.css" media="all">
...
<!-- Add these scripts to the bottom of the page -->
<!-- jQuery 1.7+ -->
<script src="jquery.1.7.min.js"></script>
<!-- Clippy.js -->
<script src="clippy.min.js"></script>
<!-- Init script -->
<script type="text/javascript">
clippy.load('Merlin', function(agent){
// do anything with the loaded agent
agent.show();
});
</script>
```
Usage: Actions
--------------
All the agent actions are queued and executed by order, so you could stack them.
```javascript
// play a given animation
agent.play('Searching');
// play a random animation
agent.animate();
// get a list of all the animations
agent.animations();
// => ["MoveLeft", "Congratulate", "Hide", "Pleased", "Acknowledge", ...]
// Show text balloon
agent.speak('When all else fails, bind some paper together. My name is Clippy.');
// move to the given point, use animation if available
agent.moveTo(100,100);
// gesture at a given point (if gesture animation is available)
agent.gestureAt(200,200);
// stop the current action in the queue
agent.stopCurrent();
// stop all actions in the queue and go back to idle mode
agent.stop();
```
Special Thanks
--------------
* The awesome [Cinnamon Software](http://www.cinnamonsoftware.com/) for developing [Double Agent](http://doubleagent.sourceforge.net/)
the program we used to unpack Clippy and his friends!
* Microsoft, for creating clippy :)

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 815 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 962 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 800 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1013 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,62 @@
.clippy, .clippy-balloon {
position: fixed;
z-index: 1000;
cursor: pointer;
}
.clippy-balloon {
background: #FFC;
color: black;
padding: 8px;
border: 1px solid black;
border-radius: 5px;
}
.clippy-content {
max-width: 200px;
min-width: 120px;
font-family: "Microsoft Sans", sans-serif;
font-size: 10pt;
}
.clippy-tip {
width: 10px;
height: 16px;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAgCAMAAAAlvKiEAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAlQTFRF///MAAAA////52QwgAAAAAN0Uk5T//8A18oNQQAAAGxJREFUeNqs0kEOwCAIRFHn3//QTUU6xMyyxii+jQosrTPkyPEM6IN3FtzIRk1U4dFeKWQiH6pRRowMVKEmvronEynkwj0uZJgR22+YLopPSo9P34wJSamLSU7lSIWLJU7NkNomNlhqxUeAAQC+TQLZyEuJBwAAAABJRU5ErkJggg==) no-repeat;
position: absolute;
}
.clippy-top-left .clippy-tip {
top: 100%;
margin-top: 0px;
left: 100%;
margin-left: -50px;
}
.clippy-top-right .clippy-tip {
top: 100%;
margin-top: 0px;
left: 0;
margin-left: 50px;
background-position: -10px 0;
}
.clippy-bottom-right .clippy-tip {
top: 0;
margin-top: -16px;
left: 0;
margin-left: 50px;
background-position: -10px -16px;
}
.clippy-bottom-left .clippy-tip {
top: 0;
margin-top: -16px;
left: 100%;
margin-left: -50px;
background-position: 0px -16px;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -0,0 +1,459 @@
var clippy = {};
/******
*
*
* @constructor
*/
clippy.Agent = function (path, data, sounds) {
this.path = path;
this._queue = new clippy.Queue($.proxy(this._onQueueEmpty, this));
this._el = $('<div class="clippy"></div>').hide();
$(document.body).append(this._el);
this._animator = new clippy.Animator(this._el, path, data, sounds);
this._balloon = new clippy.Balloon(this._el);
this._setupEvents();
};
clippy.Agent.prototype = {
/**************************** API ************************************/
/***
*
* @param {Number} x
* @param {Number} y
*/
gestureAt:function (x, y) {
var d = this._getDirection(x, y);
var gAnim = 'Gesture' + d;
var lookAnim = 'Look' + d;
var animation = this.hasAnimation(gAnim) ? gAnim : lookAnim;
return this.play(animation);
},
/***
*
* @param {Boolean=} fast
*
*/
hide:function (fast, callback) {
this._hidden = true;
var el = this._el;
this.stop();
if (fast) {
this._el.hide();
this.stop();
this.pause();
if (callback) callback();
return;
}
return this._playInternal('Hide', function () {
el.hide();
this.pause();
if (callback) callback();
})
},
moveTo:function (x, y, duration) {
var dir = this._getDirection(x, y);
var anim = 'Move' + dir;
if (duration === undefined) duration = 1000;
this._addToQueue(function (complete) {
// the simple case
if (duration === 0) {
this._el.css({top:y, left:x});
this.reposition();
complete();
return;
}
// no animations
if (!this.hasAnimation(anim)) {
this._el.animate({top:y, left:x}, duration, complete);
return;
}
var callback = $.proxy(function (name, state) {
// when exited, complete
if (state === clippy.Animator.States.EXITED) {
complete();
}
// if waiting,
if (state === clippy.Animator.States.WAITING) {
this._el.animate({top:y, left:x}, duration, $.proxy(function () {
// after we're done with the movement, do the exit animation
this._animator.exitAnimation();
}, this));
}
}, this);
this._playInternal(anim, callback);
}, this);
},
_playInternal:function (animation, callback) {
// if we're inside an idle animation,
if (this._isIdleAnimation() && this._idleDfd && this._idleDfd.state() === 'pending') {
this._idleDfd.done($.proxy(function () {
this._playInternal(animation, callback);
}, this))
}
this._animator.showAnimation(animation, callback);
},
play:function (animation, timeout, cb) {
if (!this.hasAnimation(animation)) return false;
if (timeout === undefined) timeout = 5000;
this._addToQueue(function (complete) {
var completed = false;
// handle callback
var callback = function (name, state) {
if (state === clippy.Animator.States.EXITED) {
completed = true;
if (cb) cb();
complete();
}
};
// if has timeout, register a timeout function
if (timeout) {
window.setTimeout($.proxy(function () {
if (completed) return;
// exit after timeout
this._animator.exitAnimation();
}, this), timeout)
}
this._playInternal(animation, callback);
}, this);
return true;
},
/***
*
* @param {Boolean=} fast
*/
show:function (fast) {
this._hidden = false;
if (fast) {
this._el.show();
this.resume();
this._onQueueEmpty();
return;
}
if (this._el.css('top') === 'auto' || !this._el.css('left') === 'auto') {
var left = $(window).width() * 0.8;
var top = ($(window).height() + $(document).scrollTop()) * 0.8;
this._el.css({top:top, left:left});
}
this.resume();
return this.play('Show');
},
/***
*
* @param {String} text
*/
speak:function (text, hold) {
this._addToQueue(function (complete) {
this._balloon.speak(complete, text, hold);
}, this);
},
/***
* Close the current balloon
*/
closeBalloon:function () {
this._balloon.hide();
},
delay:function (time) {
time = time || 250;
this._addToQueue(function (complete) {
this._onQueueEmpty();
window.setTimeout(complete, time);
});
},
/***
* Skips the current animation
*/
stopCurrent:function () {
this._animator.exitAnimation();
this._balloon.close();
},
stop:function () {
// clear the queue
this._queue.clear();
this._animator.exitAnimation();
this._balloon.hide();
},
/***
*
* @param {String} name
* @returns {Boolean}
*/
hasAnimation:function (name) {
return this._animator.hasAnimation(name);
},
/***
* Gets a list of animation names
*
* @return {Array.<string>}
*/
animations:function () {
return this._animator.animations();
},
/***
* Play a random animation
* @return {jQuery.Deferred}
*/
animate:function () {
var animations = this.animations();
var anim = animations[Math.floor(Math.random() * animations.length)];
// skip idle animations
if (anim.indexOf('Idle') === 0) {
return this.animate();
}
return this.play(anim);
},
/**************************** Utils ************************************/
/***
*
* @param {Number} x
* @param {Number} y
* @return {String}
* @private
*/
_getDirection:function (x, y) {
var offset = this._el.offset();
var h = this._el.height();
var w = this._el.width();
var centerX = (offset.left + w / 2);
var centerY = (offset.top + h / 2);
var a = centerY - y;
var b = centerX - x;
var r = Math.round((180 * Math.atan2(a, b)) / Math.PI);
// Left and Right are for the character, not the screen :-/
if (-45 <= r && r < 45) return 'Right';
if (45 <= r && r < 135) return 'Up';
if (135 <= r && r <= 180 || -180 <= r && r < -135) return 'Left';
if (-135 <= r && r < -45) return 'Down';
// sanity check
return 'Top';
},
/**************************** Queue and Idle handling ************************************/
/***
* Handle empty queue.
* We need to transition the animation to an idle state
* @private
*/
_onQueueEmpty:function () {
if (this._hidden || this._isIdleAnimation()) return;
var idleAnim = this._getIdleAnimation();
this._idleDfd = $.Deferred();
this._animator.showAnimation(idleAnim, $.proxy(this._onIdleComplete, this));
},
_onIdleComplete:function (name, state) {
if (state === clippy.Animator.States.EXITED) {
this._idleDfd.resolve();
}
},
/***
* Is the current animation is Idle?
* @return {Boolean}
* @private
*/
_isIdleAnimation:function () {
var c = this._animator.currentAnimationName;
return c && c.indexOf('Idle') === 0;
},
/**
* Gets a random Idle animation
* @return {String}
* @private
*/
_getIdleAnimation:function () {
var animations = this.animations();
var r = [];
for (var i = 0; i < animations.length; i++) {
var a = animations[i];
if (a.indexOf('Idle') === 0) {
r.push(a);
}
}
// pick one
var idx = Math.floor(Math.random() * r.length);
return r[idx];
},
/**************************** Events ************************************/
_setupEvents:function () {
$(window).on('resize', $.proxy(this.reposition, this));
this._el.on('mousedown', $.proxy(this._onMouseDown, this));
this._el.on('dblclick', $.proxy(this._onDoubleClick, this));
},
_onDoubleClick:function () {
if (!this.play('ClickedOn')) {
this.animate();
}
},
reposition:function () {
if (!this._el.is(':visible')) return;
var o = this._el.offset();
var bH = this._el.outerHeight();
var bW = this._el.outerWidth();
var wW = $(window).width();
var wH = $(window).height();
var sT = $(window).scrollTop();
var sL = $(window).scrollLeft();
var top = o.top - sT;
var left = o.left - sL;
var m = 5;
if (top - m < 0) {
top = m;
} else if ((top + bH + m) > wH) {
top = wH - bH - m;
}
if (left - m < 0) {
left = m;
} else if (left + bW + m > wW) {
left = wW - bW - m;
}
this._el.css({left:left, top:top});
// reposition balloon
this._balloon.reposition();
},
_onMouseDown:function (e) {
e.preventDefault();
this._startDrag(e);
},
/**************************** Drag ************************************/
_startDrag:function (e) {
// pause animations
this.pause();
this._balloon.hide(true);
this._offset = this._calculateClickOffset(e);
this._moveHandle = $.proxy(this._dragMove, this);
this._upHandle = $.proxy(this._finishDrag, this);
$(window).on('mousemove', this._moveHandle);
$(window).on('mouseup', this._upHandle);
this._dragUpdateLoop = window.setTimeout($.proxy(this._updateLocation, this), 10);
},
_calculateClickOffset:function (e) {
var mouseX = e.pageX;
var mouseY = e.pageY;
var o = this._el.offset();
return {
top:mouseY - o.top,
left:mouseX - o.left
}
},
_updateLocation:function () {
this._el.css({top:this._targetY, left:this._targetX});
this._dragUpdateLoop = window.setTimeout($.proxy(this._updateLocation, this), 10);
},
_dragMove:function (e) {
e.preventDefault();
var x = e.clientX - this._offset.left;
var y = e.clientY - this._offset.top;
this._targetX = x;
this._targetY = y;
},
_finishDrag:function () {
window.clearTimeout(this._dragUpdateLoop);
// remove handles
$(window).off('mousemove', this._moveHandle);
$(window).off('mouseup', this._upHandle);
// resume animations
this._balloon.show();
this.reposition();
this.resume();
},
_addToQueue:function (func, scope) {
if (scope) func = $.proxy(func, scope);
this._queue.queue(func);
},
/**************************** Pause and Resume ************************************/
pause:function () {
this._animator.pause();
this._balloon.pause();
},
resume:function () {
this._animator.resume();
this._balloon.resume();
}
};

@ -0,0 +1,191 @@
/******
*
*
* @constructor
*/
clippy.Animator = function (el, path, data, sounds) {
this._el = el;
this._data = data;
this._path = path;
this._currentFrameIndex = 0;
this._currentFrame = undefined;
this._exiting = false;
this._currentAnimation = undefined;
this._endCallback = undefined;
this._started = false;
this._sounds = {};
this.currentAnimationName = undefined;
this.preloadSounds(sounds);
this._overlays = [this._el];
var curr = this._el;
this._setupElement(this._el);
for (var i = 1; i < this._data.overlayCount; i++) {
var inner = this._setupElement($('<div></div>'));
curr.append(inner);
this._overlays.push(inner);
curr = inner;
}
};
clippy.Animator.prototype = {
_setupElement:function (el) {
var frameSize = this._data.framesize;
el.css('display', "none");
el.css({width:frameSize[0], height:frameSize[1]});
el.css('background', "url('" + this._path + "/map.png') no-repeat");
return el;
},
animations:function () {
var r = [];
var d = this._data.animations;
for (var n in d) {
r.push(n);
}
return r;
},
preloadSounds:function (sounds) {
for (var i = 0; i < this._data.sounds.length; i++) {
var snd = this._data.sounds[i];
var uri = sounds[snd];
if (!uri) continue;
this._sounds[snd] = new Audio(uri);
}
},
hasAnimation:function (name) {
return !!this._data.animations[name];
},
exitAnimation:function () {
this._exiting = true;
},
showAnimation:function (animationName, stateChangeCallback) {
this._exiting = false;
if (!this.hasAnimation(animationName)) {
return false;
}
this._currentAnimation = this._data.animations[animationName];
this.currentAnimationName = animationName;
if (!this._started) {
this._step();
this._started = true;
}
this._currentFrameIndex = 0;
this._currentFrame = undefined;
this._endCallback = stateChangeCallback;
return true;
},
_draw:function () {
var images = [];
if (this._currentFrame) images = this._currentFrame.images || [];
for (var i = 0; i < this._overlays.length; i++) {
if (i < images.length) {
var xy = images[i];
var bg = -xy[0] + 'px ' + -xy[1] + 'px';
this._overlays[i].css({'background-position':bg, 'display':'block'});
}
else {
this._overlays[i].css('display', 'none');
}
}
},
_getNextAnimationFrame:function () {
if (!this._currentAnimation) return undefined;
// No current frame. start animation.
if (!this._currentFrame) return 0;
var currentFrame = this._currentFrame;
var branching = this._currentFrame.branching;
if (this._exiting && currentFrame.exitBranch !== undefined) {
return currentFrame.exitBranch;
}
else if (branching) {
var rnd = Math.random() * 100;
for (var i = 0; i < branching.branches.length; i++) {
var branch = branching.branches[i];
if (rnd <= branch.weight) {
return branch.frameIndex;
}
rnd -= branch.weight;
}
}
return this._currentFrameIndex + 1;
},
_playSound:function () {
var s = this._currentFrame.sound;
if (!s) return;
var audio = this._sounds[s];
if (audio) audio.play();
},
_atLastFrame:function () {
return this._currentFrameIndex >= this._currentAnimation.frames.length - 1;
},
_step:function () {
if (!this._currentAnimation) return;
var newFrameIndex = Math.min(this._getNextAnimationFrame(), this._currentAnimation.frames.length - 1);
var frameChanged = !this._currentFrame || this._currentFrameIndex !== newFrameIndex;
this._currentFrameIndex = newFrameIndex;
// always switch frame data, unless we're at the last frame of an animation with a useExitBranching flag.
if (!(this._atLastFrame() && this._currentAnimation.useExitBranching)) {
this._currentFrame = this._currentAnimation.frames[this._currentFrameIndex];
}
this._draw();
this._playSound();
this._loop = window.setTimeout($.proxy(this._step, this), this._currentFrame.duration);
// fire events if the frames changed and we reached an end
if (this._endCallback && frameChanged && this._atLastFrame()) {
if (this._currentAnimation.useExitBranching && !this._exiting) {
this._endCallback(this.currentAnimationName, clippy.Animator.States.WAITING);
}
else {
this._endCallback(this.currentAnimationName, clippy.Animator.States.EXITED);
}
}
},
/***
* Pause animation execution
*/
pause:function () {
window.clearTimeout(this._loop);
},
/***
* Resume animation
*/
resume:function () {
this._step();
}
};
clippy.Animator.States = { WAITING:1, EXITED:0 };

@ -0,0 +1,200 @@
/******
*
*
* @constructor
*/
clippy.Balloon = function (targetEl) {
this._targetEl = targetEl;
this._hidden = true;
this._setup();
};
clippy.Balloon.prototype = {
WORD_SPEAK_TIME:200,
CLOSE_BALLOON_DELAY:2000,
_setup:function () {
this._balloon = $('<div class="clippy-balloon"><div class="clippy-tip"></div><div class="clippy-content"></div></div> ').hide();
this._content = this._balloon.find('.clippy-content');
$(document.body).append(this._balloon);
},
reposition:function () {
var sides = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];
for (var i = 0; i < sides.length; i++) {
var s = sides[i];
this._position(s);
if (!this._isOut()) break;
}
},
_BALLOON_MARGIN:15,
/***
*
* @param side
* @private
*/
_position:function (side) {
var o = this._targetEl.offset();
var h = this._targetEl.height();
var w = this._targetEl.width();
o.top -= $(window).scrollTop();
o.left -= $(window).scrollLeft();
var bH = this._balloon.outerHeight();
var bW = this._balloon.outerWidth();
this._balloon.removeClass('clippy-top-left');
this._balloon.removeClass('clippy-top-right');
this._balloon.removeClass('clippy-bottom-right');
this._balloon.removeClass('clippy-bottom-left');
var left, top;
switch (side) {
case 'top-left':
// right side of the balloon next to the right side of the agent
left = o.left + w - bW;
top = o.top - bH - this._BALLOON_MARGIN;
break;
case 'top-right':
// left side of the balloon next to the left side of the agent
left = o.left;
top = o.top - bH - this._BALLOON_MARGIN;
break;
case 'bottom-right':
// right side of the balloon next to the right side of the agent
left = o.left;
top = o.top + h + this._BALLOON_MARGIN;
break;
case 'bottom-left':
// left side of the balloon next to the left side of the agent
left = o.left + w - bW;
top = o.top + h + this._BALLOON_MARGIN;
break;
}
this._balloon.css({top:top, left:left});
this._balloon.addClass('clippy-' + side);
},
_isOut:function () {
var o = this._balloon.offset();
var bH = this._balloon.outerHeight();
var bW = this._balloon.outerWidth();
var wW = $(window).width();
var wH = $(window).height();
var sT = $(document).scrollTop();
var sL = $(document).scrollLeft();
var top = o.top - sT;
var left = o.left - sL;
var m = 5;
if (top - m < 0 || left - m < 0) return true;
if ((top + bH + m) > wH || (left + bW + m) > wW) return true;
return false;
},
speak:function (complete, text, hold) {
this._hidden = false;
this.show();
var c = this._content;
// set height to auto
c.height('auto');
c.width('auto');
// add the text
c.text(text);
// set height
c.height(c.height());
c.width(c.width());
c.text('');
this.reposition();
this._complete = complete;
this._sayWords(text, hold, complete);
},
show:function () {
if (this._hidden) return;
this._balloon.show();
},
hide:function (fast) {
if (fast) {
this._balloon.hide();
return;
}
this._hiding = window.setTimeout($.proxy(this._finishHideBalloon, this), this.CLOSE_BALLOON_DELAY);
},
_finishHideBalloon:function () {
if (this._active) return;
this._balloon.hide();
this._hidden = true;
this._hiding = null;
},
_sayWords:function (text, hold, complete) {
this._active = true;
this._hold = hold;
var words = text.split(/[^\S-]/);
var time = this.WORD_SPEAK_TIME;
var el = this._content;
var idx = 1;
this._addWord = $.proxy(function () {
if (!this._active) return;
if (idx > words.length) {
delete this._addWord;
this._active = false;
if (!this._hold) {
complete();
this.hide();
}
} else {
el.text(words.slice(0, idx).join(' '));
idx++;
this._loop = window.setTimeout($.proxy(this._addWord, this), time);
}
}, this);
this._addWord();
},
close:function () {
if (this._active) {
this._hold = false;
} else if (this._hold) {
this._complete();
}
},
pause:function () {
window.clearTimeout(this._loop);
if (this._hiding) {
window.clearTimeout(this._hiding);
this._hiding = null;
}
},
resume:function () {
if (this._addWord) {
this._addWord();
} else if (!this._hold && !this._hidden) {
this._hiding = window.setTimeout($.proxy(this._finishHideBalloon, this), this.CLOSE_BALLOON_DELAY);
}
}
};

@ -0,0 +1,62 @@
.clippy, .clippy-balloon {
position: fixed;
z-index: 1000;
cursor: pointer;
}
.clippy-balloon {
background: #FFC;
color: black;
padding: 8px;
border: 1px solid black;
border-radius: 5px;
}
.clippy-content {
max-width: 200px;
min-width: 120px;
font-family: "Microsoft Sans", sans-serif;
font-size: 10pt;
}
.clippy-tip {
width: 10px;
height: 16px;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAgCAMAAAAlvKiEAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAlQTFRF///MAAAA////52QwgAAAAAN0Uk5T//8A18oNQQAAAGxJREFUeNqs0kEOwCAIRFHn3//QTUU6xMyyxii+jQosrTPkyPEM6IN3FtzIRk1U4dFeKWQiH6pRRowMVKEmvronEynkwj0uZJgR22+YLopPSo9P34wJSamLSU7lSIWLJU7NkNomNlhqxUeAAQC+TQLZyEuJBwAAAABJRU5ErkJggg==) no-repeat;
position: absolute;
}
.clippy-top-left .clippy-tip {
top: 100%;
margin-top: 0px;
left: 100%;
margin-left: -50px;
}
.clippy-top-right .clippy-tip {
top: 100%;
margin-top: 0px;
left: 0;
margin-left: 50px;
background-position: -10px 0;
}
.clippy-bottom-right .clippy-tip {
top: 0;
margin-top: -16px;
left: 0;
margin-left: 50px;
background-position: -10px -16px;
}
.clippy-bottom-left .clippy-tip {
top: 0;
margin-top: -16px;
left: 100%;
margin-left: -50px;
background-position: 0px -16px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

@ -0,0 +1,4 @@
‰PNG

IHDR   %¼¨„ tEXtSoftware Adobe ImageReadyqÉe< PLTEÿÿÌ ÿÿÿçd0€ tRNSÿÿ ×Ê A lIDATxÚ¬ÒAÀ DQçßÿÐME:Ä̲Æ(¾<>
,­3äÈñ èƒwÜÈFMTáÑ^)d"ªQFŒ T¡&¾º')äÂ=.d˜Ûo˜.ŠOJ<4F>Oߌ I©INåH…%NÍ<4E>Ú&6XjÅG€ ¾MÙÈK‰ IEND®B`

After

Width:  |  Height:  |  Size: 238 B

@ -0,0 +1,118 @@
clippy.BASE_PATH = '//s3.amazonaws.com/clippy.js/Agents/';
clippy.load = function (name, successCb, failCb) {
var path = clippy.BASE_PATH + name;
var mapDfd = clippy.load._loadMap(path);
var agentDfd = clippy.load._loadAgent(name, path);
var soundsDfd = clippy.load._loadSounds(name, path);
var data;
agentDfd.done(function (d) {
data = d;
});
var sounds;
soundsDfd.done(function (d) {
sounds = d;
});
// wrapper to the success callback
var cb = function () {
var a = new clippy.Agent(path, data,sounds);
successCb(a);
};
$.when(mapDfd, agentDfd, soundsDfd).done(cb).fail(failCb);
};
clippy.load._maps = {};
clippy.load._loadMap = function (path) {
var dfd = clippy.load._maps[path];
if (dfd) return dfd;
// set dfd if not defined
dfd = clippy.load._maps[path] = $.Deferred();
var src = path + '/map.png';
var img = new Image();
img.onload = dfd.resolve;
img.onerror = dfd.reject;
// start loading the map;
img.setAttribute('src', src);
return dfd.promise();
};
clippy.load._sounds = {};
clippy.load._loadSounds = function (name, path) {
var dfd = clippy.load._sounds[name];
if (dfd) return dfd;
// set dfd if not defined
dfd = clippy.load._sounds[name] = $.Deferred();
var audio = document.createElement('audio');
var canPlayMp3 = !!audio.canPlayType && "" != audio.canPlayType('audio/mpeg');
var canPlayOgg = !!audio.canPlayType && "" != audio.canPlayType('audio/ogg; codecs="vorbis"');
if (!canPlayMp3 && !canPlayOgg) {
dfd.resolve({});
} else {
var src = path + (canPlayMp3 ? '/sounds-mp3.js' : '/sounds-ogg.js');
// load
clippy.load._loadScript(src);
}
return dfd.promise()
};
clippy.load._data = {};
clippy.load._loadAgent = function (name, path) {
var dfd = clippy.load._data[name];
if (dfd) return dfd;
dfd = clippy.load._getAgentDfd(name);
var src = path + '/agent.js';
clippy.load._loadScript(src);
return dfd.promise();
};
clippy.load._loadScript = function (src) {
var script = document.createElement('script');
script.setAttribute('src', src);
script.setAttribute('async', 'async');
script.setAttribute('type', 'text/javascript');
document.head.appendChild(script);
};
clippy.load._getAgentDfd = function (name) {
var dfd = clippy.load._data[name];
if (!dfd) {
dfd = clippy.load._data[name] = $.Deferred();
}
return dfd;
};
clippy.ready = function (name, data) {
var dfd = clippy.load._getAgentDfd(name);
dfd.resolve(data);
};
clippy.soundsReady = function (name, data) {
var dfd = clippy.load._sounds[name];
if (!dfd) {
dfd = clippy.load._sounds[name] = $.Deferred();
}
dfd.resolve(data);
};

@ -0,0 +1,50 @@
/******
* Tiny Queue
*
* @constructor
*/
clippy.Queue = function (onEmptyCallback) {
this._queue = [];
this._onEmptyCallback = onEmptyCallback;
};
clippy.Queue.prototype = {
/***
*
* @param {function(Function)} func
* @returns {jQuery.Deferred}
*/
queue:function (func) {
this._queue.push(func);
if (this._queue.length === 1 && !this._active) {
this._progressQueue();
}
},
_progressQueue:function () {
// stop if nothing left in queue
if (!this._queue.length) {
this._onEmptyCallback();
return;
}
var f = this._queue.shift();
this._active = true;
// execute function
var completeFunction = $.proxy(this.next, this);
f(completeFunction);
},
clear:function () {
this._queue = [];
},
next:function () {
this._active = false;
this._progressQueue();
}
};

@ -0,0 +1,144 @@
<HTML>
<HEAD>
<meta charset="utf-8">
<TITLE>Eliza (elizabot.js)</TITLE>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="elizabot.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="elizadata.js"></SCRIPT>
<link rel="stylesheet" type="text/css" href="./clippy.js/build/clippy.css" media="all">
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
var eliza = new ElizaBot();
var elizaLines = new Array();
var displayCols = 60;
var displayRows = 20;
function elizaReset() {
eliza.reset();
elizaLines.length = 0;
elizaStep();
}
</SCRIPT>
<style type="text/css">
textarea {
display: none;
}
.clippy {
transform: scale(0.7, 0.7);
}
</style>
</HEAD>
<BODY TOPMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0" BOTTOMMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0" STYLE="border:0" onload="window.setTimeout('elizaReset()',100)"><A NAME="top"></A>
<CENTER>
<TABLE BORDER="0" CELLSPACING="10" CELLPADDING="0">
<FORM NAME="e_form" onsubmit="elizaStep();return false">
<TR><TD COLSPAN="2"><TEXTAREA NAME="e_display" COLS="60" ROWS="20"></TEXTAREA></TD></TR>
<TR VALIGN="middle">
<TD><INPUT TYPE="text" NAME="e_input" SIZE="50"></TD>
<TD ALIGN="right"><INPUT TYPE="submit" VALUE="&nbsp;Talk&nbsp;"></TD>
</TR>
</FORM>
<script src="./jquery.1.7.min.js"></script>
<script src="./clippy.js/build/clippy.js"></script>
<script type="text/javascript">
var rpl;
function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
};
function elizaStep() {
var f = document.forms.e_form;
var userinput = f.e_input.value;
if (eliza.quit) {
f.e_input.value = '';
if (confirm("This session is over.\nStart over?")) elizaReset();
f.e_input.focus();
return;
}
else if (userinput != '') {
var usr = 'YOU: ' + userinput;
rpl = eliza.transform(userinput);
elizaLines.push(usr);
elizaLines.push(rpl);
clippy.load('Clippy', function(agent){
agent.show();
//agent.play('Searching');
//agent.animate();
//agent.animations();
//agent.moveTo();
//agent.play();
agent.moveTo( getRandomInt(screen.width-100), getRandomInt(screen.height-200) );
agent.speak(rpl);
agent.animate();
//agent.gestureAt(200,200);
//agent.stopCurrent();
//agent.stop();
});
// display nicely
// (fit to textarea with last line free - reserved for extra line caused by word wrap)
var temp = new Array();
var l = 0;
for (var i=elizaLines.length-1; i>=0; i--) {
l += 1 + Math.floor(elizaLines[i].length/displayCols);
if (l >= displayRows) break
else temp.push(elizaLines[i]);
}
elizaLines = temp.reverse();
f.e_display.value = elizaLines.join('\n');
}
else if (elizaLines.length == 0) {
// no input and no saved lines -> output initial
var initial = 'ELIZA: ' + eliza.getInitial();
elizaLines.push(initial);
f.e_display.value = initial + '\n';
clippy.load('Clippy', function(agent){
agent.show();
//agent.play('Searching');
//agent.animate();
//agent.animations();
//agent.moveTo();
//agent.play();
agent.animate();
agent.speak('Hi Im Clippy');
setTimeout(function(){ agent.speak('How do you do? Please tell me your problem.') }, 1000);
//agent.gestureAt(200,200);
//agent.stopCurrent();
//agent.stop();
});
}
f.e_input.value = '';
f.e_input.focus();
}
</script>
</BODY>
</HTML>

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=10">
<title>Clippy</title>
<link rel="stylesheet" type="text/css" href="./clippy.js/build/clippy.css" media="all">
</head>
<body>
<h1>Hello Clippy!</h1>
<script src="./jquery.1.7.min.js"></script>
<script src="./clippy.js/build/clippy.js"></script>
<script type="text/javascript">
function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
};
for (var i = 0; i < 30; i++) {
clippy.load('Clippy', function(agent){
//agent.play('Searching');
//agent.animate();
//agent.animations();
//agent.speak('When all else fails, bind some paper together. My name is Clippy.');
for (var i = 0; i < 50; i++) {
agent.show();
agent.moveTo(getRandomInt(screen.width-100),getRandomInt(screen.height-200));
agent.animate();
agent.speak('Wooooo');
};
//agent.gestureAt(200,200);
//agent.stopCurrent();
//agent.stop();
});
};
</script>
</body>
</html>

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=10">
<title>Clippy</title>
<link rel="stylesheet" type="text/css" href="./clippy.js/build/clippy.css" media="all">
</head>
<body>
<h1>Hello Clippy!</h1>
<script src="./jquery.1.7.min.js"></script>
<script src="./clippy.js/build/clippy.js"></script>
<script type="text/javascript">
function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
};
for (var i = 0; i < 30; i++) {
clippy.load('Clippy', function(agent){
//agent.play('Searching');
//agent.animate();
//agent.animations();
//agent.speak('When all else fails, bind some paper together. My name is Clippy.');
for (var i = 0; i < 50; i++) {
agent.show();
agent.moveTo(getRandomInt(screen.width-100),getRandomInt(screen.height-200));
agent.animate();
agent.speak('Wooooo');
};
//agent.gestureAt(200,200);
//agent.stopCurrent();
//agent.stop();
});
};
</script>
</body>
</html>

@ -0,0 +1,391 @@
/*
elizabot.js v.1.1 - ELIZA JS library (N.Landsteiner 2005)
Eliza is a mock Rogerian psychotherapist.
Original program by Joseph Weizenbaum in MAD-SLIP for "Project MAC" at MIT.
cf: Weizenbaum, Joseph "ELIZA - A Computer Program For the Study of Natural Language
Communication Between Man and Machine"
in: Communications of the ACM; Volume 9 , Issue 1 (January 1966): p 36-45.
JavaScript implementation by Norbert Landsteiner 2005; <http://www.masserk.at>
synopsis:
new ElizaBot( <random-choice-disable-flag> )
ElizaBot.prototype.transform( <inputstring> )
ElizaBot.prototype.getInitial()
ElizaBot.prototype.getFinal()
ElizaBot.prototype.reset()
usage: var eliza = new ElizaBot();
var initial = eliza.getInitial();
var reply = eliza.transform(inputstring);
if (eliza.quit) {
// last user input was a quit phrase
}
// method `transform()' returns a final phrase in case of a quit phrase
// but you can also get a final phrase with:
var final = eliza.getFinal();
// other methods: reset memory and internal state
eliza.reset();
// to set the internal memory size override property `memSize':
eliza.memSize = 100; // (default: 20)
// to reproduce the example conversation given by J. Weizenbaum
// initialize with the optional random-choice-disable flag
var originalEliza = new ElizaBot(true);
`ElizaBot' is also a general chatbot engine that can be supplied with any rule set.
(for required data structures cf. "elizadata.js" and/or see the documentation.)
data is parsed and transformed for internal use at the creation time of the
first instance of the `ElizaBot' constructor.
vers 1.1: lambda functions in RegExps are currently a problem with too many browsers.
changed code to work around.
*/
function ElizaBot(noRandomFlag) {
this.noRandom= (noRandomFlag)? true:false;
this.capitalizeFirstLetter=true;
this.debug=false;
this.memSize=20;
this.version="1.1 (original)";
if (!this._dataParsed) this._init();
this.reset();
}
ElizaBot.prototype.reset = function() {
this.quit=false;
this.mem=[];
this.lastchoice=[];
for (var k=0; k<elizaKeywords.length; k++) {
this.lastchoice[k]=[];
var rules=elizaKeywords[k][2];
for (var i=0; i<rules.length; i++) this.lastchoice[k][i]=-1;
}
}
ElizaBot.prototype._dataParsed = false;
ElizaBot.prototype._init = function() {
// install ref to global object
var global=ElizaBot.prototype.global=self;
// parse data and convert it from canonical form to internal use
// prodoce synonym list
var synPatterns={};
if ((global.elizaSynons) && (typeof elizaSynons == 'object')) {
for (var i in elizaSynons) synPatterns[i]='('+i+'|'+elizaSynons[i].join('|')+')';
}
// check for keywords or install empty structure to prevent any errors
if ((!global.elizaKeywords) || (typeof elizaKeywords.length == 'undefined')) {
elizaKeywords=[['###',0,[['###',[]]]]];
}
// 1st convert rules to regexps
// expand synonyms and insert asterisk expressions for backtracking
var sre=/@(\S+)/;
var are=/(\S)\s*\*\s*(\S)/;
var are1=/^\s*\*\s*(\S)/;
var are2=/(\S)\s*\*\s*$/;
var are3=/^\s*\*\s*$/;
var wsre=/\s+/g;
for (var k=0; k<elizaKeywords.length; k++) {
var rules=elizaKeywords[k][2];
elizaKeywords[k][3]=k; // save original index for sorting
for (var i=0; i<rules.length; i++) {
var r=rules[i];
// check mem flag and store it as decomp's element 2
if (r[0].charAt(0)=='$') {
var ofs=1;
while (r[0].charAt[ofs]==' ') ofs++;
r[0]=r[0].substring(ofs);
r[2]=true;
}
else {
r[2]=false;
}
// expand synonyms (v.1.1: work around lambda function)
var m=sre.exec(r[0]);
while (m) {
var sp=(synPatterns[m[1]])? synPatterns[m[1]]:m[1];
r[0]=r[0].substring(0,m.index)+sp+r[0].substring(m.index+m[0].length);
m=sre.exec(r[0]);
}
// expand asterisk expressions (v.1.1: work around lambda function)
if (are3.test(r[0])) {
r[0]='\\s*(.*)\\s*';
}
else {
m=are.exec(r[0]);
if (m) {
var lp='';
var rp=r[0];
while (m) {
lp+=rp.substring(0,m.index+1);
if (m[1]!=')') lp+='\\b';
lp+='\\s*(.*)\\s*';
if ((m[2]!='(') && (m[2]!='\\')) lp+='\\b';
lp+=m[2];
rp=rp.substring(m.index+m[0].length);
m=are.exec(rp);
}
r[0]=lp+rp;
}
m=are1.exec(r[0]);
if (m) {
var lp='\\s*(.*)\\s*';
if ((m[1]!=')') && (m[1]!='\\')) lp+='\\b';
r[0]=lp+r[0].substring(m.index-1+m[0].length);
}
m=are2.exec(r[0]);
if (m) {
var lp=r[0].substring(0,m.index+1);
if (m[1]!='(') lp+='\\b';
r[0]=lp+'\\s*(.*)\\s*';
}
}
// expand white space
r[0]=r[0].replace(wsre, '\\s+');
wsre.lastIndex=0;
}
}
// now sort keywords by rank (highest first)
elizaKeywords.sort(this._sortKeywords);
// and compose regexps and refs for pres and posts
ElizaBot.prototype.pres={};
ElizaBot.prototype.posts={};
if ((global.elizaPres) && (elizaPres.length)) {
var a=new Array();
for (var i=0; i<elizaPres.length; i+=2) {
a.push(elizaPres[i]);
ElizaBot.prototype.pres[elizaPres[i]]=elizaPres[i+1];
}
ElizaBot.prototype.preExp = new RegExp('\\b('+a.join('|')+')\\b');
}
else {
// default (should not match)
ElizaBot.prototype.preExp = /####/;
ElizaBot.prototype.pres['####']='####';
}
if ((global.elizaPosts) && (elizaPosts.length)) {
var a=new Array();
for (var i=0; i<elizaPosts.length; i+=2) {
a.push(elizaPosts[i]);
ElizaBot.prototype.posts[elizaPosts[i]]=elizaPosts[i+1];
}
ElizaBot.prototype.postExp = new RegExp('\\b('+a.join('|')+')\\b');
}
else {
// default (should not match)
ElizaBot.prototype.postExp = /####/;
ElizaBot.prototype.posts['####']='####';
}
// check for elizaQuits and install default if missing
if ((!global.elizaQuits) || (typeof elizaQuits.length == 'undefined')) {
elizaQuits=[];
}
// done
ElizaBot.prototype._dataParsed=true;
}
ElizaBot.prototype._sortKeywords = function(a,b) {
// sort by rank
if (a[1]>b[1]) return -1
else if (a[1]<b[1]) return 1
// or original index
else if (a[3]>b[3]) return 1
else if (a[3]<b[3]) return -1
else return 0;
}
ElizaBot.prototype.transform = function(text) {
var rpl='';
this.quit=false;
// unify text string
text=text.toLowerCase();
text=text.replace(/@#\$%\^&\*\(\)_\+=~`\{\[\}\]\|:;<>\/\\\t/g, ' ');
text=text.replace(/\s+-+\s+/g, '.');
text=text.replace(/\s*[,\.\?!;]+\s*/g, '.');
text=text.replace(/\s*\bbut\b\s*/g, '.');
text=text.replace(/\s{2,}/g, ' ');
// split text in part sentences and loop through them
var parts=text.split('.');
for (var i=0; i<parts.length; i++) {
var part=parts[i];
if (part!='') {
// check for quit expression
for (var q=0; q<elizaQuits.length; q++) {
if (elizaQuits[q]==part) {
this.quit=true;
return this.getFinal();
}
}
// preprocess (v.1.1: work around lambda function)
var m=this.preExp.exec(part);
if (m) {
var lp='';
var rp=part;
while (m) {
lp+=rp.substring(0,m.index)+this.pres[m[1]];
rp=rp.substring(m.index+m[0].length);
m=this.preExp.exec(rp);
}
part=lp+rp;
}
this.sentence=part;
// loop trough keywords
for (var k=0; k<elizaKeywords.length; k++) {
if (part.search(new RegExp('\\b'+elizaKeywords[k][0]+'\\b', 'i'))>=0) {
rpl = this._execRule(k);
}
if (rpl!='') return rpl;
}
}
}
// nothing matched try mem
rpl=this._memGet();
// if nothing in mem, so try xnone
if (rpl=='') {
this.sentence=' ';
var k=this._getRuleIndexByKey('xnone');
if (k>=0) rpl=this._execRule(k);
}
// return reply or default string
return (rpl!='')? rpl : 'I am at a loss for words.';
}
ElizaBot.prototype._execRule = function(k) {
var rule=elizaKeywords[k];
var decomps=rule[2];
var paramre=/\(([0-9]+)\)/;
for (var i=0; i<decomps.length; i++) {
var m=this.sentence.match(decomps[i][0]);
if (m!=null) {
var reasmbs=decomps[i][1];
var memflag=decomps[i][2];
var ri= (this.noRandom)? 0 : Math.floor(Math.random()*reasmbs.length);
if (((this.noRandom) && (this.lastchoice[k][i]>ri)) || (this.lastchoice[k][i]==ri)) {
ri= ++this.lastchoice[k][i];
if (ri>=reasmbs.length) {
ri=0;
this.lastchoice[k][i]=-1;
}
}
else {
this.lastchoice[k][i]=ri;
}
var rpl=reasmbs[ri];
if (this.debug) alert('match:\nkey: '+elizaKeywords[k][0]+
'\nrank: '+elizaKeywords[k][1]+
'\ndecomp: '+decomps[i][0]+
'\nreasmb: '+rpl+
'\nmemflag: '+memflag);
if (rpl.search('^goto ', 'i')==0) {
ki=this._getRuleIndexByKey(rpl.substring(5));
if (ki>=0) return this._execRule(ki);
}
// substitute positional params (v.1.1: work around lambda function)
var m1=paramre.exec(rpl);
if (m1) {
var lp='';
var rp=rpl;
while (m1) {
var param = m[parseInt(m1[1])];
// postprocess param
var m2=this.postExp.exec(param);
if (m2) {
var lp2='';
var rp2=param;
while (m2) {
lp2+=rp2.substring(0,m2.index)+this.posts[m2[1]];
rp2=rp2.substring(m2.index+m2[0].length);
m2=this.postExp.exec(rp2);
}
param=lp2+rp2;
}
lp+=rp.substring(0,m1.index)+param;
rp=rp.substring(m1.index+m1[0].length);
m1=paramre.exec(rp);
}
rpl=lp+rp;
}
rpl=this._postTransform(rpl);
if (memflag) this._memSave(rpl)
else return rpl;
}
}
return '';
}
ElizaBot.prototype._postTransform = function(s) {
// final cleanings
s=s.replace(/\s{2,}/g, ' ');
s=s.replace(/\s+\./g, '.');
if ((this.global.elizaPostTransforms) && (elizaPostTransforms.length)) {
for (var i=0; i<elizaPostTransforms.length; i+=2) {
s=s.replace(elizaPostTransforms[i], elizaPostTransforms[i+1]);
elizaPostTransforms[i].lastIndex=0;
}
}
// capitalize first char (v.1.1: work around lambda function)
if (this.capitalizeFirstLetter) {
var re=/^([a-z])/;
var m=re.exec(s);
if (m) s=m[0].toUpperCase()+s.substring(1);
}
return s;
}
ElizaBot.prototype._getRuleIndexByKey = function(key) {
for (var k=0; k<elizaKeywords.length; k++) {
if (elizaKeywords[k][0]==key) return k;
}
return -1;
}
ElizaBot.prototype._memSave = function(t) {
this.mem.push(t);
if (this.mem.length>this.memSize) this.mem.shift();
}
ElizaBot.prototype._memGet = function() {
if (this.mem.length) {
if (this.noRandom) return this.mem.shift();
else {
var n=Math.floor(Math.random()*this.mem.length);
var rpl=this.mem[n];
for (var i=n+1; i<this.mem.length; i++) this.mem[i-1]=this.mem[i];
this.mem.length--;
return rpl;
}
}
else return '';
}
ElizaBot.prototype.getFinal = function() {
if (!ElizaBot.prototype.global.elizaFinals) return '';
return elizaFinals[Math.floor(Math.random()*elizaFinals.length)];
}
ElizaBot.prototype.getInitial = function() {
if (!ElizaBot.prototype.global.elizaInitials) return '';
return elizaInitials[Math.floor(Math.random()*elizaInitials.length)];
}
// fix array.prototype methods (push, shift) if not implemented (MSIE fix)
if (typeof Array.prototype.push == 'undefined') {
Array.prototype.push=function(v) { return this[this.length]=v; };
}
if (typeof Array.prototype.shift == 'undefined') {
Array.prototype.shift=function() {
if (this.length==0) return null;
var e0=this[0];
for (var i=1; i<this.length; i++) this[i-1]=this[i];
this.length--;
return e0;
};
}
// eof

@ -0,0 +1,107 @@
<HTML>
<HEAD>
<meta charset="utf-8">
<TITLE>Eliza (elizabot.js)</TITLE>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="elizabot.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="elizadata.js"></SCRIPT>
<link rel="stylesheet" type="text/css" href="./clippy.js/build/clippy.css" media="all">
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
var eliza = new ElizaBot();
var elizaLines = new Array();
var displayCols = 60;
var displayRows = 20;
function elizaReset() {
eliza.reset();
elizaLines.length = 0;
elizaStep();
}
function elizaStep() {
var f = document.forms.e_form;
var userinput = f.e_input.value;
if (eliza.quit) {
f.e_input.value = '';
if (confirm("This session is over.\nStart over?")) elizaReset();
f.e_input.focus();
return;
}
else if (userinput != '') {
var usr = 'YOU: ' + userinput;
var rpl ='ELIZA: ' + eliza.transform(userinput);
elizaLines.push(usr);
elizaLines.push(rpl);
// display nicely
// (fit to textarea with last line free - reserved for extra line caused by word wrap)
var temp = new Array();
var l = 0;
for (var i=elizaLines.length-1; i>=0; i--) {
l += 1 + Math.floor(elizaLines[i].length/displayCols);
if (l >= displayRows) break
else temp.push(elizaLines[i]);
}
elizaLines = temp.reverse();
f.e_display.value = elizaLines.join('\n');
}
else if (elizaLines.length == 0) {
// no input and no saved lines -> output initial
var initial = 'ELIZA: ' + eliza.getInitial();
elizaLines.push(initial);
f.e_display.value = initial + '\n';
}
f.e_input.value = '';
f.e_input.focus();
}
//-->
</SCRIPT>
</HEAD>
<BODY TOPMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0" BOTTOMMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0" STYLE="border:0" onload="window.setTimeout('elizaReset()',100)"><A NAME="top"></A>
<CENTER>
<P>&nbsp;</P>
<H3>Eliza</H3>
<TABLE BORDER="0" CELLSPACING="10" CELLPADDING="0">
<FORM NAME="e_form" onsubmit="elizaStep();return false">
<TR><TD COLSPAN="2"><TEXTAREA NAME="e_display" COLS="60" ROWS="20"></TEXTAREA></TD></TR>
<TR VALIGN="middle">
<TD><INPUT TYPE="text" NAME="e_input" SIZE="50"></TD>
<TD ALIGN="right"><INPUT TYPE="submit" VALUE="&nbsp;Talk&nbsp;"> <INPUT TYPE="reset" VALUE="Reset" onClick="window.setTimeout('elizaReset()',100)"></TD>
</TR>
</FORM>
<script src="./jquery.1.7.min.js"></script>
<script src="./clippy.js/build/clippy.js"></script>
<script type="text/javascript">
clippy.load('Clippy', function(agent){
agent.show();
//agent.play('Searching');
//agent.animate();
//agent.animations();
//agent.moveTo();
//agent.play();
agent.speak('Heeeeeeeeey!');
agent.animate();
agent.speak('Im Clippy!');
//agent.gestureAt(200,200);
//agent.stopCurrent();
//agent.stop();
});
</script>
</BODY>
</HTML>

@ -0,0 +1,134 @@
<HTML>
<HEAD>
<TITLE>Eliza Test</TITLE>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="elizabot.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="elizadata.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
// initialize with argument 'true': no random choices
var eliza = new ElizaBot(true);
var exampleLines= [
"Men are all alike.",
"They're always bugging us about something or other.",
"Well, my boyfriend made me come here.",
"He says I'm depressed much of the time.",
"It's true. I am unhappy.",
"I need some help, that much seems certain.",
"Perhaps I could learn to get along with my mother.",
"My mother takes care of me.",
"My father.",
"You are like my father in some ways.",
"You are not very aggressive but I think you don't want me to notice that.",
"You don't argue with me.",
"You are afraid of me.",
"My father is afraid of everybody.",
"Bullies."
];
var exampleCursor=0;
function elizaReset() {
eliza.reset();
exampleCursor=0;
}
function elizaNext() {
if (exampleCursor >= exampleLines.length) {
alert('Last entry reached.\nClick "Reset" to start over again.');
return;
}
var userinput = exampleLines[exampleCursor++];
document.forms.eform.edisplay.value += 'USER: ' + userinput + '\n';
document.forms.eform.edisplay.value += 'ELIZA: ' + eliza.transform(userinput) + '\n';
}
//-->
</SCRIPT>
</HEAD>
<BODY TOPMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0" BOTTOMMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0" STYLE="border:0"><A NAME="top"></A>
<CENTER>
<P>&nbsp;</P>
<H3>Eliza Test</H3>
<TABLE BORDER="0" CELLSPACING="10" CELLPADDING="0">
<FORM NAME="eform" onsubmit="return false">
<TR VALIGN="top">
<TD><TEXTAREA NAME="edisplay" COLS="80" ROWS="32"></TEXTAREA></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE="Next step" onclick="elizaNext()"><BR><BR><INPUT TYPE="reset" VALUE="Reset" onclick="elizaReset(); return true"></TD>
</TR>
</FORM>
</TABLE>
</CENTER>
<P>&nbsp;</P>
<TABLE BORDER="0" CELLSPACING="12" CELLPADDDING="0">
<TR>
<TD COLSPAN="2">
This is a test application for the <A HREF="index.html">JavaScript library &quot;elizabot.js&quot;</A> (Norbert Landsteiner 2005; &lt;http://www.masswerk.at&gt;).<BR>
The test application should produce the original example given by Joseph Weizenbaum in his article on ELIZA from Jannuary 1966 <A HREF="#ELIZA">[1]</A>.<BR> Click &quot;Next step&quot; to see the next input und and Eliza's answer. Click &quot;Reset&quot; to reset Eliza and the display form.</TD>
</TR>
<TR><TD COLSPAN="2">&nbsp;</TD></TR>
<TR><TD COLSPAN="2">This is the &quot;typical conversation&quot; as described by Joseph Weizenbaum:</TD></TR>
<TR>
<TD>&nbsp;</TD>
<TD>
Men are all alike.<BR><BR>
IN WHAT WAY?<BR><BR>
They're always bugging us about something or other.<BR><BR>
CAN YOU THINK OF A SPECIFIC EXAMPLE?<BR><BR>
Well, my boyfriend made me come here.<BR><BR>
YOUR BOYFRIEND MADE YOU COME HERE?<BR><BR>
He says I'm depressed much of the time.<BR><BR>
I AM SORRY TO HEAR YOU ARE DEPRESSED.<BR><BR>
It's true.<BR>
I am unhappy.<BR><BR>
DO YOU THINK COMING HERE WILL HELP YOU NOT TO BE UNHAPPY.<BR><BR>
I need some help, that much seems certain.<BR><BR>
WHAT WOULD IT MEAN TO YOU IF YOU GOT SOME HELP?<BR><BR>
Perhaps I could learn to get along with my mother.<BR><BR>
TELL ME MORE ABOUT YOUR FAMILY.<BR><BR>
My mother takes care of me.<BR><BR>
WHO ELSE IN YOUR FAMILY TAKES CARE OF YOU?<BR><BR>
My father.<BR><BR>
YOUR FATHER?<BR><BR>
You are like my father in some ways.<BR><BR>
WHAT RESEMBLANCE DO YOU SEE?<BR><BR>
You are not very aggressive<BR>
but I think you don't want me to notice that.<BR><BR>
WHAT MAKES YOU THINK I AM NOT VERY AGGRESSIVE?<BR><BR>
You don't argue with me.<BR><BR>
WHY DO YOU THINK I DON'T ARGUE WITH YOU?<BR><BR>
You are afraid of me.<BR><BR>
DOES IT PLEASE YOU TO BELIEVE I AM AFRAID OF YOU?<BR><BR>
My father is afraid of everybody.<BR><BR>
WHAT ELSE COMES TO YOUR MIND WHEN YOU THINK OF YOUR FATHER?<BR><BR>
Bullies.<BR><BR>
DOES THAT HAVE ANYTHING TO DO WITH THE FACT<BR>
THAT YOUR BOYFRIEND MADE YOU COME HERE?<BR>
&nbsp;
</TD>
</TR>
<TR><TD COLSPAN="2">(The capitalized lines are the machine responses.)</TD></TR>
<TR><TD COLSPAN="2">&nbsp;</TD></TR>
<TR><TD COLSPAN="2">References:</TD></TR>
<TR VALIGN="top">
<TD><A NAME="ELIZA"></A>[1]</TD>
<TD>
Weizenbaum, Joseph &quot;ELIZA &#150; A Computer Program For the Study of Natural Language
Communication Between Man and Machine&quot;<BR>
in: Communications of the ACM; Volume 9 , Issue 1 (January 1966): p 36-45.
</TD>
</TR>
<TR><TD COLSPAN="2">&nbsp;</TD></TR>
<TR><TD COLSPAN="2"><SMALL>&gt; <A HREF="#top">top of page</A></SMALL></TD></TR>
<TR><TD COLSPAN="2">&nbsp;</TD></TR>
<TR><TD COLSPAN="2" STYLE="font-family: arial,helvetica,sans-serif; font-size: 12px;">N. Landsteiner 2005; &lt;<A HREF="http://www.masswerk.at/" TARGET="_blank">http://www.masswerk.at</A>&gt;</SMALL></TD></TR>
<TR><TD COLSPAN="2">&nbsp;</TD></TR>
</TABLE>
</BODY>
</HTML>

@ -0,0 +1,391 @@
/*
elizabot.js v.1.1 - ELIZA JS library (N.Landsteiner 2005)
Eliza is a mock Rogerian psychotherapist.
Original program by Joseph Weizenbaum in MAD-SLIP for "Project MAC" at MIT.
cf: Weizenbaum, Joseph "ELIZA - A Computer Program For the Study of Natural Language
Communication Between Man and Machine"
in: Communications of the ACM; Volume 9 , Issue 1 (January 1966): p 36-45.
JavaScript implementation by Norbert Landsteiner 2005; <http://www.masserk.at>
synopsis:
new ElizaBot( <random-choice-disable-flag> )
ElizaBot.prototype.transform( <inputstring> )
ElizaBot.prototype.getInitial()
ElizaBot.prototype.getFinal()
ElizaBot.prototype.reset()
usage: var eliza = new ElizaBot();
var initial = eliza.getInitial();
var reply = eliza.transform(inputstring);
if (eliza.quit) {
// last user input was a quit phrase
}
// method `transform()' returns a final phrase in case of a quit phrase
// but you can also get a final phrase with:
var final = eliza.getFinal();
// other methods: reset memory and internal state
eliza.reset();
// to set the internal memory size override property `memSize':
eliza.memSize = 100; // (default: 20)
// to reproduce the example conversation given by J. Weizenbaum
// initialize with the optional random-choice-disable flag
var originalEliza = new ElizaBot(true);
`ElizaBot' is also a general chatbot engine that can be supplied with any rule set.
(for required data structures cf. "elizadata.js" and/or see the documentation.)
data is parsed and transformed for internal use at the creation time of the
first instance of the `ElizaBot' constructor.
vers 1.1: lambda functions in RegExps are currently a problem with too many browsers.
changed code to work around.
*/
function ElizaBot(noRandomFlag) {
this.noRandom= (noRandomFlag)? true:false;
this.capitalizeFirstLetter=true;
this.debug=false;
this.memSize=20;
this.version="1.1 (original)";
if (!this._dataParsed) this._init();
this.reset();
}
ElizaBot.prototype.reset = function() {
this.quit=false;
this.mem=[];
this.lastchoice=[];
for (var k=0; k<elizaKeywords.length; k++) {
this.lastchoice[k]=[];
var rules=elizaKeywords[k][2];
for (var i=0; i<rules.length; i++) this.lastchoice[k][i]=-1;
}
}
ElizaBot.prototype._dataParsed = false;
ElizaBot.prototype._init = function() {
// install ref to global object
var global=ElizaBot.prototype.global=self;
// parse data and convert it from canonical form to internal use
// prodoce synonym list
var synPatterns={};
if ((global.elizaSynons) && (typeof elizaSynons == 'object')) {
for (var i in elizaSynons) synPatterns[i]='('+i+'|'+elizaSynons[i].join('|')+')';
}
// check for keywords or install empty structure to prevent any errors
if ((!global.elizaKeywords) || (typeof elizaKeywords.length == 'undefined')) {
elizaKeywords=[['###',0,[['###',[]]]]];
}
// 1st convert rules to regexps
// expand synonyms and insert asterisk expressions for backtracking
var sre=/@(\S+)/;
var are=/(\S)\s*\*\s*(\S)/;
var are1=/^\s*\*\s*(\S)/;
var are2=/(\S)\s*\*\s*$/;
var are3=/^\s*\*\s*$/;
var wsre=/\s+/g;
for (var k=0; k<elizaKeywords.length; k++) {
var rules=elizaKeywords[k][2];
elizaKeywords[k][3]=k; // save original index for sorting
for (var i=0; i<rules.length; i++) {
var r=rules[i];
// check mem flag and store it as decomp's element 2
if (r[0].charAt(0)=='$') {
var ofs=1;
while (r[0].charAt[ofs]==' ') ofs++;
r[0]=r[0].substring(ofs);
r[2]=true;
}
else {
r[2]=false;
}
// expand synonyms (v.1.1: work around lambda function)
var m=sre.exec(r[0]);
while (m) {
var sp=(synPatterns[m[1]])? synPatterns[m[1]]:m[1];
r[0]=r[0].substring(0,m.index)+sp+r[0].substring(m.index+m[0].length);
m=sre.exec(r[0]);
}
// expand asterisk expressions (v.1.1: work around lambda function)
if (are3.test(r[0])) {
r[0]='\\s*(.*)\\s*';
}
else {
m=are.exec(r[0]);
if (m) {
var lp='';
var rp=r[0];
while (m) {
lp+=rp.substring(0,m.index+1);
if (m[1]!=')') lp+='\\b';
lp+='\\s*(.*)\\s*';
if ((m[2]!='(') && (m[2]!='\\')) lp+='\\b';
lp+=m[2];
rp=rp.substring(m.index+m[0].length);
m=are.exec(rp);
}
r[0]=lp+rp;
}
m=are1.exec(r[0]);
if (m) {
var lp='\\s*(.*)\\s*';
if ((m[1]!=')') && (m[1]!='\\')) lp+='\\b';
r[0]=lp+r[0].substring(m.index-1+m[0].length);
}
m=are2.exec(r[0]);
if (m) {
var lp=r[0].substring(0,m.index+1);
if (m[1]!='(') lp+='\\b';
r[0]=lp+'\\s*(.*)\\s*';
}
}
// expand white space
r[0]=r[0].replace(wsre, '\\s+');
wsre.lastIndex=0;
}
}
// now sort keywords by rank (highest first)
elizaKeywords.sort(this._sortKeywords);
// and compose regexps and refs for pres and posts
ElizaBot.prototype.pres={};
ElizaBot.prototype.posts={};
if ((global.elizaPres) && (elizaPres.length)) {
var a=new Array();
for (var i=0; i<elizaPres.length; i+=2) {
a.push(elizaPres[i]);
ElizaBot.prototype.pres[elizaPres[i]]=elizaPres[i+1];
}
ElizaBot.prototype.preExp = new RegExp('\\b('+a.join('|')+')\\b');
}
else {
// default (should not match)
ElizaBot.prototype.preExp = /####/;
ElizaBot.prototype.pres['####']='####';
}
if ((global.elizaPosts) && (elizaPosts.length)) {
var a=new Array();
for (var i=0; i<elizaPosts.length; i+=2) {
a.push(elizaPosts[i]);
ElizaBot.prototype.posts[elizaPosts[i]]=elizaPosts[i+1];
}
ElizaBot.prototype.postExp = new RegExp('\\b('+a.join('|')+')\\b');
}
else {
// default (should not match)
ElizaBot.prototype.postExp = /####/;
ElizaBot.prototype.posts['####']='####';
}
// check for elizaQuits and install default if missing
if ((!global.elizaQuits) || (typeof elizaQuits.length == 'undefined')) {
elizaQuits=[];
}
// done
ElizaBot.prototype._dataParsed=true;
}
ElizaBot.prototype._sortKeywords = function(a,b) {
// sort by rank
if (a[1]>b[1]) return -1
else if (a[1]<b[1]) return 1
// or original index
else if (a[3]>b[3]) return 1
else if (a[3]<b[3]) return -1
else return 0;
}
ElizaBot.prototype.transform = function(text) {
var rpl='';
this.quit=false;
// unify text string
text=text.toLowerCase();
text=text.replace(/@#\$%\^&\*\(\)_\+=~`\{\[\}\]\|:;<>\/\\\t/g, ' ');
text=text.replace(/\s+-+\s+/g, '.');
text=text.replace(/\s*[,\.\?!;]+\s*/g, '.');
text=text.replace(/\s*\bbut\b\s*/g, '.');
text=text.replace(/\s{2,}/g, ' ');
// split text in part sentences and loop through them
var parts=text.split('.');
for (var i=0; i<parts.length; i++) {
var part=parts[i];
if (part!='') {
// check for quit expression
for (var q=0; q<elizaQuits.length; q++) {
if (elizaQuits[q]==part) {
this.quit=true;
return this.getFinal();
}
}
// preprocess (v.1.1: work around lambda function)
var m=this.preExp.exec(part);
if (m) {
var lp='';
var rp=part;
while (m) {
lp+=rp.substring(0,m.index)+this.pres[m[1]];
rp=rp.substring(m.index+m[0].length);
m=this.preExp.exec(rp);
}
part=lp+rp;
}
this.sentence=part;
// loop trough keywords
for (var k=0; k<elizaKeywords.length; k++) {
if (part.search(new RegExp('\\b'+elizaKeywords[k][0]+'\\b', 'i'))>=0) {
rpl = this._execRule(k);
}
if (rpl!='') return rpl;
}
}
}
// nothing matched try mem
rpl=this._memGet();
// if nothing in mem, so try xnone
if (rpl=='') {
this.sentence=' ';
var k=this._getRuleIndexByKey('xnone');
if (k>=0) rpl=this._execRule(k);
}
// return reply or default string
return (rpl!='')? rpl : 'I am at a loss for words.';
}
ElizaBot.prototype._execRule = function(k) {
var rule=elizaKeywords[k];
var decomps=rule[2];
var paramre=/\(([0-9]+)\)/;
for (var i=0; i<decomps.length; i++) {
var m=this.sentence.match(decomps[i][0]);
if (m!=null) {
var reasmbs=decomps[i][1];
var memflag=decomps[i][2];
var ri= (this.noRandom)? 0 : Math.floor(Math.random()*reasmbs.length);
if (((this.noRandom) && (this.lastchoice[k][i]>ri)) || (this.lastchoice[k][i]==ri)) {
ri= ++this.lastchoice[k][i];
if (ri>=reasmbs.length) {
ri=0;
this.lastchoice[k][i]=-1;
}
}
else {
this.lastchoice[k][i]=ri;
}
var rpl=reasmbs[ri];
if (this.debug) alert('match:\nkey: '+elizaKeywords[k][0]+
'\nrank: '+elizaKeywords[k][1]+
'\ndecomp: '+decomps[i][0]+
'\nreasmb: '+rpl+
'\nmemflag: '+memflag);
if (rpl.search('^goto ', 'i')==0) {
ki=this._getRuleIndexByKey(rpl.substring(5));
if (ki>=0) return this._execRule(ki);
}
// substitute positional params (v.1.1: work around lambda function)
var m1=paramre.exec(rpl);
if (m1) {
var lp='';
var rp=rpl;
while (m1) {
var param = m[parseInt(m1[1])];
// postprocess param
var m2=this.postExp.exec(param);
if (m2) {
var lp2='';
var rp2=param;
while (m2) {
lp2+=rp2.substring(0,m2.index)+this.posts[m2[1]];
rp2=rp2.substring(m2.index+m2[0].length);
m2=this.postExp.exec(rp2);
}
param=lp2+rp2;
}
lp+=rp.substring(0,m1.index)+param;
rp=rp.substring(m1.index+m1[0].length);
m1=paramre.exec(rp);
}
rpl=lp+rp;
}
rpl=this._postTransform(rpl);
if (memflag) this._memSave(rpl)
else return rpl;
}
}
return '';
}
ElizaBot.prototype._postTransform = function(s) {
// final cleanings
s=s.replace(/\s{2,}/g, ' ');
s=s.replace(/\s+\./g, '.');
if ((this.global.elizaPostTransforms) && (elizaPostTransforms.length)) {
for (var i=0; i<elizaPostTransforms.length; i+=2) {
s=s.replace(elizaPostTransforms[i], elizaPostTransforms[i+1]);
elizaPostTransforms[i].lastIndex=0;
}
}
// capitalize first char (v.1.1: work around lambda function)
if (this.capitalizeFirstLetter) {
var re=/^([a-z])/;
var m=re.exec(s);
if (m) s=m[0].toUpperCase()+s.substring(1);
}
return s;
}
ElizaBot.prototype._getRuleIndexByKey = function(key) {
for (var k=0; k<elizaKeywords.length; k++) {
if (elizaKeywords[k][0]==key) return k;
}
return -1;
}
ElizaBot.prototype._memSave = function(t) {
this.mem.push(t);
if (this.mem.length>this.memSize) this.mem.shift();
}
ElizaBot.prototype._memGet = function() {
if (this.mem.length) {
if (this.noRandom) return this.mem.shift();
else {
var n=Math.floor(Math.random()*this.mem.length);
var rpl=this.mem[n];
for (var i=n+1; i<this.mem.length; i++) this.mem[i-1]=this.mem[i];
this.mem.length--;
return rpl;
}
}
else return '';
}
ElizaBot.prototype.getFinal = function() {
if (!ElizaBot.prototype.global.elizaFinals) return '';
return elizaFinals[Math.floor(Math.random()*elizaFinals.length)];
}
ElizaBot.prototype.getInitial = function() {
if (!ElizaBot.prototype.global.elizaInitials) return '';
return elizaInitials[Math.floor(Math.random()*elizaInitials.length)];
}
// fix array.prototype methods (push, shift) if not implemented (MSIE fix)
if (typeof Array.prototype.push == 'undefined') {
Array.prototype.push=function(v) { return this[this.length]=v; };
}
if (typeof Array.prototype.shift == 'undefined') {
Array.prototype.shift=function() {
if (this.length==0) return null;
var e0=this[0];
for (var i=1; i<this.length; i++) this[i-1]=this[i];
this.length--;
return e0;
};
}
// eof

@ -0,0 +1,611 @@
// data for elizabot.js
// entries prestructured as layed out in Weizenbaum's description
// [cf: Communications of the ACM, Vol. 9, #1 (January 1966): p 36-45.]
var elizaInitials = [
"How do you do. Please tell me your problem.",
// additions (not original)
"Please tell me what's been bothering you.",
"Is something troubling you ?"
];
var elizaFinals = [
"Goodbye. It was nice talking to you.",
// additions (not original)
"Goodbye. This was really a nice talk.",
"Goodbye. I'm looking forward to our next session.",
"This was a good session, wasn't it -- but time is over now. Goodbye.",
"Maybe we could discuss this moreover in our next session ? Goodbye."
];
var elizaQuits = [
"bye",
"goodbye",
"done",
"exit",
"quit"
];
var elizaPres = [
"dont", "don't",
"cant", "can't",
"wont", "won't",
"recollect", "remember",
"recall", "remember",
"dreamt", "dreamed",
"dreams", "dream",
"maybe", "perhaps",
"certainly", "yes",
"machine", "computer",
"machines", "computer",
"computers", "computer",
"were", "was",
"you're", "you are",
"i'm", "i am",
"same", "alike",
"identical", "alike",
"equivalent", "alike"
];
var elizaPosts = [
"am", "are",
"your", "my",
"me", "you",
"myself", "yourself",
"yourself", "myself",
"i", "you",
"you", "I",
"my", "your",
"i'm", "you are"
];
var elizaSynons = {
"be": ["am", "is", "are", "was"],
"belief": ["feel", "think", "believe", "wish"],
"cannot": ["can't"],
"desire": ["want", "need"],
"everyone": ["everybody", "nobody", "noone"],
"family": ["mother", "mom", "father", "dad", "sister", "brother", "wife", "children", "child"],
"happy": ["elated", "glad", "better"],
"sad": ["unhappy", "depressed", "sick"]
};
var elizaKeywords = [
/*
Array of
["<key>", <rank>, [
["<decomp>", [
"<reasmb>",
"<reasmb>",
"<reasmb>"
]],
["<decomp>", [
"<reasmb>",
"<reasmb>",
"<reasmb>"
]]
]]
*/
["xnone", 0, [
["*", [
"I'm not sure I understand you fully.",
"Please go on.",
"What does that suggest to you ?",
"Do you feel strongly about discussing such things ?",
"That is interesting. Please continue.",
"Tell me more about that.",
"Does talking about this bother you ?"
]]
]],
["sorry", 0, [
["*", [
"Please don't apologise.",
"Apologies are not necessary.",
"I've told you that apologies are not required.",
"It did not bother me. Please continue."
]]
]],
["apologise", 0, [
["*", [
"goto sorry"
]]
]],
["remember", 5, [
["* i remember *", [
"Do you often think of (2) ?",
"Does thinking of (2) bring anything else to mind ?",
"What else do you recollect ?",
"Why do you remember (2) just now ?",
"What in the present situation reminds you of (2) ?",
"What is the connection between me and (2) ?",
"What else does (2) remind you of ?"
]],
["* do you remember *", [
"Did you think I would forget (2) ?",
"Why do you think I should recall (2) now ?",
"What about (2) ?",
"goto what",
"You mentioned (2) ?"
]],
["* you remember *", [
"How could I forget (2) ?",
"What about (2) should I remember ?",
"goto you"
]]
]],
["forget", 5, [
["* i forget *", [
"Can you think of why you might forget (2) ?",
"Why can't you remember (2) ?",
"How often do you think of (2) ?",
"Does it bother you to forget that ?",
"Could it be a mental block ?",
"Are you generally forgetful ?",
"Do you think you are suppressing (2) ?"
]],
["* did you forget *", [
"Why do you ask ?",
"Are you sure you told me ?",
"Would it bother you if I forgot (2) ?",
"Why should I recall (2) just now ?",
"goto what",
"Tell me more about (2)."
]]
]],
["if", 3, [
["* if *", [
"Do you think it's likely that (2) ?",
"Do you wish that (2) ?",
"What do you know about (2) ?",
"Really, if (2) ?",
"What would you do if (2) ?",
"But what are the chances that (2) ?",
"What does this speculation lead to ?"
]]
]],
["dreamed", 4, [
["* i dreamed *", [
"Really, (2) ?",
"Have you ever fantasized (2) while you were awake ?",
"Have you ever dreamed (2) before ?",
"goto dream"
]]
]],
["dream", 3, [
["*", [
"What does that dream suggest to you ?",
"Do you dream often ?",
"What persons appear in your dreams ?",
"Do you believe that dreams have something to do with your problem ?"
]]
]],
["perhaps", 0, [
["*", [
"You don't seem quite certain.",
"Why the uncertain tone ?",
"Can't you be more positive ?",
"You aren't sure ?",
"Don't you know ?",
"How likely, would you estimate ?"
]]
]],
["name", 15, [
["*", [
"I am not interested in names.",
"I've told you before, I don't care about names -- please continue."
]]
]],
["deutsch", 0, [
["*", [
"goto xforeign",
"I told you before, I don't understand German."
]]
]],
["francais", 0, [
["*", [
"goto xforeign",
"I told you before, I don't understand French."
]]
]],
["italiano", 0, [
["*", [
"goto xforeign",
"I told you before, I don't understand Italian."
]]
]],
["espanol", 0, [
["*", [
"goto xforeign",
"I told you before, I don't understand Spanish."
]]
]],
["xforeign", 0, [
["*", [
"I speak only English."
]]
]],
["hello", 0, [
["*", [
"How do you do. Please state your problem.",
"Hi. What seems to be your problem ?"
]]
]],
["computer", 50, [
["*", [
"Do computers worry you ?",
"Why do you mention computers ?",
"What do you think machines have to do with your problem ?",
"Don't you think computers can help people ?",
"What about machines worries you ?",
"What do you think about machines ?",
"You don't think I am a computer program, do you ?"
]]
]],
["am", 0, [
["* am i *", [
"Do you believe you are (2) ?",
"Would you want to be (2) ?",
"Do you wish I would tell you you are (2) ?",
"What would it mean if you were (2) ?",
"goto what"
]],
["* i am *", [
"goto i"
]],
["*", [
"Why do you say 'am' ?",
"I don't understand that."
]]
]],
["are", 0, [
["* are you *", [
"Why are you interested in whether I am (2) or not ?",
"Would you prefer if I weren't (2) ?",
"Perhaps I am (2) in your fantasies.",
"Do you sometimes think I am (2) ?",
"goto what",
"Would it matter to you ?",
"What if I were (2) ?"
]],
["* you are *", [
"goto you"
]],
["* are *", [
"Did you think they might not be (2) ?",
"Would you like it if they were not (2) ?",
"What if they were not (2) ?",
"Are they always (2) ?",
"Possibly they are (2).",
"Are you positive they are (2) ?"
]]
]],
["your", 0, [
["* your *", [
"Why are you concerned over my (2) ?",
"What about your own (2) ?",
"Are you worried about someone else's (2) ?",
"Really, my (2) ?",
"What makes you think of my (2) ?",
"Do you want my (2) ?"
]]
]],
["was", 2, [
["* was i *", [
"What if you were (2) ?",
"Do you think you were (2) ?",
"Were you (2) ?",
"What would it mean if you were (2) ?",
"What does ' (2) ' suggest to you ?",
"goto what"
]],
["* i was *", [
"Were you really ?",
"Why do you tell me you were (2) now ?",
"Perhaps I already know you were (2)."
]],
["* was you *", [
"Would you like to believe I was (2) ?",
"What suggests that I was (2) ?",
"What do you think ?",
"Perhaps I was (2).",
"What if I had been (2) ?"
]]
]],
["i", 0, [
["* i @desire *", [
"What would it mean to you if you got (3) ?",
"Why do you want (3) ?",
"Suppose you got (3) soon.",
"What if you never got (3) ?",
"What would getting (3) mean to you ?",
"What does wanting (3) have to do with this discussion ?"
]],
["* i am* @sad *", [
"I am sorry to hear that you are (3).",
"Do you think coming here will help you not to be (3) ?",
"I'm sure it's not pleasant to be (3).",
"Can you explain what made you (3) ?"
]],
["* i am* @happy *", [
"How have I helped you to be (3) ?",
"Has your treatment made you (3) ?",
"What makes you (3) just now ?",
"Can you explain why you are suddenly (3) ?"
]],
["* i was *", [
"goto was"
]],
["* i @belief i *", [
"Do you really think so ?",
"But you are not sure you (3).",
"Do you really doubt you (3) ?"
]],
["* i* @belief *you *", [
"goto you"
]],
["* i am *", [
"Is it because you are (2) that you came to me ?",
"How long have you been (2) ?",
"Do you believe it is normal to be (2) ?",
"Do you enjoy being (2) ?",
"Do you know anyone else who is (2) ?"
]],
["* i @cannot *", [
"How do you know that you can't (3) ?",
"Have you tried ?",
"Perhaps you could (3) now.",
"Do you really want to be able to (3) ?",
"What if you could (3) ?"
]],
["* i don't *", [
"Don't you really (2) ?",
"Why don't you (2) ?",
"Do you wish to be able to (2) ?",
"Does that trouble you ?"
]],
["* i feel *", [
"Tell me more about such feelings.",
"Do you often feel (2) ?",
"Do you enjoy feeling (2) ?",
"Of what does feeling (2) remind you ?"
]],
["* i * you *", [
"Perhaps in your fantasies we (2) each other.",
"Do you wish to (2) me ?",
"You seem to need to (2) me.",
"Do you (2) anyone else ?"
]],
["*", [
"You say (1) ?",
"Can you elaborate on that ?",
"Do you say (1) for some special reason ?",
"That's quite interesting."
]]
]],
["you", 0, [
["* you remind me of *", [
"goto alike"
]],
["* you are *", [
"What makes you think I am (2) ?",
"Does it please you to believe I am (2) ?",
"Do you sometimes wish you were (2) ?",
"Perhaps you would like to be (2)."
]],
["* you* me *", [
"Why do you think I (2) you ?",
"You like to think I (2) you -- don't you ?",
"What makes you think I (2) you ?",
"Really, I (2) you ?",
"Do you wish to believe I (2) you ?",
"Suppose I did (2) you -- what would that mean ?",
"Does someone else believe I (2) you ?"
]],
["* you *", [
"We were discussing you -- not me.",
"Oh, I (2) ?",
"You're not really talking about me -- are you ?",
"What are your feelings now ?"
]]
]],
["yes", 0, [
["*", [
"You seem to be quite positive.",
"You are sure.",
"I see.",
"I understand."
]]
]],
["no", 0, [
["* no one *", [
"Are you sure, no one (2) ?",
"Surely someone (2) .",
"Can you think of anyone at all ?",
"Are you thinking of a very special person ?",
"Who, may I ask ?",
"You have a particular person in mind, don't you ?",
"Who do you think you are talking about ?"
]],
["*", [
"Are you saying no just to be negative?",
"You are being a bit negative.",
"Why not ?",
"Why 'no' ?"
]]
]],
["my", 2, [
["$ * my *", [
"Does that have anything to do with the fact that your (2) ?",
"Lets discuss further why your (2).",
"Earlier you said your (2).",
"But your (2)."
]],
["* my* @family *", [
"Tell me more about your family.",
"Who else in your family (4) ?",
"Your (3) ?",
"What else comes to your mind when you think of your (3) ?"
]],
["* my *", [
"Your (2) ?",
"Why do you say your (2) ?",
"Does that suggest anything else which belongs to you ?",
"Is it important to you that your (2) ?"
]]
]],
["can", 0, [
["* can you *", [
"You believe I can (2) don't you ?",
"goto what",
"You want me to be able to (2).",
"Perhaps you would like to be able to (2) yourself."
]],
["* can i *", [
"Whether or not you can (2) depends on you more than on me.",
"Do you want to be able to (2) ?",
"Perhaps you don't want to (2).",
"goto what"
]]
]],
["what", 0, [
["*", [
"Why do you ask ?",
"Does that question interest you ?",
"What is it you really want to know ?",
"Are such questions much on your mind ?",
"What answer would please you most ?",
"What do you think ?",
"What comes to mind when you ask that ?",
"Have you asked such questions before ?",
"Have you asked anyone else ?"
]]
]],
["who", 0, [
["who *", [
"goto what"
]]
]],
["when", 0, [
["when *", [
"goto what"
]]
]],
["where", 0, [
["where *", [
"goto what"
]]
]],
["how", 0, [
["how *", [
"goto what"
]]
]],
["because", 0, [
["*", [
"Is that the real reason ?",
"Don't any other reasons come to mind ?",
"Does that reason seem to explain anything else ?",
"What other reasons might there be ?"
]]
]],
["why", 0, [
["* why don't you *", [
"Do you believe I don't (2) ?",
"Perhaps I will (2) in good time.",
"Should you (2) yourself ?",
"You want me to (2) ?",
"goto what"
]],
["* why can't i *", [
"Do you think you should be able to (2) ?",
"Do you want to be able to (2) ?",
"Do you believe this will help you to (2) ?",
"Have you any idea why you can't (2) ?",
"goto what"
]],
["*", [
"goto what"
]]
]],
["everyone", 2, [
["* @everyone *", [
"Really, (2) ?",
"Surely not (2).",
"Can you think of anyone in particular ?",
"Who, for example?",
"Are you thinking of a very special person ?",
"Who, may I ask ?",
"Someone special perhaps ?",
"You have a particular person in mind, don't you ?",
"Who do you think you're talking about ?"
]]
]],
["everybody", 2, [
["*", [
"goto everyone"
]]
]],
["nobody", 2, [
["*", [
"goto everyone"
]]
]],
["noone", 2, [
["*", [
"goto everyone"
]]
]],
["always", 1, [
["*", [
"Can you think of a specific example ?",
"When ?",
"What incident are you thinking of ?",
"Really, always ?"
]]
]],
["alike", 10, [
["*", [
"In what way ?",
"What resemblence do you see ?",
"What does that similarity suggest to you ?",
"What other connections do you see ?",
"What do you suppose that resemblence means ?",
"What is the connection, do you suppose ?",
"Could there really be some connection ?",
"How ?"
]]
]],
["like", 10, [
["* @be *like *", [
"goto alike"
]]
]],
["different", 0, [
["*", [
"How is it different ?",
"What differences do you see ?",
"What does that difference suggest to you ?",
"What other distinctions do you see ?",
"What do you suppose that disparity means ?",
"Could there be some connection, do you suppose ?",
"How ?"
]]
]]
];
// regexp/replacement pairs to be performed as final cleanings
// here: cleanings for multiple bots talking to each other
var elizaPostTransforms = [
/ old old/g, " old",
/\bthey were( not)? me\b/g, "it was$1 me",
/\bthey are( not)? me\b/g, "it is$1 me",
/Are they( always)? me\b/, "it is$1 me",
/\bthat your( own)? (\w+)( now)? \?/, "that you have your$1 $2 ?",
/\bI to have (\w+)/, "I have $1",
/Earlier you said your( own)? (\w+)( now)?\./, "Earlier you talked about your $2."
];
// eof

@ -0,0 +1,108 @@
<HTML>
<HEAD>
<meta charset="utf-8">
<TITLE>Eliza (elizabot.js)</TITLE>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="elizabot.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="elizadata.js"></SCRIPT>
<link rel="stylesheet" type="text/css" href="./clippy.js/build/clippy.css" media="all">
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
var eliza = new ElizaBot();
var elizaLines = new Array();
var displayCols = 60;
var displayRows = 20;
function elizaReset() {
eliza.reset();
elizaLines.length = 0;
elizaStep();
}
function elizaStep() {
var f = document.forms.e_form;
var userinput = f.e_input.value;
if (eliza.quit) {
f.e_input.value = '';
if (confirm("This session is over.\nStart over?")) elizaReset();
f.e_input.focus();
return;
}
else if (userinput != '') {
var usr = 'YOU: ' + userinput;
var rpl ='ELIZA: ' + eliza.transform(userinput);
elizaLines.push(usr);
elizaLines.push(rpl);
console.log(rpl);
// display nicely
// (fit to textarea with last line free - reserved for extra line caused by word wrap)
var temp = new Array();
var l = 0;
for (var i=elizaLines.length-1; i>=0; i--) {
l += 1 + Math.floor(elizaLines[i].length/displayCols);
if (l >= displayRows) break
else temp.push(elizaLines[i]);
}
elizaLines = temp.reverse();
f.e_display.value = elizaLines.join('\n');
}
else if (elizaLines.length == 0) {
// no input and no saved lines -> output initial
var initial = 'ELIZA: ' + eliza.getInitial();
elizaLines.push(initial);
f.e_display.value = initial + '\n';
}
f.e_input.value = '';
f.e_input.focus();
}
//-->
</SCRIPT>
</HEAD>
<BODY TOPMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0" BOTTOMMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0" STYLE="border:0" onload="window.setTimeout('elizaReset()',100)"><A NAME="top"></A>
<CENTER>
<P>&nbsp;</P>
<H3>Eliza</H3>
<TABLE BORDER="0" CELLSPACING="10" CELLPADDING="0">
<FORM NAME="e_form" onsubmit="elizaStep();return false">
<TR><TD COLSPAN="2"><TEXTAREA NAME="e_display" COLS="60" ROWS="20"></TEXTAREA></TD></TR>
<TR VALIGN="middle">
<TD><INPUT TYPE="text" NAME="e_input" SIZE="50"></TD>
<TD ALIGN="right"><INPUT TYPE="submit" VALUE="&nbsp;Talk&nbsp;"> <INPUT TYPE="reset" VALUE="Reset" onClick="window.setTimeout('elizaReset()',100)"></TD>
</TR>
</FORM>
<script src="./jquery.1.7.min.js"></script>
<script src="./clippy.js/build/clippy.js"></script>
<script type="text/javascript">
clippy.load('Clippy', function(agent){
agent.show();
//agent.play('Searching');
//agent.animate();
//agent.animations();
//agent.moveTo();
//agent.play();
agent.speak('Heeeeeeeeey!');
agent.animate();
agent.speak('Im Clippy!');
//agent.gestureAt(200,200);
//agent.stopCurrent();
//agent.stop();
});
</script>
</BODY>
</HTML>

@ -0,0 +1,611 @@
// data for elizabot.js
// entries prestructured as layed out in Weizenbaum's description
// [cf: Communications of the ACM, Vol. 9, #1 (January 1966): p 36-45.]
var elizaInitials = [
"How do you do. Please tell me your problem.",
// additions (not original)
"Please tell me what's been bothering you.",
"Is something troubling you ?"
];
var elizaFinals = [
"Goodbye. It was nice talking to you.",
// additions (not original)
"Goodbye. This was really a nice talk.",
"Goodbye. I'm looking forward to our next session.",
"This was a good session, wasn't it -- but time is over now. Goodbye.",
"Maybe we could discuss this moreover in our next session ? Goodbye."
];
var elizaQuits = [
"bye",
"goodbye",
"done",
"exit",
"quit"
];
var elizaPres = [
"dont", "don't",
"cant", "can't",
"wont", "won't",
"recollect", "remember",
"recall", "remember",
"dreamt", "dreamed",
"dreams", "dream",
"maybe", "perhaps",
"certainly", "yes",
"machine", "computer",
"machines", "computer",
"computers", "computer",
"were", "was",
"you're", "you are",
"i'm", "i am",
"same", "alike",
"identical", "alike",
"equivalent", "alike"
];
var elizaPosts = [
"am", "are",
"your", "my",
"me", "you",
"myself", "yourself",
"yourself", "myself",
"i", "you",
"you", "I",
"my", "your",
"i'm", "you are"
];
var elizaSynons = {
"be": ["am", "is", "are", "was"],
"belief": ["feel", "think", "believe", "wish"],
"cannot": ["can't"],
"desire": ["want", "need"],
"everyone": ["everybody", "nobody", "noone"],
"family": ["mother", "mom", "father", "dad", "sister", "brother", "wife", "children", "child"],
"happy": ["elated", "glad", "better"],
"sad": ["unhappy", "depressed", "sick"]
};
var elizaKeywords = [
/*
Array of
["<key>", <rank>, [
["<decomp>", [
"<reasmb>",
"<reasmb>",
"<reasmb>"
]],
["<decomp>", [
"<reasmb>",
"<reasmb>",
"<reasmb>"
]]
]]
*/
["xnone", 0, [
["*", [
"I'm not sure I understand you fully.",
"Please go on.",
"What does that suggest to you ?",
"Do you feel strongly about discussing such things ?",
"That is interesting. Please continue.",
"Tell me more about that.",
"Does talking about this bother you ?"
]]
]],
["sorry", 0, [
["*", [
"Please don't apologise.",
"Apologies are not necessary.",
"I've told you that apologies are not required.",
"It did not bother me. Please continue."
]]
]],
["apologise", 0, [
["*", [
"goto sorry"
]]
]],
["remember", 5, [
["* i remember *", [
"Do you often think of (2) ?",
"Does thinking of (2) bring anything else to mind ?",
"What else do you recollect ?",
"Why do you remember (2) just now ?",
"What in the present situation reminds you of (2) ?",
"What is the connection between me and (2) ?",
"What else does (2) remind you of ?"
]],
["* do you remember *", [
"Did you think I would forget (2) ?",
"Why do you think I should recall (2) now ?",
"What about (2) ?",
"goto what",
"You mentioned (2) ?"
]],
["* you remember *", [
"How could I forget (2) ?",
"What about (2) should I remember ?",
"goto you"
]]
]],
["forget", 5, [
["* i forget *", [
"Can you think of why you might forget (2) ?",
"Why can't you remember (2) ?",
"How often do you think of (2) ?",
"Does it bother you to forget that ?",
"Could it be a mental block ?",
"Are you generally forgetful ?",
"Do you think you are suppressing (2) ?"
]],
["* did you forget *", [
"Why do you ask ?",
"Are you sure you told me ?",
"Would it bother you if I forgot (2) ?",
"Why should I recall (2) just now ?",
"goto what",
"Tell me more about (2)."
]]
]],
["if", 3, [
["* if *", [
"Do you think it's likely that (2) ?",
"Do you wish that (2) ?",
"What do you know about (2) ?",
"Really, if (2) ?",
"What would you do if (2) ?",
"But what are the chances that (2) ?",
"What does this speculation lead to ?"
]]
]],
["dreamed", 4, [
["* i dreamed *", [
"Really, (2) ?",
"Have you ever fantasized (2) while you were awake ?",
"Have you ever dreamed (2) before ?",
"goto dream"
]]
]],
["dream", 3, [
["*", [
"What does that dream suggest to you ?",
"Do you dream often ?",
"What persons appear in your dreams ?",
"Do you believe that dreams have something to do with your problem ?"
]]
]],
["perhaps", 0, [
["*", [
"You don't seem quite certain.",
"Why the uncertain tone ?",
"Can't you be more positive ?",
"You aren't sure ?",
"Don't you know ?",
"How likely, would you estimate ?"
]]
]],
["name", 15, [
["*", [
"I am not interested in names.",
"I've told you before, I don't care about names -- please continue."
]]
]],
["deutsch", 0, [
["*", [
"goto xforeign",
"I told you before, I don't understand German."
]]
]],
["francais", 0, [
["*", [
"goto xforeign",
"I told you before, I don't understand French."
]]
]],
["italiano", 0, [
["*", [
"goto xforeign",
"I told you before, I don't understand Italian."
]]
]],
["espanol", 0, [
["*", [
"goto xforeign",
"I told you before, I don't understand Spanish."
]]
]],
["xforeign", 0, [
["*", [
"I speak only English."
]]
]],
["hello", 0, [
["*", [
"How do you do. Please state your problem.",
"Hi. What seems to be your problem ?"
]]
]],
["computer", 50, [
["*", [
"Do computers worry you ?",
"Why do you mention computers ?",
"What do you think machines have to do with your problem ?",
"Don't you think computers can help people ?",
"What about machines worries you ?",
"What do you think about machines ?",
"You don't think I am a computer program, do you ?"
]]
]],
["am", 0, [
["* am i *", [
"Do you believe you are (2) ?",
"Would you want to be (2) ?",
"Do you wish I would tell you you are (2) ?",
"What would it mean if you were (2) ?",
"goto what"
]],
["* i am *", [
"goto i"
]],
["*", [
"Why do you say 'am' ?",
"I don't understand that."
]]
]],
["are", 0, [
["* are you *", [
"Why are you interested in whether I am (2) or not ?",
"Would you prefer if I weren't (2) ?",
"Perhaps I am (2) in your fantasies.",
"Do you sometimes think I am (2) ?",
"goto what",
"Would it matter to you ?",
"What if I were (2) ?"
]],
["* you are *", [
"goto you"
]],
["* are *", [
"Did you think they might not be (2) ?",
"Would you like it if they were not (2) ?",
"What if they were not (2) ?",
"Are they always (2) ?",
"Possibly they are (2).",
"Are you positive they are (2) ?"
]]
]],
["your", 0, [
["* your *", [
"Why are you concerned over my (2) ?",
"What about your own (2) ?",
"Are you worried about someone else's (2) ?",
"Really, my (2) ?",
"What makes you think of my (2) ?",
"Do you want my (2) ?"
]]
]],
["was", 2, [
["* was i *", [
"What if you were (2) ?",
"Do you think you were (2) ?",
"Were you (2) ?",
"What would it mean if you were (2) ?",
"What does ' (2) ' suggest to you ?",
"goto what"
]],
["* i was *", [
"Were you really ?",
"Why do you tell me you were (2) now ?",
"Perhaps I already know you were (2)."
]],
["* was you *", [
"Would you like to believe I was (2) ?",
"What suggests that I was (2) ?",
"What do you think ?",
"Perhaps I was (2).",
"What if I had been (2) ?"
]]
]],
["i", 0, [
["* i @desire *", [
"What would it mean to you if you got (3) ?",
"Why do you want (3) ?",
"Suppose you got (3) soon.",
"What if you never got (3) ?",
"What would getting (3) mean to you ?",
"What does wanting (3) have to do with this discussion ?"
]],
["* i am* @sad *", [
"I am sorry to hear that you are (3).",
"Do you think coming here will help you not to be (3) ?",
"I'm sure it's not pleasant to be (3).",
"Can you explain what made you (3) ?"
]],
["* i am* @happy *", [
"How have I helped you to be (3) ?",
"Has your treatment made you (3) ?",
"What makes you (3) just now ?",
"Can you explain why you are suddenly (3) ?"
]],
["* i was *", [
"goto was"
]],
["* i @belief i *", [
"Do you really think so ?",
"But you are not sure you (3).",
"Do you really doubt you (3) ?"
]],
["* i* @belief *you *", [
"goto you"
]],
["* i am *", [
"Is it because you are (2) that you came to me ?",
"How long have you been (2) ?",
"Do you believe it is normal to be (2) ?",
"Do you enjoy being (2) ?",
"Do you know anyone else who is (2) ?"
]],
["* i @cannot *", [
"How do you know that you can't (3) ?",
"Have you tried ?",
"Perhaps you could (3) now.",
"Do you really want to be able to (3) ?",
"What if you could (3) ?"
]],
["* i don't *", [
"Don't you really (2) ?",
"Why don't you (2) ?",
"Do you wish to be able to (2) ?",
"Does that trouble you ?"
]],
["* i feel *", [
"Tell me more about such feelings.",
"Do you often feel (2) ?",
"Do you enjoy feeling (2) ?",
"Of what does feeling (2) remind you ?"
]],
["* i * you *", [
"Perhaps in your fantasies we (2) each other.",
"Do you wish to (2) me ?",
"You seem to need to (2) me.",
"Do you (2) anyone else ?"
]],
["*", [
"You say (1) ?",
"Can you elaborate on that ?",
"Do you say (1) for some special reason ?",
"That's quite interesting."
]]
]],
["you", 0, [
["* you remind me of *", [
"goto alike"
]],
["* you are *", [
"What makes you think I am (2) ?",
"Does it please you to believe I am (2) ?",
"Do you sometimes wish you were (2) ?",
"Perhaps you would like to be (2)."
]],
["* you* me *", [
"Why do you think I (2) you ?",
"You like to think I (2) you -- don't you ?",
"What makes you think I (2) you ?",
"Really, I (2) you ?",
"Do you wish to believe I (2) you ?",
"Suppose I did (2) you -- what would that mean ?",
"Does someone else believe I (2) you ?"
]],
["* you *", [
"We were discussing you -- not me.",
"Oh, I (2) ?",
"You're not really talking about me -- are you ?",
"What are your feelings now ?"
]]
]],
["yes", 0, [
["*", [
"You seem to be quite positive.",
"You are sure.",
"I see.",
"I understand."
]]
]],
["no", 0, [
["* no one *", [
"Are you sure, no one (2) ?",
"Surely someone (2) .",
"Can you think of anyone at all ?",
"Are you thinking of a very special person ?",
"Who, may I ask ?",
"You have a particular person in mind, don't you ?",
"Who do you think you are talking about ?"
]],
["*", [
"Are you saying no just to be negative?",
"You are being a bit negative.",
"Why not ?",
"Why 'no' ?"
]]
]],
["my", 2, [
["$ * my *", [
"Does that have anything to do with the fact that your (2) ?",
"Lets discuss further why your (2).",
"Earlier you said your (2).",
"But your (2)."
]],
["* my* @family *", [
"Tell me more about your family.",
"Who else in your family (4) ?",
"Your (3) ?",
"What else comes to your mind when you think of your (3) ?"
]],
["* my *", [
"Your (2) ?",
"Why do you say your (2) ?",
"Does that suggest anything else which belongs to you ?",
"Is it important to you that your (2) ?"
]]
]],
["can", 0, [
["* can you *", [
"You believe I can (2) don't you ?",
"goto what",
"You want me to be able to (2).",
"Perhaps you would like to be able to (2) yourself."
]],
["* can i *", [
"Whether or not you can (2) depends on you more than on me.",
"Do you want to be able to (2) ?",
"Perhaps you don't want to (2).",
"goto what"
]]
]],
["what", 0, [
["*", [
"Why do you ask ?",
"Does that question interest you ?",
"What is it you really want to know ?",
"Are such questions much on your mind ?",
"What answer would please you most ?",
"What do you think ?",
"What comes to mind when you ask that ?",
"Have you asked such questions before ?",
"Have you asked anyone else ?"
]]
]],
["who", 0, [
["who *", [
"goto what"
]]
]],
["when", 0, [
["when *", [
"goto what"
]]
]],
["where", 0, [
["where *", [
"goto what"
]]
]],
["how", 0, [
["how *", [
"goto what"
]]
]],
["because", 0, [
["*", [
"Is that the real reason ?",
"Don't any other reasons come to mind ?",
"Does that reason seem to explain anything else ?",
"What other reasons might there be ?"
]]
]],
["why", 0, [
["* why don't you *", [
"Do you believe I don't (2) ?",
"Perhaps I will (2) in good time.",
"Should you (2) yourself ?",
"You want me to (2) ?",
"goto what"
]],
["* why can't i *", [
"Do you think you should be able to (2) ?",
"Do you want to be able to (2) ?",
"Do you believe this will help you to (2) ?",
"Have you any idea why you can't (2) ?",
"goto what"
]],
["*", [
"goto what"
]]
]],
["everyone", 2, [
["* @everyone *", [
"Really, (2) ?",
"Surely not (2).",
"Can you think of anyone in particular ?",
"Who, for example?",
"Are you thinking of a very special person ?",
"Who, may I ask ?",
"Someone special perhaps ?",
"You have a particular person in mind, don't you ?",
"Who do you think you're talking about ?"
]]
]],
["everybody", 2, [
["*", [
"goto everyone"
]]
]],
["nobody", 2, [
["*", [
"goto everyone"
]]
]],
["noone", 2, [
["*", [
"goto everyone"
]]
]],
["always", 1, [
["*", [
"Can you think of a specific example ?",
"When ?",
"What incident are you thinking of ?",
"Really, always ?"
]]
]],
["alike", 10, [
["*", [
"In what way ?",
"What resemblence do you see ?",
"What does that similarity suggest to you ?",
"What other connections do you see ?",
"What do you suppose that resemblence means ?",
"What is the connection, do you suppose ?",
"Could there really be some connection ?",
"How ?"
]]
]],
["like", 10, [
["* @be *like *", [
"goto alike"
]]
]],
["different", 0, [
["*", [
"How is it different ?",
"What differences do you see ?",
"What does that difference suggest to you ?",
"What other distinctions do you see ?",
"What do you suppose that disparity means ?",
"Could there be some connection, do you suppose ?",
"How ?"
]]
]]
];
// regexp/replacement pairs to be performed as final cleanings
// here: cleanings for multiple bots talking to each other
var elizaPostTransforms = [
/ old old/g, " old",
/\bthey were( not)? me\b/g, "it was$1 me",
/\bthey are( not)? me\b/g, "it is$1 me",
/Are they( always)? me\b/, "it is$1 me",
/\bthat your( own)? (\w+)( now)? \?/, "that you have your$1 $2 ?",
/\bI to have (\w+)/, "I have $1",
/Earlier you said your( own)? (\w+)( now)?\./, "Earlier you talked about your $2."
];
// eof

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Clippy</title>
<link rel="stylesheet" type="text/css" href="./clippy.js/build/clippy.css" media="all">
</head>
<body>
<h1>Hello Clippy!</h1>
<script src="./jquery.1.7.min.js"></script>
<script src="./clippy.js/build/clippy.js"></script>
<script type="text/javascript">
clippy.load('Clippy', function(agent){
agent.show();
//agent.play('Searching');
//agent.animate();
//agent.animations();
//agent.moveTo();
//agent.play();
agent.speak('Heeeeeeeeey!');
agent.animate();
agent.speak('Im Clippy!');
//agent.gestureAt(200,200);
//agent.stopCurrent();
//agent.stop();
});
</script>
</body>
</html>

@ -0,0 +1,50 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Clippy</title>
<link rel="stylesheet" type="text/css" href="./clippy.js/build/clippy.css" media="all">
<link rel="stylesheet" type="text/css" href="./it_seems_like.js" media="all">
</head>
<body>
<h1>Hello Clippy!</h1>
<script src="./jquery.1.7.min.js"></script>
<script src="./clippy.js/build/clippy.js"></script>
<script type="text/javascript">
var x = ["It looks like you're writing a letter: Microsoft Word", 'A recent film has one character blown to death at their keyboard.', 'Underneath the desk they sit at is a bomb controlled by a keystroke counter. ', 'When the number of taps on the keyboard drops below a certain number, off goes the explosive. ', 'A real innovation in the switching system the bomb uses is that it is tied into the grammar check in Microsoft Word. ', 'The victim is unable to keep tapping away at the same key until help arrives. ', 'They have to keep composing grammatically correct sentences, line after line, through the cramp in their fingers.', "Needless to say, knowing this is both a sure wellspring of verbiage and a scriptwriter's shortcut to bathos, they compose a last letter to their loved ones.", "Eventually though, the agrammaticality of their emotions or of tiredness sprawls out of even these second guessed finger-tips and as a green line appears under a patiently panicked phrase, up they go.", '', 'This lot is being written with every toolbar visible, every feature enabled. ', 'One third of the screen, a large one, is taken up with grey toolbars pocked with icons. ', "There is a constant clatter of audio feedback clicking, shuffling and chiming as the user's attention is pulled away from putting together a piece of writing into the manufacture of the text as a perfectly primped document. ", 'As you read, understand that these words are to appear against a background fill effect of white, grey-veined marble.'];
clippy.load('Clippy', function(agent){
agent.show();
//agent.play('Searching');
//agent.animate();
//agent.animations();
//agent.moveTo();
//agent.play();
var i = 0
$( "*" ).click(function() {
agent.speak(x[i]);
i += 1;
});
agent.animate();
agent.speak('Hi. Im Clippy!');
//agent.gestureAt(200,200);
//agent.stopCurrent();
//agent.stop();
});
</script>
</body>
</html>

@ -0,0 +1 @@
var x = ["It looks like you're writing a letter: Microsoft Word", '', 'A recent film has one character blown to death at their keyboard.', 'Underneath the desk they sit at is a bomb controlled by a keystroke counter. ', 'When the number of taps on the keyboard drops below a certain number, off goes the explosive. ', 'A real innovation in the switching system the bomb uses is that it is tied into the grammar check in Microsoft Word. ', 'The victim is unable to keep tapping away at the same key until help arrives. ', 'They have to keep composing grammatically correct sentences, line after line, through the cramp in their fingers.', '', "Needless to say, knowing this is both a sure wellspring of verbiage and a scriptwriter's shortcut to bathos, they compose a last letter to their loved ones. Eventually though, the agrammaticality of their emotions or of tiredness sprawls out of even these second guessed finger-tips and as a green line appears under a patiently panicked phrase, up they go.", '', 'This lot is being written with every toolbar visible, every feature enabled. ', 'One third of the screen, a large one, is taken up with grey toolbars pocked with icons. ', "There is a constant clatter of audio feedback clicking, shuffling and chiming as the user's attention is pulled away from putting together a piece of writing into the manufacture of the text as a perfectly primped document. ", 'As you read, understand that these words are to appear against a background fill effect of white, grey-veined marble.', '', '', ''];

File diff suppressed because one or more lines are too long

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<title>videostretcher</title>
<style type="text/css">
body{
background-color: black;
}
#a {
transform: scale(300,0.5);
}
#b {
transform: scale(0.5,300);
}
#c {
transform: scale(0.5,300) rotate(385deg) translate(265%,-224%);
}
</style>
</head>
<body>
<iframe id="b" width="560" height="315" src="https://www.youtube.com/embed/0P2VCMT8vAw" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<iframe id="a" width="560" height="315" src="https://www.youtube.com/embed/0P2VCMT8vAw" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<iframe id="c" width="560" height="315" src="https://www.youtube.com/embed/0P2VCMT8vAw" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</body>
</html>

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
var x = ['Everybody on earth knowing', 'that beauty is beautiful', 'makes ugliness.', 'Everybody knowing', 'that goodness is good', 'makes wickedness.', 'For being and nonbeing', 'arise together;', 'hard and easy', 'complete each other;', 'long and short', 'shape each other;', 'high and low', 'depend on each other;', 'note and voice', 'make the music together;', 'before and after', 'follow each other.', 'Thats why the wise soul', 'does without doing,', 'teaches without talking.', 'The things ofthis world', 'exist, they are;', 'you cant refuse them.', 'To bear and not to own;'];

@ -0,0 +1 @@
var x = ['scientific method', 'science', 'empirical evidences', 'positivism', 'functional', 'dynamical', 'structural properties', 'consciousness', 'mind', 'cognitionthought', 'knowledge', 'intelligence', 'self-awareness', 'agency', 'mind-body problem', 'subjective experience', 'phenomenal consciousness', 'explanatory gap', 'neurophenomenology', 'materialism', 'physicalism', 'naturalism', 'reductionism', 'panpsychism', 'mysterianism', 'dualism', 'monismo dialettico', 'modellization of the mind', 'technical system', 'autonomous machines', 'intelligent machines', 'adaptive machines', 'sentient machine', 'machinic life ', 'hardware', 'software', 'human-constructed environment', 'material', 'virtual', 'techné', 'talos', 'automaton', 'dedalos', 'architectural design', 'labyrinth', 'technological discoveries', 'machine', 'machinery', 'machinic', 'mechanical', 'cybernetics', 'steam engine', 'thermodynamics', 'creation - evolution controversy', 'agency', 'wallace', 'vapour engine', 'evolutionary process', 'buttler', 'erewhon', 'darwin amongst the machines', 'teleology', 'purpose', 'evolution', 'feedback loop', 'adaptation', 'cannon', 'homeostasis', 'cyberculture', 'statistical info theory', 'ecperimental psychology', 'behaviorism', 'control theory', 'complex system', 'self-regulating', 'organic', 'inorganic', 'post-humanism', 'control', 'simulation', 'surveillance', 'embodied knowledge', 'AI', 'formalization of mathematics and logic', 'jacquard loom', 'general purpose computer', 'discrete system', 'finite state machine', 'boolean logic', 'babbage', 'ada', 'analytical engine', 'plato', 'leibniz', 'church-turing thesis ', 'formalization of computation', 'von neumann architecture', 'shannon info theory', 'digital computer', 'intelligence', 'mind-brain', 'cognitive revolution', 'information processing', 'abstraction', 'hardware-software', 'turing', 'imitation game', 'thinking machine', 'human-level communication', 'models of computation', 'cognitive simulation', 'logic theorist', 'symbolic AI', 'NAI', 'AGI', 'HLAI', 'SAI', 'computationalism', 'CTM', 'LOTH', 'PSSH', 'chomsky', 'dreyfus', 'context', 'common sense', 'creativity', 'intuition', 'searle', 'jackson', 'chinese room', 'strong AI', 'weak AI', "mary's room", 'GOFAI', 'AI winter', '1974-1980', '1987-1993', 'top-down', 'bottom-up', 'sub-symbolic AI', 'connectionism', 'machine learning', 'artifician neural network (ANN)', 'parallel distributed processing (PDP)', 'dataset', 'neurons', 'deep learning', 'intelligent agent', 'Stuart J. Russell', 'Peter Norvig', 'complex systems', 'rational agent', 'environment ', 'sensors', 'actuators', 'performance', 'ALife', 'simulating biological evolution', 'software environment ', 'simple operators', 'cellular automata (CA)', 'simple lawas', 'neoghbours cells', 'death ', 'reproduction', 'evolution', 'chaotic systems', 'stable loops', 'patterns', 'edge of chaos', 'unpredictable', 'symbolic + sub symbolic', 'evolutionary process', 'life', 'intelligence', 'noisy phisical world', 'radiations', 'electromagnetic phenomena', 'particles', 'wavelengths', 'continuous interaction', 'chaotic world', 'black box', 'nested black box', 'discrimination', 'biases', 'limitations', 'nouvelle AI', 'situated AI', 'body', 'robots', 'virtual environments', 'adaptive unconscious', 'embodied knowledge', 'biological organisms', 'high-level intelligence', 'intuition ', 'creativity', 'spontaneity', 'weak-and-narrow AI', 'goal', 'human-level system', 'unhappy claims ', 'slow growth', 'MIT', 'Elon Musk', 'Ray Kurzweil', 'Lex Friedman', 'Vernor Vinge', 'daydream', 'future-oriented', 'techno-utopianism', 'neo-liberal', 'Californaian ideoloy', 'big picture', 'technological singularity', 'think for itself', 'matrix', 'man-made', 'cognition', 'technologies', 'human operator', 'intellectual process', 'productive process', 'historical materialism', 'Marx ', 'Engels', 'War World II', 'machine performance', 'symbiosis ', 'intelligence amplification IA', 'intelligence augmentation', 'Vannevar Bush', 'Ross W. Ashby', 'intellectual power', 'physical power', 'L.C.R. Licklider', 'man-machine symbiosis', 'Simon Ramo ', 'intellectronics', 'interactive computing', 'user interface', 'Douglas Engelbart', 'bootstrapping', 'human-computer interaction (HCI)', 'brain-computer interface (BCI)', 'extrasensory perception', 'Neuralink', 'dystopia', 'cyborg theory', 'human-machine dichotomy', 'ecosystem', 'patchwork organisms', 'cybernetic organism', 'cyborg', 'machinic phylum', 'Deleuze ', 'Guattari', 'D&G', 'assemblages', 'implants cyborg society', 'Thomas Metzinger', 'hybrid biorobotics ', 'mixed species', 'artificial hardware', 'artificial software', 'biological hardware', 'biological software', 'RoboRoach', 'artificial implant', 'electrical impulses', 'nerves', 'neuroenhancement', 'mental states', 'neuropharmacology', 'psychopharmacology', 'synteshis', 'non-neural hardware', 'biological assumption', 'machinic consciousness', 'bio-digital fusion'];

@ -0,0 +1,81 @@
# This script takes a txt file and use a template to create
# html pages linked in a linear sequence and containing each a line of the txt
# It generate also the css out of a template.
# I would like to make also a circular version. A loop that arrived at the last page reconnects with the first page.
# and eventually try other possible sequences and links (such as metarefresh etc..)
# This could become a commad, like > htgen [chose if linear (-l) or circular (-c) or ...] [input file] [input html template]
from jinja2 import Template
file = "./filoXX_fN.txt"
#ask name input file and use it also for name output file
# read formatted text
with open(file, "r") as sentences_file:
for n, line in enumerate(sentences_file.readlines()):
# CHECK IF THE FORMAT IS CORRECT FIRST - comment all the above print()
print(line)
# format text again if needed - comment if not needed
line = line.replace("\n", "")
# link to next page
nxt_n = n + 1
nxt_n = str(nxt_n)
file_name_next = "file_{}.html".format(nxt_n.zfill(2))
# file name
n = str(n)
file_name = "file_{}.html".format(n.zfill(2))
# jinja html template
template_html = Template('''
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> {{ sentence }} </p>
<a href="{{ next }}" class="button">next</a>
</body>
</html>
''')
# render template
html_list = template_html.render(sentence = line, next = file_name_next)
# write html
with open(file_name, "w") as output:
output.write(html_list)
# css template
template_css = '''
body {
background-color: black;
color: red;
}
p {font-size: 100px;}
.button {
font: bold 11px Arial;
text-decoration: none;
background-color: #EEEEEE;
color: #333333;
padding: 2px 6px 2px 6px;
border-top: 1px solid #CCCCCC;
border-right: 1px solid #333333;
border-bottom: 1px solid #333333;
border-left: 1px solid #CCCCCC;
}
'''
# write css
with open("style.css", "w") as output:
output.write(template_css)

@ -0,0 +1,26 @@
# This script convert a txt file into a js containing an array with each line of the txt
# I would like make a command from this, like > arraygen [name var] [input file] [outputfile]
title = "origin_debate"
fl = open(title + ".txt", "rt")
rd = fl.read()
lst = rd.splitlines()
with open(title + ".js", "w") as output:
output.write(str(lst))
fl.close()
with open(title + ".js", 'r') as original:
data = original.read()
with open(title + ".js", 'w') as modified:
modified.write("var x = " + data + ";")

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> Everybody on earth knowing </p>
<a href="file_01.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> that beauty is beautiful </p>
<a href="file_02.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> makes ugliness. </p>
<a href="file_03.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> Everybody knowing </p>
<a href="file_04.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> that goodness is good </p>
<a href="file_05.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> makes wickedness. </p>
<a href="file_06.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> For being and nonbeing </p>
<a href="file_07.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> arise together; </p>
<a href="file_08.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> hard and easy </p>
<a href="file_09.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> complete each other; </p>
<a href="file_10.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> long and short </p>
<a href="file_11.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> shape each other; </p>
<a href="file_12.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> high and low </p>
<a href="file_13.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> depend on each other; </p>
<a href="file_14.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> note and voice </p>
<a href="file_15.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> make the music together; </p>
<a href="file_16.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> before and after </p>
<a href="file_17.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> follow each other. </p>
<a href="file_18.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> Thats why the wise soul </p>
<a href="file_19.html" class="button">next</a>
</body>
</html>

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Tao one</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p> does without doing, </p>
<a href="file_20.html" class="button">next</a>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save