public GrpClassUtility(string connectionString, int timeoutInSecondsBD, int numberSubprocess, int numberSubprocessLanguageIdentification) { if (timeoutInSecondsBD <= 0) throw new ArgumentException(string.Format("timeoutInSecondsBD must be greather than 0 \"{0}\"", Convert.ToString(timeoutInSecondsBD))); else if (string.IsNullOrWhiteSpace(connectionString)) throw new ArgumentNullException("connectionString"); else grpClassDataAccess = new GrpClassDataAccess(connectionString, timeoutInSecondsBD); if (numberSubprocess <= 0) throw new ArgumentException(string.Format("numberSubprocess must be greather than 0 \"{0}\"", Convert.ToString(numberSubprocess))); else this.numberSubprocess = numberSubprocess; if (numberSubprocessLanguageIdentification <= 0) throw new ArgumentException(string.Format("numberSubprocessLanguageIdentification must be greather than 0 \"{0}\"", Convert.ToString(numberSubprocessLanguageIdentification))); else this.numberSubprocessLanguageIdentification = numberSubprocessLanguageIdentification; this.stopWords = new Dictionary<string, List<string>>(); vectorSpaceModelUtility = new VectorSpaceModelUtility(this.stopWords); languageIdentificationUtility = new LanguageIdentificationUtility(); groupingUtility = new GroupingUtility(); }
private void Form1_Load(object sender, EventArgs e) { languageIdentificationUtility = new LanguageIdentificationUtility(); languageIdentificationUtility.ProgressCountExistingStrings += languageIdentificationUtility_ProgresoContarCombinacionesExistentes; languageIdentificationUtility.ProgressCalculateProbabilitiesChangeState += languageIdentificationUtility_ProgresoCalcularProbabilidadesCambioEstado; languageIdentificationUtility.ProgressCalculateProbabilitiesInitialState += languageIdentificationUtility_ProgresoCalcularProbabilidadesEstadoInicial; workerCreateLanguageIdentificationModel = new BackgroundWorker() { WorkerSupportsCancellation = true }; workerCreateLanguageIdentificationModel.DoWork += workerCreateLanguageIdentificationModel_DoWork; workerCreateLanguageIdentificationModel.RunWorkerCompleted += workerCreateLanguageIdentificationModel_RunWorkerCompleted; groupingUtility = new GroupingUtility(); appState = enumAppState.showing; btnOWL_Click(null, null); }