GraphBuilderFramework Class Reference

Adds more operations to the already existing set of rebecca::impl::GraphBuilder in which AIML tags framework developers will need access to. More...

#include <GraphBuilderFramework.h>

Inheritance diagram for GraphBuilderFramework:

GraphBuilder List of all members.

Public Member Functions

virtual StringPimpl checkedInfiniteLoopGetResponse (const StringPimpl &userInput, bool keepPreviousUserInput=true)=0 throw (RecursionException &, Exception &)
 This is the version of rebecca::impl::GraphBuilder::getResponse() for AIML tag implementations.
virtual StringPimpl genderSubstitute (const StringPimpl &input) const =0 throw (Exception &)
 Returns the contents of a gender substitution.
virtual CallBacksgetCallBacks ()=0 throw (Exception &)
 Returns the CallBacks instance so that AIML tags can invoke operations on the callbacks.
virtual StringPimpl getPreviousBotResponsePunctuation (const unsigned int &previousBotResponse, const unsigned int &sentence) const =0 throw (IllegalArgumentException &, Exception &)
 Returns the previous AIML engine's response with the punctuation not stripped from the end.
virtual StringPimpl getStar (const unsigned int &index) const =0 throw (IllegalArgumentException &, Exception &)
 Returns the value "captured" by a particular wildcard from the pattern-specified portion of the match path during runtime of the AIML engine.
virtual StringPimpl getThatStar (const unsigned int &index) const =0 throw (IllegalArgumentException &, Exception &)
 Returns the contents of a wildcard from a pattern-side "that" element during the runtime of the AIML engine.
virtual StringPimpl getTopicStar (const unsigned int &index) const =0 throw (IllegalArgumentException &, Exception &)
 Returns the contents of a wildcard from the current topic (if the topic contains any wildcards) during the runtime of the AIML engine.
virtual StringPimpl person2Substitute (const StringPimpl &input) const =0 throw (Exception &)
 Returns the contents of a person2 substitution.
virtual StringPimpl personSubstitute (const StringPimpl &input) const =0 throw (Exception &)
 Returns the contents of a person substitution.

Detailed Description

Adds more operations to the already existing set of rebecca::impl::GraphBuilder in which AIML tags framework developers will need access to.

These operations are the operations that framework developers of AIML tags will need access to in addition to the operations of rebecca::impl::GraphBuilder but in which public users of the api do not need and thus do not have access to.


Member Function Documentation

virtual StringPimpl checkedInfiniteLoopGetResponse const StringPimpl userInput,
bool  keepPreviousUserInput = true
throw (RecursionException &, Exception &) [pure virtual]
 

This is the version of rebecca::impl::GraphBuilder::getResponse() for AIML tag implementations.

This does the same thing as rebecca::impl::GraphBuilder::getResponse() but when it finds an infinite loop it throws a rebecca::impl::RecursionException. This is usually used with implementations of the Srai AIML tag to recursively call the AIML engine. When a rebecca::impl::RecursionException occurs the Srai tag calls GraphBuilderFramework::getCallBacks() and then rebecca::impl::CallBacks::infiniteSymbolicReduction() automatically to indicate an infinite loop was found.

Parameters:
userInput The input to get the AIML engine response of
keepPreviousUserInput Set this to false if you do not want the previous user input stored internally. Usually you only want to set this to false when you call this from implementations of the Srai AIML tag.
Returns:
The AIML engine's response. If it cannot match the input, it returns an empty string.
Exceptions:
rebecca::impl::RecursionException will be thrown if the an infinite loop occurs. It will throw an Exception for any underlying exceptions from other methods it might call.

virtual StringPimpl genderSubstitute const StringPimpl input  )  const throw (Exception &) [pure virtual]
 

Returns the contents of a gender substitution.

Usually this method is used soly by implementations of the AIML tag Gender. For example, Gender::getString() usually calls genderSubstitute with some input to get the gender substitution.

Whenever, the user of the api adds a new gender substitution through rebecca::impl::GraphBuilder::setGenderSubstitution() this is the method an AIML tag should call to automatically have its input substituted accordingly.

Parameters:
input The input to have "Gender" substituted
Returns:
The "Gender" substituted output.
Exceptions:
This will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual CallBacks& getCallBacks  )  throw (Exception &) [pure virtual]
 

Returns the CallBacks instance so that AIML tags can invoke operations on the callbacks.

Use this method to retrieve the callbacks object and then invoke the callback directly on the object from your AIML tag. For example, the ThatStar AIML tag can use getCallBacks to invoke rebecca::impl::CallBacks::thatStarTagSizeExceeded() to inform the user of the api that the tag size was exceeded. If the user of the api has set his callback through rebecca::impl::GraphBuilder::setCallBacks() they will get a callback informing them that the tag size has been exceeded and can deal with it accordingly.

