GraphBuilder.h

00001 #ifndef REBECCA_GRAPHBUILDER_H
00002 #define REBECCA_GRAPHBUILDER_H
00003 
00004 /*
00005  * RebeccaAIML, Artificial Intelligence Markup Language 
00006  * C++ api and engine.
00007  *
00008  * Copyright (C) 2005 Frank Hassanabad
00009  *
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Lesser General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 2.1 of the License, or (at your option) any later version.
00014  *
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Lesser General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU Lesser General Public
00021  * License along with this library; if not, write to the Free Software
00022  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00023  */
00024 
00025 
00026 /* Disable Windows VC 7.x warning about 
00027  * it ignoring the throw specification
00028  */
00029 #ifdef _WIN32
00030 #    pragma warning ( push )
00031 #    pragma warning( disable : 4290 )
00032 #endif
00033 
00034 //Rebecca includes
00035 #include <rebecca/exports.h>
00036 #include <rebecca/StringPimpl.h>
00037 #include <rebecca/CallBacks.h>
00038 #include <rebecca/Exceptions.h>
00039 
00040 namespace rebecca 
00041 {
00042 namespace impl 
00043 {
00044 
00137 class REBECCA_EXPORT GraphBuilder
00138 {
00139     public:
00140 
00187         virtual void addFile(const char * const file) 
00188             throw(FileNotFoundException &, Exception &) = 0;        
00189 
00242         virtual void addDirectory(const char * const directory, const char * const regularExpression = ".*\\.aiml") 
00243             throw(IllegalArgumentException &, DirectoryNotFoundException &, Exception &) = 0;
00244         
00299         virtual void addString(const char * const stringContainingAIML)
00300             throw(Exception &) = 0;
00301 
00322         virtual void setAddStringAIMLHeader(const char * const aimlHeader)
00323             throw(Exception &) = 0;
00324 
00343         virtual void setAddStringAIMLFooter(const char * const aimlFooter)
00344             throw(Exception &) = 0;
00345 
00358         virtual void setAIMLSchema(const char * const schema) 
00359             throw(Exception &) = 0;
00360 
00375         virtual void setCommonTypesSchema(const char * const schema) 
00376             throw(Exception &) = 0;
00377 
00394         virtual void setAIMLValidation(bool trueOrFalse = true) 
00395             throw(Exception &) = 0;
00396         
00416         virtual StringPimpl getResponse(const char * const input) 
00417             throw(Exception &) = 0;
00418         
00436         virtual void setThat(const char * const that) 
00437             throw(Exception &) = 0;
00438 
00456         virtual void setTopic(const char * const topic) 
00457             throw(Exception &) = 0;
00458 
00474         virtual StringPimpl getThat() const
00475             throw(Exception &) = 0;
00476 
00492         virtual StringPimpl getTopic() const
00493             throw(Exception &) = 0;
00494 
00512         virtual void createGraph() 
00513             throw(XMLErrorException &, Exception &) = 0;
00514 
00535         virtual bool predicateMatch(const char * const predicateName, const char * const aimlPattern) const
00536             throw(Exception &) = 0;
00537         
00557         virtual void setPredicate(const char * const name, const char * const value) 
00558             throw(Exception &) = 0;
00559 
00578         virtual StringPimpl getPredicate(const char * const name) const
00579             throw(Exception &) = 0;
00580 
00599         virtual StringPimpl getBotPredicate(const char * const name) const
00600             throw(Exception &)  = 0;
00601 
00619         virtual void setBotPredicate(const char * const name, const char * const value) 
00620             throw(Exception &) = 0;
00621         
00639         virtual StringPimpl getPreviousBotResponse(const unsigned int &previousBotResponse, const unsigned int &sentence) const
00640             throw(IllegalArgumentException &, Exception &) = 0;
00641 
00659         virtual StringPimpl getPreviousUserInput(const unsigned int &previousUserInput, const unsigned int &sentence) const
00660             throw(IllegalArgumentException &, Exception &) = 0;
00661         
00685         virtual void setBotConfigurationSchema(const char *const schema) 
00686             throw(Exception &) = 0;
00687 
00706         virtual void setBotConfigurationValidation(const bool trueOrFalse = true) 
00707             throw(Exception &) = 0;
00708 
00734         virtual void parseSubstitutionFile(const char *const fileName) 
00735             throw(XMLErrorException &, FileNotFoundException &, Exception &) = 0;
00736 
00759         virtual void parseSentenceSplitterFile(const char *const fileName) 
00760             throw(XMLErrorException &, FileNotFoundException &, Exception &) = 0;
00761 
00784         virtual void parsePropertiesFile(const char *const fileName)
00785             throw(XMLErrorException &, FileNotFoundException &, Exception &) = 0;
00786         
00802         virtual void setSentenceSplitter(const char *const splitter) 
00803             throw(Exception &) = 0;
00804 
00842         virtual void setInputSubstitution(const char *const find, const char *const replace) 
00843             throw(IllegalArgumentException &, Exception &) = 0;
00844 
00879         virtual void setGenderSubstitution(const char *const find, const char *const replace) 
00880             throw(IllegalArgumentException &, Exception &) = 0;
00881 
00922         virtual void setPersonSubstitution(const char *const find, const char *const replace) 
00923             throw(IllegalArgumentException &, Exception &) = 0;
00924 
00965         virtual void setPerson2Substitution(const char *const find, const char *const replace) 
00966             throw(IllegalArgumentException &, Exception &)  = 0;
00967         
00977         virtual StringPimpl getVersion() const 
00978             throw(Exception &) = 0;
00979         
00987         virtual int getSize() const 
00988             throw(Exception &) = 0;
00989 
01008         virtual void setCallBacks(CallBacks *callBacks) 
01009             throw(Exception &) = 0;
01010 
01024         virtual void storeGossip(const char * const gossip) 
01025             throw(Exception &) = 0;
01026         
01038         virtual StringPimpl getId() const
01039             throw(Exception &) = 0;
01040         
01054         virtual void setId(const char * const id)
01055             throw(Exception &) = 0;
01056 
01081         virtual void addCustomTagLibrary(const char * const library)
01082             throw(FileNotFoundException &, Exception &) = 0;
01083 
01108         virtual void removeCustomTagLibrary(const char * const library)
01109             throw(FileNotFoundException &, Exception &) = 0;
01110         
01135         virtual StringPimpl callSystemCommand(const char * const command)
01136             throw(Exception &) = 0;
01137 
01141         virtual ~GraphBuilder() { };
01142 };
01143 
01144 } //end of namespace impl
01145 
01146 //Expose GraphBuilder to rebecca namespace
01147 using rebecca::impl::GraphBuilder;
01148 
01149 } //end of namespace rebecca
01150 
01151 
01152 #ifdef _WIN32
01153 #    pragma warning ( pop )
01154 #endif
01155 
01156 
01157 
01158 
01159 #endif

Generated on Thu Sep 7 22:05:42 2006 for RebeccaAIML by  doxygen 1.4.5