ChatterBean 00.008 is now available

View: New views
1 Messages — Rating Filter:   Alert me  

ChatterBean 00.008 is now available

by Helio Perroni Filho :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ChatterBean 00.008 is now available. This version
implements the following new features:

* Correct whitespace handling: support for the
xml:space attribute has been added. This brings
ChatterBean one step closer to full AIML
compatibility.

* New applet interface: previous releases of
ChatterBean provided an applet class as a
proof-of-concept GUI. Version 00.008 improves on this
by turning the main bitoflife.chatterbean.ChatterBean
class itself into a Java Applet, which encloses an
Alicebot. Support for embedding the applet into web
pages has been added, through a set of recognized
named parameters that allows proper configuration of
the underlying bot.

* AJAX-ready: an interesting feature of the applet
interface is its ability to interact with Javascript
code on the web page through its API. This, combined
with the new support for the javascript tag (see
below), allows ChatterBean to be easily embedded in an
AJAX application. A proof-of-concept application is
provided on the project homepage.

* Support for the <javascript> tag: in the past, I
refused to support the <javascript> tag, under the
rationale that the BeanShell-backed <system> tag
already provided all the scripting power an Alicebot
would need. While the argument in favor of BeanShell
still holds, I realized that the <javascript> tag
could be used as an interface between an
applet-enclosed bot and the underlying browser.
Current support is still limited, in that an Alicebot
can only reach Javascript environment features and
top-level user-defined functions, but it is well
enough to add a nice AJAX-like responsiveness to a web
bot.

* Unified Context properties: up until now, the
bitoflife.chatterbean.Context class provided separate
support for managing predicates and bot predicates.
This support has now been unified around a single
system of properties. Where, in order to get the value
of the dateFormat predicate, you'd previously call:

  String predicate = context.predicate("dateFormat");

You now must call:

  String predicate =
   (String) context.property("predicate.dateFormat");

Similarly, to get the value of the id bot predicate,
where you'd previously call:

  String id = context.botPredicate("id");

You now must call:

  String id = (String) context.property("bot.id");

What is the advantage? So long you respect the use of
predicate. and bot. prefixed names for predicates and
bot predicates, any object can be bound to an
Alicebot's context through a property. For example, at
loading time the bitoflife.chatterbean.ChatterBean
class bounds a Javascript interpreter to its enclosing
Alicebot through a context property named
javascript.interpreter; later, the javascript tag can
recover the interpreter instance from the context and
use it to interpret its contents. In the near future,
this will allow the use of non-string values with
predicates and bot predicates as well (currently they
must be set to string values only).

* Property change listener interface: another novel
feature of the bitoflife.chatterbean.Context class is
the ability to register event listeners that fire in
response of changings in specific properties. This has
been used to provide a more flexible, elegant
treatment to the problem of updating the random seed
and the converstaion topic in response to changes in
context properties.

* Better development-time portability: since the
beggining of the ChatterBean project, one of my main
goals has been to provide a developer-friendly
distribution. I refrained from using IDE's such as
Eclipse to avoid locking the project into any specific
environment, deciding instead to go with javac's own
build files and a bit of BeanShell scripts to ensure
platform portability. However, as some people pointed
out, this solution was not as platform-independent as
I hoped. This version solves those portability issues,
providing an improved micro-development environment
heavily based on BeanShell.

* Small fixes and code changes: as always, there has
been some minor bug fixes and adjustements to the code
base:

  * The architecture of Category matchers created
  around the bitoflife.chatterbean.Matcher interface
  has been dropped in favour of a unique
  bitoflife.chatterbean.Graphmaster class. The old way
  was meant to facilitate the implementation of more
  dynamic category bases, since it was my early
  understanding that it would be hard to implement
  category exclusion into the Graphmaster algorithm;
  however, I've come to realize that my concerns were
  unjustified, and there was no reason to keep more
  than one category matcher class.

  * When the randomSeed bot predicate is not set, the
  <random> tag uses a different seed each time the
  bot is started. This allows for less predictable
  behaviour.

  * The behaviour of the <input> has changed: now
index
  (1) refers to the input to the category being
  matched, and not the one before it. I reasoned that
  this would be a more complete, useful interpretation
  of the AIML standard than the previous one.

  * Both the <javascript> and the <system> tags now
  return the result of the last evaluated expression
  (if it evaluates to something) if the result
variable
  is set to null. This makes for a cleaner syntax
where
  simple expressions are concerned.

  * A new environment variable, match, has been added
  to the context of the BeanShell interpreter. It
  contains the bitoflife.chatterbean.Match object
  representing the current matching operation. Since
  this object also contains a reference to the
Alicebot
  itself, this allows a bot to manipulate its own
  interpreter according to the inputs it gets.

(Special thanks to Andreas Matthias, Charles
Chevallier and Lindsay Steele to their suggestions and
reports, and my appologies if I forgot to mention
anyone else.)

--
Ja mata ne.
Helio Perroni Filho

ChatterBean Project
http://chatterbean.bitoflife.cjb.net


               
_______________________________________________________
Abra sua conta no Yahoo! Mail: 1GB de espaço, alertas de e-mail no celular e anti-spam realmente eficaz.
http://br.info.mail.yahoo.com/
_______________________________________________
alicebot-developer mailing list
alicebot-developer@...
http://list.alicebot.org/mailman/listinfo/alicebot-developer