Exemplo n.º 1
0
 public BaseSentenceAlgorithm Add(BaseSentenceAlgorithm alg)
 {
     if (Algorithms.FindByInternalName(alg.Info.InternalName, false) == null)
         Algorithms.Add(alg);
     else
         throw new Exception($"Алгоритм с именем {alg.Info.InternalName} уже существует");
     return alg;
 }
Exemplo n.º 2
0
 public AlgorithmsContainer(BaseSentenceAlgorithm baseAlgorithm, AlgorithmsStageType algorithmsStageType)
 {
     _baseAlgorithm = baseAlgorithm;
     AlgorithmsStageType = algorithmsStageType;
     Algorithms = new List<BaseSentenceAlgorithm>();
 }
Exemplo n.º 3
0
 private void _saveAlgorithmResults(AlgorithmsStageType containerType, BaseSentenceAlgorithm algorithm, BaseSentenceAlgorithmData resultData )
 {
     _algorithmResults.Add(new AlgorithmResult
     {
         ContainerType = containerType,
         Algorithm = algorithm,
         Results = resultData.HelperDataElements,
         Sentence = resultData.Sentence,
         Log = _currentAlgLogMessages,
         FinalResults =
             resultData.FinalResults?.Select(
                 pair =>
                     new DisplayFinalResults
                     {
                         WritableHelperData = pair.Value.HelperData,
                         CheckResult = pair.Value.CheckResult,
                         WritableType = pair.Key
                     }).ToList()
     });
 }