コード例 #1
0
        } // verbWordsButton_Click_1

        private void adjectiveWordsButton_Click(object sender, RoutedEventArgs e)
        {
            //CREATE TABLE AdjectiveWords(id int primary key, name nvarchar(20) NULL, count int NULL)

            if (!System.IO.Directory.Exists(pathTextBox.Text))
            {
                MessageBox.Show($"Path \"{pathTextBox.Text}\" doesn't exist");
                return;
            }

            string[] endsWith = new string[] {
                "ой", "ей", "ому", "ему", "ый", "ий", "ья", "ье", "ые", "ая", "ое",
            };

            TxtReader reader = new TxtReader(pathTextBox.Text, endsWith); // class to find words from .txt files by endings
            Dictionary <string, int> adjectiveWords = reader.GetWords();  // get found words

            AddToSQL(adjectiveWords, "AdjectiveWords");
        } // adjectiveWordsButton_Click
コード例 #2
0
        private void verbWordsButton_Click_1(object sender, RoutedEventArgs e)
        {
            //CREATE TABLE VerbWords(id int primary key, name nvarchar(20) NULL, count int NULL)

            if (!System.IO.Directory.Exists(pathTextBox.Text))
            {
                MessageBox.Show($"Path \"{pathTextBox.Text}\" doesn't exist");
                return;
            }

            string[] endsWith = new string[] {
                "ешь", "ет", "ем", "ете", "ут", "ют", "ишь", "ит", "им", "ите", "aт", "ят", "ить", "ять"
            };

            TxtReader reader = new TxtReader(pathTextBox.Text, endsWith); // class to find words from .txt files by endings
            Dictionary <string, int> verbWords = reader.GetWords();       // get found words

            AddToSQL(verbWords, "VerbWords");
        } // verbWordsButton_Click_1