public SimpleSentenceStats() { Predicates = new LinguisticObjectsGroup(); Subjects = new LinguisticObjectsGroup(); Uniforms = new LinguisticObjectsGroup(); MeaningAuxParts = new LinguisticObjectsGroup(); ChainsFromSubjects = new LinkedObjectsChainGroup(); ChainsFromPredicates = new LinkedObjectsChainGroup(); ChainsFromMeaningParts = new LinkedObjectsChainGroup(); WasEmulated = false; }
public static void CalculateAverage(LinguisticObjectsGroup objectsGroup) { if (!objectsGroup.Objects.Any()) { objectsGroup.AverageDetectionQuality = 1d; } else { var detectedSamples = objectsGroup.Objects.Where(o => o.MappedObjects.TargetObjects != null || o.WasEmulated).ToList(); objectsGroup.AverageDetectionQuality = _calculateAverage(detectedSamples); } }
private void _writeSimpleSentenceComparisonResult(LinguisticObjectsGroup objects, Sentence sentence) { XlHelper.AddMargin(); _writeSSHeader(objects.Objects, sentence); _writeSSBody(objects.Objects); XlHelper.WriteRow(() => { XlHelper.WriteValue(Labels.MeanLoDetectionQuality, Colors.SummaryRow); _writeObjectsAverage(objects.Objects, objects.AverageDetectionQuality); }); }
private static LinguisticObjectsGroup _getStatsFoSS(LinguisticObjectsMap objectsMap, Sentence target, Sentence sample) { var result = new LinguisticObjectsGroup { Objects = objectsMap.SimpleSentences.Select(match => _processSimpleSentence(match, target, sample)).ToList() }; _chargePenalties(result.Objects); result.Objects.ForEach(o => SimpleSentenceStats.CalculateAverage(result)); var falsey = result.Objects.Any(o => o.MappedObjects.SampleObjects == null); return result; }
private static LinguisticObjectsGroup _correctErrorsInObjectsGroup(LinguisticObjectsGroup objectsGroup, IEnumerable<ClasterizedSentenceError> errors, int correctionClass) { var emulated = new LinguisticObjectsGroup { Objects = objectsGroup.Objects.Select(o => _correctErrorsInObject(o, errors, correctionClass)).ToList(), AverageDetectionQuality = objectsGroup.AverageDetectionQuality }; emulated.WasEmulated = emulated.Objects.Any(o => o.WasEmulated); return emulated; }
private void _writeStatsForObjects(LinguisticObjectsGroup objects) { XlHelper.WriteValue(objects.Objects.Count); XlHelper.WriteValue(objects.AverageDetectionQuality, objects.WasEmulated ? Colors.EmulatedQuality : (Color?) null, XlsxHelper.PercentageFormat); }