Пример #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (toolStripComboBox1.SelectedIndex != -1)
            {
                if (textBox4.Text != "" && textBox2.Text != "")
                {
                    if (!textBox3.Text.Contains("[]"))
                    {
                        textBox3.Text = String.Format("[ {0} ]", textBox3.Text);
                    }

                    string    word   = String.Format("{0}%{1}%{2}%{3}%50{4}", 0, textBox4.Text, textBox3.Text, textBox2.Text, Environment.NewLine);
                    TrainWord wordss = new TrainWord(new TrainWord(word, Transletors.Path));
                    if (Transletors.CountLocalWords > 99)
                    {
                        DialogResult res = MessageBox.Show("create newfiel", "d", MessageBoxButtons.YesNo);
                        if (res == DialogResult.No)
                        {
                            Transletors.AddWord(wordss);
                        }
                        else
                        {
                            try
                            {
                                Transletors.AddWord(wordss, true);
                            }
                            catch (Exception ex)
                            {
                                toolStripComboBox1.Items.Add(ex.Message);
                                toolStripComboBox1.SelectedItem = ex.Message;
                            }
                        }
                    }
                    else
                    {
                        Transletors.AddWord(wordss);
                    }
                    textBox4.Text = textBox3.Text = textBox2.Text = "";
                }
            }
            else
            {
                MessageBox.Show("Select file");
            }
        }
Пример #2
0
 public void SafeToFile(TrainWord word)
 {
     tr.AddWord(word);
 }
Пример #3
0
 private void CreateWords_CreateW(TrainWord trainWord)
 {
     trainingWords.AddWord(trainWord);
 }