示例#1
0
 void untrainAllButton_Click(object sender, EventArgs e)
 {
     alphabet.UnTrain();
     graphics.Clear(Color.White);
     example.Clear();
     symbolDisplayLabel.Text = "?";
     probabilityDataGrid.Rows.Clear();
     File.WriteAllText("Alphabet.xml", String.Empty);
     using (FileStream fs = new FileStream("Alphabet.xml", FileMode.OpenOrCreate))
     {
         serializer.Serialize(fs, alphabet);
     }
 }
示例#2
0
        /// <summary>
        /// <para>Trains specified symbol from alphabet</para>
        /// </summary>
        /// <param name="name"></param>
        /// <param name="example"></param>
        public void TrainSymbol(char name, TestSymbol example)
        {
            Symbol symbol = Symbols.Where(x => x.Name == name).FirstOrDefault();

            symbol.Train(example);
            example.Clear();
        }