Beispiel #1
0
        public void TestSubstituteWithKeyValueMatches()
        {
            AimlBot.Bot bot = new AimlBot.Bot();
            Dictionary<string, string> subs = new Dictionary<string, string>();
            subs.Add("aaa", "aab");
            subs.Add("aab", "aba");
            subs.Add("aba", "baa");
            bot.CreateSubstitutionGraph(subs);

            AimlBot.Normalize.Std.Substitute s = new AimlBot.Normalize.Std.Substitute();
            string result = s.Normalize("aa aaa aab aba baa", bot)[0];
            Assert.AreEqual("aa aab aba baa baa", result);
        }
Beispiel #2
0
        public void TestSubstituteSimple()
        {
            AimlBot.Bot bot = new AimlBot.Bot();
            Dictionary<string, string> subs = new Dictionary<string, string>();
            subs.Add("aaa", "xxx");
            subs.Add("bbb", "yyy");
            subs.Add("ccc", "zzz");
            bot.CreateSubstitutionGraph(subs);

            AimlBot.Normalize.Std.Substitute s = new AimlBot.Normalize.Std.Substitute();
            string result = s.Normalize("aa ccc cc aaa abc bbb bb", bot)[0];
            Assert.AreEqual("aa zzz cc xxx abc yyy bb", result);
        }
Beispiel #3
0
        public void TestSubstituteWithKeyValueMatches()
        {
            AimlBot.Bot bot = new AimlBot.Bot();
            Dictionary <string, string> subs = new Dictionary <string, string>();

            subs.Add("aaa", "aab");
            subs.Add("aab", "aba");
            subs.Add("aba", "baa");
            bot.CreateSubstitutionGraph(subs);

            AimlBot.Normalize.Std.Substitute s = new AimlBot.Normalize.Std.Substitute();
            string result = s.Normalize("aa aaa aab aba baa", bot)[0];

            Assert.AreEqual("aa aab aba baa baa", result);
        }
Beispiel #4
0
        public void TestSubstituteSimple()
        {
            AimlBot.Bot bot = new AimlBot.Bot();
            Dictionary <string, string> subs = new Dictionary <string, string>();

            subs.Add("aaa", "xxx");
            subs.Add("bbb", "yyy");
            subs.Add("ccc", "zzz");
            bot.CreateSubstitutionGraph(subs);

            AimlBot.Normalize.Std.Substitute s = new AimlBot.Normalize.Std.Substitute();
            string result = s.Normalize("aa ccc cc aaa abc bbb bb", bot)[0];

            Assert.AreEqual("aa zzz cc xxx abc yyy bb", result);
        }