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 
00197         virtual void addFile(const char * const file) 
00198             throw(FileNotFoundException &, Exception &) = 0;        
00199 
00252         virtual void addDirectory(const char * const directory, const char * const regularExpression = ".*\\.aiml") 
00253             throw(IllegalArgumentException &, DirectoryNotFoundException &, Exception &) = 0;
00254         
00309         virtual void addString(const char * const stringContainingAIML)
00310             throw(Exception &) = 0;
00311 
00332         virtual void setAddStringAIMLHeader(const char * const aimlHeader)
00333             throw(Exception &) = 0;
00334 
00353         virtual void setAddStringAIMLFooter(const char * const aimlFooter)
00354             throw(Exception &) = 0;
00355 
00368         virtual void setAIMLSchema(const char * const schema) 
00369             throw(Exception &) = 0;
00370 
00385         virtual void setCommonTypesSchema(const char * const schema) 
00386             throw(Exception &) = 0;
00387 
00404         virtual void setAIMLValidation(bool trueOrFalse = true) 
00405             throw(Exception &) = 0;
00406         
00426         virtual StringPimpl getResponse(const char * const input) 
00427             throw(Exception &) = 0;
00428         
00446         virtual void setThat(const char * const that) 
00447             throw(Exception &) = 0;
00448 
00466         virtual void setTopic(const char * const topic) 
00467             throw(Exception &) = 0;
00468 
00484         virtual StringPimpl getThat() const
00485             throw(Exception &) = 0;
00486 
00502         virtual StringPimpl getTopic() const
00503             throw(Exception &) = 0;
00504 
00522         virtual void createGraph() 
00523             throw(XMLErrorException &, Exception &) = 0;
00524 
00545         virtual bool predicateMatch(const char * const predicateName, const char * const aimlPattern) const
00546             throw(Exception &) = 0;
00547         
00567         virtual void setPredicate(const char * const name, const char * const value) 
00568             throw(Exception &) = 0;
00569 
00588         virtual StringPimpl getPredicate(const char * const name) const
00589             throw(Exception &) = 0;
00590 
00609         virtual StringPimpl getBotPredicate(const char * const name) const
00610             throw(Exception &)  = 0;
00611 
00629         virtual void setBotPredicate(const char * const name, const char * const value) 
00630             throw(Exception &) = 0;
00631         
00649         virtual StringPimpl getPreviousBotResponse(const unsigned int &previousBotResponse, const unsigned int &sentence) const
00650             throw(IllegalArgumentException &, Exception &) = 0;
00651 
00669         virtual StringPimpl getPreviousUserInput(const unsigned int &previousUserInput, const unsigned int &sentence) const
00670             throw(IllegalArgumentException &, Exception &) = 0;
00671         
00695         virtual void setBotConfigurationSchema(const char *const schema) 
00696             throw(Exception &) = 0;
00697 
00716         virtual void setBotConfigurationValidation(const bool trueOrFalse = true) 
00717             throw(Exception &) = 0;
00718 
00744         virtual void parseSubstitutionFile(const char *const fileName) 
00745             throw(XMLErrorException &, FileNotFoundException &, Exception &) = 0;
00746 
00769         virtual void parseSentenceSplitterFile(const char *const fileName) 
00770             throw(XMLErrorException &, FileNotFoundException &, Exception &) = 0;
00771 
00794         virtual void parsePropertiesFile(const char *const fileName)
00795             throw(XMLErrorException &, FileNotFoundException &, Exception &) = 0;
00796         
00812         virtual void setSentenceSplitter(const char *const splitter) 
00813             throw(Exception &) = 0;
00814 
00852         virtual void setInputSubstitution(const char *const find, const char *const replace) 
00853             throw(IllegalArgumentException &, Exception &) = 0;
00854 
00889         virtual void setGenderSubstitution(const char *const find, const char *const replace) 
00890             throw(IllegalArgumentException &, Exception &) = 0;
00891 
00932         virtual void setPersonSubstitution(const char *const find, const char *const replace) 
00933             throw(IllegalArgumentException &, Exception &) = 0;
00934 
00975         virtual void setPerson2Substitution(const char *const find, const char *const replace) 
00976             throw(IllegalArgumentException &, Exception &)  = 0;
00977         
00987         virtual StringPimpl getVersion() const 
00988             throw(Exception &) = 0;
00989         
00997         virtual int getSize() const 
00998             throw(Exception &) = 0;
00999 
01018         virtual void setCallBacks(CallBacks *callBacks) 
01019             throw(Exception &) = 0;
01020 
01034         virtual void storeGossip(const char * const gossip) 
01035             throw(Exception &) = 0;
01036         
01048         virtual StringPimpl getId() const
01049             throw(Exception &) = 0;
01050         
01064         virtual void setId(const char * const id)
01065             throw(Exception &) = 0;
01066 
01091         virtual void addCustomTagLibrary(const char * const library)
01092             throw(FileNotFoundException &, Exception &) = 0;
01093 
01118         virtual void removeCustomTagLibrary(const char * const library)
01119             throw(FileNotFoundException &, Exception &) = 0;
01120         
01124         virtual ~GraphBuilder() { };
01125 };
01126 
01127 } //end of namespace impl
01128 
01129 //Expose GraphBuilder to rebecca namespace
01130 using rebecca::impl::GraphBuilder;
01131 
01132 } //end of namespace rebecca
01133 
01134 
01135 #ifdef _WIN32
01136 #    pragma warning ( pop )
01137 #endif
01138 
01139 
01140 
01141 
01142 #endif

Generated on Mon Apr 10 00:39:41 2006 for RebeccaAIML by  doxygen 1.4.5