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 
00147 class REBECCA_EXPORT GraphBuilder
00148 {
00149     public:
00150 
00176         virtual void addFile(const char * const file) 
00177             throw(FileNotFoundException &, Exception &) = 0;        
00178 
00210         virtual void addDirectory(const char * const directory, const char * const regularExpression = ".*\\.aiml") 
00211             throw(IllegalArgumentException &, DirectoryNotFoundException &, Exception &) = 0;
00212 
00225         virtual void setAIMLSchema(const char * const schema) 
00226             throw(Exception &) = 0;
00227 
00242         virtual void setCommonTypesSchema(const char * const schema) 
00243             throw(Exception &) = 0;
00244 
00261         virtual void setAIMLValidation(bool trueOrFalse = true) 
00262             throw(Exception &) = 0;
00263         
00283         virtual StringPimpl getResponse(const char * const input) 
00284             throw(Exception &) = 0;
00285         
00303         virtual void setThat(const char * const that) 
00304             throw(Exception &) = 0;
00305 
00323         virtual void setTopic(const char * const topic) 
00324             throw(Exception &) = 0;
00325 
00341         virtual StringPimpl getThat() const
00342             throw(Exception &) = 0;
00343 
00359         virtual StringPimpl getTopic() const
00360             throw(Exception &) = 0;
00361 
00379         virtual void createGraph() 
00380             throw(XMLErrorException &, Exception &) = 0;
00381 
00402         virtual bool predicateMatch(const char * const predicateName, const char * const aimlPattern) const
00403             throw(Exception &) = 0;
00404         
00424         virtual void setPredicate(const char * const name, const char * const value) 
00425             throw(Exception &) = 0;
00426 
00445         virtual StringPimpl getPredicate(const char * const name) const
00446             throw(Exception &) = 0;
00447 
00466         virtual StringPimpl getBotPredicate(const char * const name) const
00467             throw(Exception &)  = 0;
00468 
00486         virtual void setBotPredicate(const char * const name, const char * const value) 
00487             throw(Exception &) = 0;
00488         
00506         virtual StringPimpl getPreviousBotResponse(const unsigned int &previousBotResponse, const unsigned int &sentence) const
00507             throw(IllegalArgumentException &, Exception &) = 0;
00508 
00526         virtual StringPimpl getPreviousUserInput(const unsigned int &previousUserInput, const unsigned int &sentence) const
00527             throw(IllegalArgumentException &, Exception &) = 0;
00528         
00552         virtual void setBotConfigurationSchema(const char *const schema) 
00553             throw(Exception &) = 0;
00554 
00573         virtual void setBotConfigurationValidation(const bool trueOrFalse = true) 
00574             throw(Exception &) = 0;
00575 
00601         virtual void parseSubstitutionFile(const char *const fileName) 
00602             throw(XMLErrorException &, FileNotFoundException &, Exception &) = 0;
00603 
00626         virtual void parseSentenceSplitterFile(const char *const fileName) 
00627             throw(XMLErrorException &, FileNotFoundException &, Exception &) = 0;
00628 
00651         virtual void parsePropertiesFile(const char *const fileName)
00652             throw(XMLErrorException &, FileNotFoundException &, Exception &) = 0;
00653         
00669         virtual void setSentenceSplitter(const char *const splitter) 
00670             throw(Exception &) = 0;
00671 
00709         virtual void setInputSubstitution(const char *const find, const char *const replace) 
00710             throw(IllegalArgumentException &, Exception &) = 0;
00711 
00746         virtual void setGenderSubstitution(const char *const find, const char *const replace) 
00747             throw(IllegalArgumentException &, Exception &) = 0;
00748 
00789         virtual void setPersonSubstitution(const char *const find, const char *const replace) 
00790             throw(IllegalArgumentException &, Exception &) = 0;
00791 
00832         virtual void setPerson2Substitution(const char *const find, const char *const replace) 
00833             throw(IllegalArgumentException &, Exception &)  = 0;
00834         
00844         virtual StringPimpl getVersion() const 
00845             throw(Exception &) = 0;
00846         
00854         virtual int getSize() const 
00855             throw(Exception &) = 0;
00856 
00875         virtual void setCallBacks(CallBacks *callBacks) 
00876             throw(Exception &) = 0;
00877 
00891         virtual void storeGossip(const char * const gossip) 
00892             throw(Exception &) = 0;
00893         
00905         virtual StringPimpl getId() const
00906             throw(Exception &) = 0;
00907         
00921         virtual void setId(const char * const id)
00922             throw(Exception &) = 0;
00923 
00948         virtual void addCustomTagLibrary(const char * const library)
00949             throw(FileNotFoundException &, Exception &) = 0;
00950 
00975         virtual void removeCustomTagLibrary(const char * const library)
00976             throw(FileNotFoundException &, Exception &) = 0;
00977 
00981         virtual ~GraphBuilder() { };
00982 };
00983 
00984 } //end of namespace impl
00985 
00986 //Expose GraphBuilder to rebecca namespace
00987 using rebecca::impl::GraphBuilder;
00988 
00989 } //end of namespace rebecca
00990 
00991 
00992 #ifdef _WIN32
00993 #    pragma warning ( pop )
00994 #endif
00995 
00996 
00997 
00998 
00999 #endif

Generated on Tue Apr 4 23:39:16 2006 for RebeccaAIML by  doxygen 1.4.5