Example #1
0
        /// <summary>
        /// Metoda robiąca preprocesing całęgo katalogu.
        /// Odpala wątek wykonujący preprocesing.
        /// </summary>
        /// <param name="sourcePath"></param>
        public void PreprocessingDir(String sourcePath)
        {
            int dirNumber = PreprocessingUtility.GetDocumentsNumber(sourcePath);

            preprocessingForm             = new PreprocessingForm(this);
            preprocessingForm.MaxProgress = dirNumber;
            preprocessingPath             = sourcePath;
            preprocessingWorker.RunWorkerAsync();
            preprocessingForm.ShowDialog();
        }
Example #2
0
        /// <summary>
        /// WCZYTANIE KATALOGU.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnDirectoryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            String pathTemp = ShowFolderBrowserDialog();

            if (pathTemp == null)
            {
                return;
            }

            OperationType operationType = (OperationType)Settings.Default.operationType;

            switch (operationType)
            {
            case OperationType.Learning:
                String pathSummaryTemp = pathTemp + "\\" + PreprocessingConsts.SummaryFileName;
                if (!IsPrepocessingDone(pathTemp))
                {
                    MessageBox.Show("Dokonaj preprocessing'u dla danych ucz¹cych.", "Preprocessing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                Settings.Default.pathLearningDir            = pathTemp;
                Settings.Default.pathSummaryFile            = pathSummaryTemp;
                Settings.Default.numberAllWordsInDictionary = new WordCountList(pathSummaryTemp).GetUniqueWordsCount();
                Settings.Default.numberLearningCategories   = PreprocessingUtility.GetCategoryNumber(pathTemp);
                Settings.Default.numberLearningDocuments    = PreprocessingUtility.GetDocumentsNumber(pathTemp);

                SetFormStateAfterLoadLearningData();
                break;

            case OperationType.Classification:
                Settings.Default.pathClassificationDir = pathTemp;
                AddItemsToClassificationResultFtomDir(Settings.Default.pathClassificationDir);
                SetFormStateAfterLoadClassificateData();
                break;

            default:
                break;
            }
        }