Returns:
The CallBacks reference so that the AIML tag can directly call the calls and invoke the callback on any listeners.
Exceptions:
This will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual StringPimpl getPreviousBotResponsePunctuation const unsigned int &  previousBotResponse,
const unsigned int &  sentence
const throw (IllegalArgumentException &, Exception &) [pure virtual]
 

Returns the previous AIML engine's response with the punctuation not stripped from the end.

Usually this is used with implementations of the AIML template side tag That.

Parameters:
previousBotResponse the index of the previous AIML engine response.
sentence From the response about to be returned, which sentence of the previous response to return.
Returns:
The previous AIML engine's response
Exceptions:
IllegalArgumentException will be thrown if the arguments exceed the number of wildcards available. It will throw an Exception for any underlying exceptions from other methods it might call.

virtual StringPimpl getStar const unsigned int &  index  )  const throw (IllegalArgumentException &, Exception &) [pure virtual]
 

Returns the value "captured" by a particular wildcard from the pattern-specified portion of the match path during runtime of the AIML engine.

Usually this method is used soley by implementations of the AIML tag Star. For example, Star::getString() usually just calls this method with the index given as its attribute. So, if <star index="2"> is encountered, the Star::getString() method would call GraphBuilderFramework::getStar(2)

Parameters:
index indicates which wildcard to use. 1 for the first wildcard, 2 for the next, so on so forth.
Returns:
The string of the value "captured" by a particular wildcard from the pattern-specified portion of the match path during the runtime of the AIML engine.
Exceptions:
IllegalArgumentException will be thrown if the argument exceeds the number of wildcards available. It will throw an Exception for any underlying exceptions from other methods it might call.

virtual StringPimpl getThatStar const unsigned int &  index  )  const throw (IllegalArgumentException &, Exception &) [pure virtual]
 

Returns the contents of a wildcard from a pattern-side "that" element during the runtime of the AIML engine.

Usually this method is used soley by implementations of the AIML tag ThatStar. For example, ThatStar::getString() usually just calls this method with the index given as its attribute. So, if <thatstar index="2"> is encountered, the ThatStar::getString() method would call GraphBuilderFramework::getThatStar(2)

Parameters:
index indicates which wildcard to use. 1 for the first wildcard, 2 for the next, so on so forth.
Returns:
The contents of a wildcard from a pattern-side "that" element during the runtime of the AIML engine.
Exceptions:
IllegalArgumentException will be thrown if the argument exceeds the number of wildcards available. It will throw an Exception for any underlying exceptions from other methods it might call.

virtual StringPimpl getTopicStar const unsigned int &  index  )  const throw (IllegalArgumentException &, Exception &) [pure virtual]
 

Returns the contents of a wildcard from the current topic (if the topic contains any wildcards) during the runtime of the AIML engine.

Usually this method is used soley by implementations of the AIML tag TopicStar. For example, TopicStar::getString() usually just calls this method with the index given as its attribute. So, if <topicstar index="2"> is encountered, the TopicStar::getString() method would call GraphBuilderFramework::getTopicStar(2)

Parameters:
index indicates which wildcard to use. 1 for the first wildcard, 2 for the next, so on so forth.
Returns:
The contents of a wildcard from the current topic (if the topic contains any wildcards) during the runtime of the AIML engine.
Exceptions:
IllegalArgumentException will be thrown if the argument exceeds the number of wildcards available. It will throw an Exception for any underlying exceptions from other methods it might call.

virtual StringPimpl person2Substitute const StringPimpl input  )  const throw (Exception &) [pure virtual]
 

Returns the contents of a person2 substitution.

Usually this method is used soly by implementations of the AIML tag Person2. For example, Person2::getString() usually calls person2Substitute with some input to get the person2 substitution.

Whenever, the user of the api adds a new person2 substitution through rebecca::impl::GraphBuilder::setPerson2Substitution() this is the method an AIML tag should call to automatically have its input substituted accordingly.

Parameters:
input The input to have "Person2" substituted
Returns:
The "Person2" substituted output.
Exceptions:
This will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.

virtual StringPimpl personSubstitute const StringPimpl input  )  const throw (Exception &) [pure virtual]
 

Returns the contents of a person substitution.

Usually this method is used soly by implementations of the AIML tag Person. For example, Person::getString() usually calls personSubstitute with some input to get the person substitution.

Whenever, the user of the api adds a new person substitution through rebecca::impl::GraphBuilder::setPersonSubstitution() this is the method an AIML tag should call to automatically have its input substituted accordingly.

Parameters:
input The input to have "Person" substituted
Returns:
The "Person" substituted output.
Exceptions:
This will not directly throw an exception but if an underlying method throws an exception, it will be wrapped and thrown as an Exception.


The documentation for this class was generated from the following file:
Generated on Thu Sep 7 22:05:46 2006 for RebeccaAIML by  doxygen 1.4.5