Esempio n. 1
0
        public void ToParametersTest1()
        {
            Phonetic target = new Phonetic("You {Bitch ; Awesomne Man}");

            string[] expected = { "\"Bitch\"" };
            string[] actual = target.ToParameters("You Bitch");

            AssertToParameters(expected, actual);
        }
Esempio n. 2
0
        public void MatchesTest()
        {
            Phonetic target = new Phonetic()
            {
                Value = "{ I ; He ; She } Just Love * { Watching; Playing } {Volleyball;Soccer;Tennis} ?"
            };

            string value = "He Just Love ... Playing Soccer Dudettes at the race car";
            bool expected = true;

            bool actual = target.Matches(value);
            Assert.AreEqual(expected, actual);

            value = "I Just Love ... Watching Tennis";
            expected = true;

            actual = target.Matches(value);
            Assert.AreEqual(expected, actual);
        }
Esempio n. 3
0
        public void ToParametersTest3()
        {
            Phonetic target = new Phonetic("Hey ? {I ; You} Dont ? {Today; As Of Yesterday}");

            string[] expected = { "\"Buddy,\"", "\"You\"", "\"Look So Good\"", "\"As Of Yesterday\"" };
            string[] actual = target.ToParameters("Hey Buddy, You Dont Look So Good As Of Yesterday");

            AssertToParameters(expected, actual);
        }
Esempio n. 4
0
        public void ToParametersTest2()
        {
            Phonetic target = new Phonetic("You {Bitch ; Awesomne Man} I ?");

            string[] expected = { "\"Awesomne Man\"", "\"Love You\"" };
            string[] actual = target.ToParameters("You Awesomne Man I Love You");

            AssertToParameters(expected, actual);
        }
Esempio n. 5
0
        public void ToParametersTest4()
        {
            Phonetic target = new Phonetic("? {Are You ; Have you ever been} ?");

            string[] expected = { "\"Hey Johnny\"", "\"Have you ever been\"", "\"to a lady gaga concert\"" };
            string[] actual = target.ToParameters("Hey Johnny Have you ever been to a lady gaga concert");

            AssertToParameters(expected, actual);
        }
Esempio n. 6
0
        void _recognizer_PhoneticRequested(Phonetic phon, String calling)
        {
            if (!_active && !phon.AlwaysActive)
                return;

            String parameters = String.Join(" ", phon.ToParameters(calling));

            foreach(Function func in phon.Functions)
                RunFunction(func, parameters);
        }
Esempio n. 7
0
 public Target(Phonetic phon, String phrase)
 {
     Phonetic = phon;
     Phrase = phrase;
 }