private void Create_Click(object sender, RoutedEventArgs e)
        {
            string name   = nameTextbox.Text;
            int    layers = (int)layerSlider.Value;

            int[] layerStateSizes  = new int[layers];
            int[] layerOutputSizes = new int[layers];
            for (int i = 0; i < layerStateSizes.Length; i++)
            {
                layerStateSizes[i]  = layerStateConfigs[i];
                layerOutputSizes[i] = layerOutputConfigs[i];
            }

            Translator usedTranslator;

            switch (translatorComboBox.SelectedIndex)
            {
            case 0:
                usedTranslator = new CharToSymbolTranslator();
                break;

            case 1:
                usedTranslator = new SyllableToSymbolTranslator();
                break;

            default:
                return;
            }

            layerOutputSizes[layers - 1] = usedTranslator.getSymbolCount();

            Couppy newChatbot = new Couppy(layerStateSizes, layerOutputSizes, usedTranslator);

            newChatbot.name = name;
            newChatbot.SaveToFile(name + ".cp");
            caller.Update();
            Close();
        }
Пример #2
0
 private void Save_Click(object sender, RoutedEventArgs e)
 {
     chatbot.SaveToFile(chatbot.name + ".cp");
 }