private void processorCalculateProbabilitiesChangeState_ErrorProcessEntity(ProbabilityChangeStateWrapper entity, Error error) { errorsMultithreadedProcess.Add(new WritableTuple<object, Error>(entity, error)); }
private Return<object> CalculateProbabilitiesChangeStateDirtyHands(ProbabilityChangeStateWrapper wrapper) { Return<object> _answer = new Return<object>(); if (wrapper == null) { _answer.theresError = true; _answer.error = Utility.GetError(new ArgumentNullException("wrapper"), this.GetType()); } else { try { foreach (LanguageIdentificationModelWrapper _fragment in wrapper.fragmentsOfModel) { WritableTuple<string, int> _combinedTuple = null; if (!wrapper.countCombinedStrings.ContainsKey(_fragment.combinedString)) throw new Exception(string.Format("Was impossible to find a combination for {0}", _fragment.combinedString)); else _combinedTuple = new WritableTuple<string, int>(_fragment.combinedString, wrapper.countCombinedStrings[_fragment.combinedString]); WritableTuple<string, int> _initialTuple = null; if (!wrapper.countInitialStrings.ContainsKey(_fragment.initialString)) throw new Exception(string.Format("Was impossible to find a tuple for {0}", _fragment.initialString)); else _initialTuple = new WritableTuple<string, int>(_fragment.initialString, wrapper.countInitialStrings[_fragment.initialString]); int _numberOfOccurrencesOfCombination = _combinedTuple.Item2, _numberOfOccurrencesOfInitialString = _initialTuple.Item2; decimal _Pabc_abcd = SOFT_PROBABILITY_0; if (_numberOfOccurrencesOfCombination != 0 && _numberOfOccurrencesOfInitialString != 0) _Pabc_abcd = (decimal)_numberOfOccurrencesOfCombination / (decimal)_numberOfOccurrencesOfInitialString; _fragment.probability = _Pabc_abcd; } } catch (Exception _ex) { _answer.theresError = true; _answer.error = Utility.GetError(_ex, this.GetType()); } } return _answer; }