Example #1
0
 public MainWindow()
 {
     InitializeComponent();
     var loader = new AIMLLoader();
     const string path = @"Human.aiml";
     loader.LoadAIML(path);
 }
Example #2
0
 public void Setup()
 {
     _chatBot = new ChatBot();
     ChatBot.Size = 0;
     _loader = new AIMLLoader();
     var path = $@"{Environment.CurrentDirectory}\AIML\Salutations.aiml";
     _loader.LoadAIML(path);
 }
Example #3
0
 public void Initialize()
 {
     _chatBot = new ChatBot();
     _loader = new AIMLLoader();
     const string path = @"AIML\ChatBotTests.aiml";
     {
         _loader.LoadAIML(path);
     }
 }
Example #4
0
 public void Initialize()
 {
     _chatBot = new ChatBot();
     _loader = new AIMLLoader(_chatBot);
     var assembly = Assembly.GetExecutingAssembly();
     using (var stream = assembly.GetManifestResourceStream("AIMLbot.UnitTest.AIML.Salutations.aiml"))
     {
         _loader.LoadAIML(stream);
     }
 }
Example #5
0
 public override string ProcessChange()
 {
     if (Template.Name.ToLower() != "learn") return string.Empty;
     // currently only AIML files in the local filesystem can be referenced
     // ToDo: Network HTTP and web service based learning
     if (Template.InnerText.Length > 0)
     {
         var path = Template.InnerText;
         var fi = new FileInfo(path);
         try
         {
             var loader = new AIMLLoader();
             loader.LoadAIML(fi);
         }
         catch (Exception ex)
         {
             Log.Error("Unable to learn some new AIML from the following URI: " + path, ex);
         }
     }
     return string.Empty;
 }
Example #6
0
 public void TestLoadAIMLFileWithValidXMLButMissingTemplate()
 {
     var path = @"AIML\MissingPattern.aiml";
     _loader = new AIMLLoader();
     _loader.LoadAIML(path);
 }
Example #7
0
 public void TestLoadAIMLFileWithBadXML()
 {
     var path = @"AIML\BadlyFormed.aiml";
     _loader = new AIMLLoader();
     _loader.LoadAIML(path);
 }
Example #8
0
 /// <summary>
 ///     Allows the ChatBot to load a new XML version of some AIML
 /// </summary>
 /// <param name="newAIML">The XML document containing the AIML</param>
 public void LoadAIML(XDocument newAIML)
 {
     var loader = new AIMLLoader();
     loader.LoadAIML(newAIML);
 }
Example #9
0
 public void LoadAIML(string path)
 {
     var loader = new AIMLLoader();
     loader.LoadAIML(path);
 }
Example #10
0
 /// <summary>
 ///     Loads AIML from .aiml files into the graphmaster "brain" of the ChatBot
 /// </summary>
 public void LoadAIML()
 {
     var loader = new AIMLLoader();
     loader.LoadAIML();
 }