Exemple #1
0
 private void ProcessLine(String line, TrainingSet set,
          double value)
 {
     if (this.histogram.Count(line) >= Config.MINIMUM_WORDS_PRESENT)
     {
         double[] result = this.histogram.Compact(line);
         set.AddTrainingSet(result, value);
         this.currentSample++;
     }
 }
Exemple #2
0
        private void ProcessLines(String filename, TrainingSet set,
                 double value)
        {
            this.currentSample = 0;
            String line = null;

            Stream s = File.OpenRead(filename);
            StreamReader r = new StreamReader(s);

            while ((line = r.ReadLine()) != null)
            {
                ProcessLine(line, set, value);
            }
            s.Close();
        }
 public TrainBot()
 {
     this.common = new CommonWords(Config.FILENAME_COMMON_WORDS);
     this.trainingSet = new TrainingSet();
 }
Exemple #4
0
 public void Process(TrainingSet set, double value,
                     String filename)
 {
     CountLines(filename);
     ProcessLines(filename, set, value);
 }
 public TrainBot()
 {
     this.common      = new CommonWords(Config.FILENAME_COMMON_WORDS);
     this.trainingSet = new TrainingSet();
 }
Exemple #6
0
 public void Process(TrainingSet set, double value,
          String filename)
 {
     CountLines(filename);
     ProcessLines(filename, set, value);
 }