Example #1
0
        /// <summary>
        /// This method is called to determine the birth year for a person. It
        /// obtains 100 web pages that Yahoo returns for that person. Each of these
        /// pages is then searched for the birth year of that person. Which ever year
        /// is selected the largest number of times is selected as the birth year.
        /// </summary>
        public void Process()
        {
            ReadCSV famous = new ReadCSV("famous.csv");

            Report("Building training data from list of famous people.");
            DateTime started = new DateTime();


            this.totalTasks = 0;
            while (famous.Next())
            {
                String name = famous.Get("Person");
                int    year = famous.GetInt("Year");

                CollectionWorker worker = new CollectionWorker(this, name,
                                                               year);
                worker.Call();

                this.totalTasks++;
            }


            long length = (DateTime.Now - started).Ticks;

            length /= 1000L;
            length /= 60;
            Console.WriteLine("Took " + length
                              + " minutes to collect training data from the Internet.");
            Console.WriteLine("Writing training file");
            WriteTrainingFile();
        }