Example #1
0
        public static string[] getWords(string input)
        {
            string[] aux = Regex.Split(input, " ");
            for (int i = 0; i < aux.Length; i++)
            {
                aux[i] = SAnalysis.Clean(aux[i]);
            }

            return(aux);
        }
Example #2
0
        static void Main(string[] args)
        {
            string request  = "";
            string response = "";

            string[]             acciones      = { "holas buenas saludos salud", "tiempo harĂ¡", "enciende led" };
            double[]             coincidencias = { 0.0, 0.0, 0.0 };
            TaskAwaiter <string> tiempo        = SAnalysis.getWeather().GetAwaiter();

            while (!request.Equals("quit"))
            {
                Console.Write("User: "******"Lo siento, no lo he entendido!!\nHumans Win ;P");
                }
            }
            Console.WriteLine("Goood bye!!");
        }
Example #3
0
        public static double totalCoincidence(string[] input, string[] pattern, double dim)
        {
            double aux, coi = 0.0;
            int    maincoi = 0;

            foreach (string p in pattern)
            {
                foreach (string s in input)
                {
                    aux = SAnalysis.Coincidence(p, s);;
                    if (aux >= dim)
                    {
                        maincoi++;
                        coi += aux;
                    }
                    //Console.WriteLine("{0}, {1} -> {2}", s, p, aux);
                }
            }
            if (coi == 0)
            {
                maincoi = 1;
            }
            return(coi / maincoi);
        }