Ejemplo n.º 1
0
        public override void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            if (!(_decryptSettings.HasBeenCheckedByControl ?? false))
            {
                return;
            }

            base.ProcessParagraphUnit(paragraphUnit);
            if (paragraphUnit.IsStructure)
            {
                return;
            }

            var segmentPairs = paragraphUnit.SegmentPairs.ToList();

            var decryptVisitor = new DecryptSegmentVisitor(ItemFactory, PropertiesFactory, _decryptSettings);

            if (segmentPairs.Count == 0 && paragraphUnit.Source != null)
            {
                decryptVisitor.DecryptText(paragraphUnit.Source);
            }
            else
            {
                foreach (var segmentPair in segmentPairs)
                {
                    decryptVisitor.DecryptText(segmentPair.Source);
                    if (segmentPair.Target != null)
                    {
                        decryptVisitor.DecryptText(segmentPair.Target);
                    }
                }
            }
        }
        public void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            var locationContextInfo = paragraphUnit.Properties.Contexts.Contexts[1];
            var sourcePath          = locationContextInfo.GetMetaData(ContextKeys.SourcePath);
            var targetPath          = locationContextInfo.GetMetaData(ContextKeys.TargetPath);

            if (string.IsNullOrEmpty(targetPath))
            {
                targetPath = sourcePath;
            }

            var targetToken = _rootToken.SelectToken(targetPath);

            if (targetToken == null)
            {
                throw new Exception($"Cannot find token with path {targetPath}");
            }

            if (targetToken.Type != JTokenType.String)
            {
                return;
            }

            var targetText = _segmentReader.GetTargetText(paragraphUnit.SegmentPairs);

            var value = targetToken.Value;

            if (value == null)
            {
                return;
            }

            value.Value = targetText;
        }
Ejemplo n.º 3
0
        public void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            string unitId = paragraphUnit.Properties.Contexts.Contexts[1].GetMetaData("UnitID");
            XmlNode xmlUnit = _targetFile.SelectSingleNode("//translatable[@blockId='" + unitId + "']");

            CreateParagraphUnit(paragraphUnit, xmlUnit);
        }
Ejemplo n.º 4
0
        private void CreateParagraphUnit(IParagraphUnit paragraphUnit, XmlNode xmlUnit)
        {
            // iterate all segment pairs
            foreach (ISegmentPair segmentPair in paragraphUnit.SegmentPairs)
            {
                XmlNode source = xmlUnit.SelectSingleNode(".");

                source.InnerXml = _textExtractor.GetPlainText(segmentPair.Source);

                Byte matchPercent;
                if (segmentPair.Properties.TranslationOrigin != null)
                {
                    matchPercent = segmentPair.Properties.TranslationOrigin.MatchPercent;
                }
                else
                {
                    matchPercent = 0;
                }

                XmlNode target;
                target          = xmlUnit.SelectSingleNode(".");
                target.InnerXml = _textExtractor.GetPlainText(segmentPair.Target);
                //update modified status
                string dataValue = xmlUnit.Attributes["Data"].InnerText;
                xmlUnit.Attributes["Data"].InnerText = UpdateEditedStatus(dataValue, segmentPair.Properties.ConfirmationLevel);
            }
        }
Ejemplo n.º 5
0
        public override void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            if (paragraphUnit.IsStructure || !paragraphUnit.SegmentPairs.Any())
            {
                return;
            }

            foreach (var segmentPair in paragraphUnit.SegmentPairs)
            {
                var segmentPairInfo = new SegmentPairInfo
                {
                    FileId          = _fileProperties.FileConversionProperties.FileId.Id,
                    ParagraphUnit   = paragraphUnit,
                    SegmentPair     = segmentPair,
                    ParagraphUnitId = paragraphUnit.Properties.ParagraphUnitId.Id,
                    SegmentId       = segmentPair.Properties.Id.Id
                };

                try
                {
                    segmentPairInfo.SourceWordCounts = SegmentPairProcessor.GetSegmentPairInfo(segmentPair)?.SourceWordCounts;
                }
                catch
                {
                    // catch all; ignore
                }

                SegmentPairInfos.Add(segmentPairInfo);
            }
        }
Ejemplo n.º 6
0
        private void CreateParagraphUnit(IParagraphUnit paragraphUnit, XmlNode xmlUnit)
        {
            try
            {
                // iterate all segment pairs
                foreach (var segmentPair in paragraphUnit.SegmentPairs)
                {
                    var source = xmlUnit.SelectSingleNode(".");

                    source.InnerXml = _textExtractor.GetPlainText(segmentPair.Source);

                    Byte matchPercent;
                    if (segmentPair.Properties.TranslationOrigin != null)
                    {
                        matchPercent = segmentPair.Properties.TranslationOrigin.MatchPercent;
                    }
                    else
                    {
                        matchPercent = 0;
                    }
                    XmlNode target;
                    target          = xmlUnit.SelectSingleNode(".");
                    target.InnerXml = _textExtractor.GetPlainText(segmentPair.Target);
                    //update modified status
                    string dataValue = xmlUnit.Attributes["Data"].InnerText;
                    xmlUnit.Attributes["Data"].InnerText = UpdateEditedStatus(dataValue, segmentPair.Properties.ConfirmationLevel);
                }
            }
            catch (Exception ex)
            {
                Log.Logger.Error($"CreateParagraphUnit method: {ex.Message}\n {ex.StackTrace}");
            }
        }
        private void AddSegmentPair(IParagraphUnit paragraphUnit, string messageId, string messageString, LineType sourceLineType, bool isTargetTextNeeded)
        {
            var segmentPairProperties = CreateSegmentPairProperties();

            var sourceText = sourceLineType == LineType.MessageString ? messageString : messageId;

            var sourceSegment = ItemFactory.CreateSegment(segmentPairProperties);

            sourceSegment.Add(CreateText(sourceText));
            paragraphUnit.Source.Add(sourceSegment);

            if (!isTargetTextNeeded)
            {
                return;
            }

            if (sourceLineType == LineType.MessageId && !string.IsNullOrEmpty(messageString))
            {
                segmentPairProperties.TranslationOrigin.OriginType = DefaultTranslationOrigin.MachineTranslation;
                segmentPairProperties.ConfirmationLevel            = ConfirmationLevel.Translated;
            }

            var targetSegment = ItemFactory.CreateSegment(segmentPairProperties);

            targetSegment.Add(CreateText(messageString));
            paragraphUnit.Target.Add(targetSegment);
        }
Ejemplo n.º 8
0
        public override void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            base.ProcessParagraphUnit(paragraphUnit);
            if (paragraphUnit.IsStructure)
            {
                return;
            }
            foreach (var segmentPair in paragraphUnit.SegmentPairs.ToList())
            {
                var originType = segmentPair?.Properties?.TranslationOrigin?.OriginType;

                if (!string.IsNullOrEmpty(originType))
                {
                    if (originType.Equals("nmt") || originType.Equals("at"))
                    {
                        segmentPair.Properties.TranslationOrigin.OriginType   = "interactive";
                        segmentPair.Properties.TranslationOrigin.OriginSystem = string.Empty;
                    }
                }

                var originBeforeAdaptation = segmentPair?.Properties?.TranslationOrigin?.OriginBeforeAdaptation?.OriginType;
                if (!string.IsNullOrEmpty(originBeforeAdaptation))
                {
                    if (originBeforeAdaptation.Equals("nmt") || originBeforeAdaptation.Equals("at"))
                    {
                        segmentPair.Properties.TranslationOrigin.OriginBeforeAdaptation.OriginType   = "interactive";
                        segmentPair.Properties.TranslationOrigin.OriginBeforeAdaptation.OriginSystem = string.Empty;
                    }
                }
            }
        }
Ejemplo n.º 9
0
        public void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            string  unitId  = paragraphUnit.Properties.Contexts.Contexts[1].GetMetaData("UnitID");
            XmlNode xmlUnit = _targetFile.SelectSingleNode("//Seg[@SegID='" + unitId + "']");

            CreateParagraphUnit(paragraphUnit, xmlUnit);
        }
        public override void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            base.ProcessParagraphUnit(paragraphUnit);
            if (paragraphUnit.IsStructure)
            {
                return;
            }

            var segmentPairs = paragraphUnit.SegmentPairs.ToList();

            var segmentVisitor = new SegmentVisitor(ItemFactory, PropertiesFactory, _patterns, _encryptionKey, _arePatternsEncrypted);

            if (segmentPairs.Count == 0 && paragraphUnit.Source != null)
            {
                segmentVisitor.ReplaceText(paragraphUnit.Source);
            }
            else
            {
                foreach (var segmentPair in segmentPairs)
                {
                    segmentVisitor.ReplaceText(segmentPair.Source);
                    if (segmentPair.Target != null)
                    {
                        segmentVisitor.ReplaceText(segmentPair.Target);
                    }
                }
            }
        }
Ejemplo n.º 11
0
        public override void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            if (paragraphUnit.IsStructure || !paragraphUnit.SegmentPairs.Any())
            {
                base.ProcessParagraphUnit(paragraphUnit);
                return;
            }

            var updatedSegmentPairs = _updatedSegmentPairs.Where(a =>
                                                                 a.ParagraphUnitId == paragraphUnit.Properties.ParagraphUnitId.Id).ToList();

            TotalSegments += paragraphUnit.SegmentPairs.Count();

            if (updatedSegmentPairs.Any())
            {
                var updatedParagraphUnit = updatedSegmentPairs.FirstOrDefault()?.ParagraphUnit;

                var result = _paragraphUnitProvider.GetUpdatedParagraphUnit(
                    paragraphUnit, updatedParagraphUnit, _excludeFilterIds);

                ExcludedSegments += result.ExcludedSegments;
                UpdatedSegments  += result.UpdatedSegments;

                base.ProcessParagraphUnit(result.Paragraph);
            }
            else
            {
                base.ProcessParagraphUnit(paragraphUnit);
            }
        }
Ejemplo n.º 12
0
        public override void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            if (paragraphUnit.IsStructure)
            {
                return;
            }

            foreach (ISegmentPair item in paragraphUnit.SegmentPairs)
            {

                if (SkipSegment(item))
                {
                    continue;
                }

                _dataExtractor.Process(item.Source);
                var sourceText = _dataExtractor.PlainText.ToString();
                List<Token> sourceTokens = CloneList(_dataExtractor.Tokens);
                _dataExtractor.Process(item.Target);
                string targetText = _dataExtractor.PlainText.ToString();
                List<Token> targetTokens = CloneList(_dataExtractor.Tokens);
                List<string> comments = _dataExtractor.Comments;

                _excelSuperWriter.WriteEntry(item.Properties.Id.Id, sourceText, targetText, comments,
                    item.Properties);
            }
        }
Ejemplo n.º 13
0
        public override void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            if (paragraphUnit.IsStructure)
            {
                return;
            }

            foreach (ISegmentPair item in paragraphUnit.SegmentPairs)
            {
                if (SkipSegment(item))
                {
                    continue;
                }

                _dataExtractor.Process(item.Source);
                var          sourceText   = _dataExtractor.PlainText.ToString();
                List <Token> sourceTokens = CloneList(_dataExtractor.Tokens);
                _dataExtractor.Process(item.Target);
                string        targetText   = _dataExtractor.PlainText.ToString();
                List <Token>  targetTokens = CloneList(_dataExtractor.Tokens);
                List <string> comments     = _dataExtractor.Comments;

                _excelSuperWriter.WriteEntry(item.Properties.Id.Id, sourceText, targetText, comments,
                                             item.Properties);
            }
        }
Ejemplo n.º 14
0
        public override void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            base.ProcessParagraphUnit(paragraphUnit);
            if (paragraphUnit.IsStructure)
            {
                return;
            }
            try
            {
                foreach (var segmentPair in paragraphUnit.SegmentPairs.ToList())
                {
                    var translationOrigin = segmentPair?.Properties?.TranslationOrigin;
                    if (translationOrigin != null && IsAutomatedTranslated(translationOrigin))
                    {
                        AnonymizeComplete(translationOrigin);

                        if (_settings.AnonymizeTmMatch)
                        {
                            if (segmentPair.Properties?.TranslationOrigin.OriginBeforeAdaptation == null)
                            {
                                var originClone = (ITranslationOrigin)translationOrigin.Clone();
                                originClone.OriginBeforeAdaptation = null;
                                segmentPair.Properties.TranslationOrigin.OriginBeforeAdaptation = originClone;
                            }
                            AnonymizeTmMatch(segmentPair.Properties.TranslationOrigin.OriginBeforeAdaptation);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Log.Logger.Error($"{exception.Message}\n {exception.StackTrace}");
            }
        }
Ejemplo n.º 15
0
        public void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            string  id      = paragraphUnit.Properties.Contexts.Contexts[0].GetMetaData("ID");
            XmlNode xmlUnit = targetFile.SelectSingleNode("//x:trans-unit[@id='" + id + "']", nsmgr);

            CreateParagraphUnit(paragraphUnit, xmlUnit);
        }
Ejemplo n.º 16
0
        /// <summary>
        /// This method implements the actual verification logic.
        /// If CheckWordArt is true, the method loops through all segment pairs, and
        /// determines whether they have any context information. If true, and if
        /// the display code equals 'WA' (WordArt), a separate helper function is called
        /// to check the word count.
        /// </summary>
        /// <param name="paragraphUnit"></param>
        #region process paragraph unit
        public void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            if (!CheckWordArt)
            {
                return;
            }

            foreach (ISegmentPair segmentPair in paragraphUnit.SegmentPairs)
            {
                // Four conditions have to be met before the word count check is done:
                // 1. The current segment needs to have context information (i.e. context count > 0)
                // 2. The display code of the first context information unit is 'TAG'
                // 3. The context description contains the string 'wordart'
                // 4. The target segment is not empty
                if (paragraphUnit.Properties.Contexts.Contexts.Count > 0 &&
                    paragraphUnit.Properties.Contexts.Contexts[0].DisplayCode == "TAG" &&
                    paragraphUnit.Properties.Contexts.Contexts[0].Description.Contains("wordart") &&
                    string.IsNullOrWhiteSpace(segmentPair.Target.ToString()) == false)
                {
                    {
                        CheckWordCount(segmentPair.Target);
                    }
                }
            }
        }
        public override void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            if (paragraphUnit.IsStructure)
            {
                return;
            }

            foreach (var pair in paragraphUnit.SegmentPairs)
            {
                if (settings.UseSource)
                {
                    var source = pair.Source;

                    var plainText = new PlainTextExtractor().GetPlainText(source);

                    segmentCountInfo.Add(new SegmentCountInfo(source.Properties.TranslationOrigin, wordCounter.Count(source), source.Properties.IsLocked, plainText.Count(char.IsWhiteSpace)));
                }
                else
                {
                    var target = pair.Target;

                    var plainText = new PlainTextExtractor().GetPlainText(target);

                    segmentCountInfo.Add(new SegmentCountInfo(target.Properties.TranslationOrigin, wordCounter.Count(target), target.Properties.IsLocked, plainText.Count(char.IsWhiteSpace)));
                }
            }
        }
Ejemplo n.º 18
0
 public void SetUp()
 {
     _itemFactoryMock       = A.Fake <IDocumentItemFactory>();
     _propertiesFactoryMock = A.Fake <IPropertiesFactory>();
     _paragraphUnitMock     = A.Fake <IParagraphUnit>();
     A.CallTo(() => _itemFactoryMock.CreateParagraphUnit(A <LockTypeFlags> .Ignored)).Returns(_paragraphUnitMock);
 }
Ejemplo n.º 19
0
        private File GetFileContainer(IParagraphUnit paragraphUnit)
        {
            var contextType = GetContextType(paragraphUnit);
            var file        = Xliff.Files[Xliff.Files.Count - 1];

            if (contextType != null)
            {
                if (contextType != "Recommended")
                {
                    var alternativeFile = Xliff.Files.FirstOrDefault(a => a.Original == contextType);
                    if (alternativeFile != null)
                    {
                        file = alternativeFile;
                    }
                    else
                    {
                        file = new File
                        {
                            Original       = contextType,
                            SourceLanguage = SourceLanguage.Name,
                            TargetLanguage = TargetLanguage.Name,
                            DataType       = "xml"
                        };
                        Xliff.Files.Add(file);
                    }
                }
                else
                {
                    file.Original = "Recommended";
                }
            }

            return(file);
        }
Ejemplo n.º 20
0
 private void RenumberSegments(IParagraphUnit paragraphUnit)
 {
     foreach (var segPair in paragraphUnit.SegmentPairs)
     {
         segPair.Properties.Id = new SegmentId(_nextSegmentId.ToString(CultureInfo.InvariantCulture));
         ++_nextSegmentId;
     }
 }
Ejemplo n.º 21
0
 public void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
 {
     if (Enabled)
     {
         // Apply the verification logic.
         CheckParagraphUnit(paragraphUnit);
     }
 }
 public void SetUp()
 {
     _fileHelperMock    = A.Fake <IFileHelper>();
     _rootTokenMock     = A.Fake <IJToken>();
     _paragraphUnitMock = A.Fake <IParagraphUnit>();
     _sourceValueMock   = A.Fake <IJValue>();
     _targetValueMock   = A.Fake <IJValue>();
 }
Ejemplo n.º 23
0
        public ParagraphUnitResult GetUpdatedParagraphUnit(IParagraphUnit paragraphUnitLeft, IParagraphUnit paragraphUnitRight,
                                                           List <string> excludeFilterIds)
        {
            if (paragraphUnitLeft == null)
            {
                return(null);
            }

            var result = new ParagraphUnitResult
            {
                Paragraph = paragraphUnitLeft.Clone() as IParagraphUnit
            };

            if (result.Paragraph == null)
            {
                return(null);
            }

            result.Paragraph.Properties = paragraphUnitRight.Properties.Clone() as IParagraphUnitProperties;
            result.Paragraph.Source.Clear();
            result.Paragraph.Target.Clear();

            var alignments = GetSegmentPairAlignments(paragraphUnitLeft, paragraphUnitRight);

            foreach (var alignmentInfo in alignments)
            {
                switch (alignmentInfo.Alignment)
                {
                case AlignmentInfo.AlignmentType.Added:
                case AlignmentInfo.AlignmentType.Matched:
                    var isExcluded = SegmentIsExcluded(excludeFilterIds, alignmentInfo.SegmentPairLeft);
                    if (isExcluded)
                    {
                        result.ExcludedSegments++;
                        result.Paragraph.Source.AddSegment(alignmentInfo.SegmentPairLeft.Source, _segmentBuilder);
                        result.Paragraph.Target.AddSegment(alignmentInfo.SegmentPairLeft.Target, _segmentBuilder);
                    }
                    else
                    {
                        if (!IsSame(alignmentInfo.SegmentPairLeft?.Target, alignmentInfo.SegmentPairRight.Target))
                        {
                            result.UpdatedSegments++;
                        }

                        result.Paragraph.Source.AddSegment(alignmentInfo.SegmentPairRight.Source, _segmentBuilder);
                        result.Paragraph.Target.AddSegment(alignmentInfo.SegmentPairRight.Target, _segmentBuilder);
                    }
                    break;

                case AlignmentInfo.AlignmentType.LeftOnly:
                    result.Paragraph.Source.AddSegment(alignmentInfo.SegmentPairLeft.Source, _segmentBuilder);
                    result.Paragraph.Target.AddSegment(alignmentInfo.SegmentPairLeft.Target, _segmentBuilder);
                    break;
                }
            }

            return(result);
        }
Ejemplo n.º 24
0
        public void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            string  unitId  = paragraphUnit.Properties.Contexts.Contexts[1].GetMetaData("UnitID");
            XmlNode xmlUnit = _targetFile.SelectSingleNode("//tu[" + unitId + "]");

            MessageBox.Show(_targetFile.SelectSingleNode("//tu[" + unitId + "]").OuterXml);

            CreateParagraphUnit(paragraphUnit, xmlUnit);
        }
 public override void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
 {
     if (_settings.IsEnabled)
     {
         ProcessParagraph(paragraphUnit.Source);
         ProcessParagraph(paragraphUnit.Target);
     }
     base.ProcessParagraphUnit(paragraphUnit);
 }
Ejemplo n.º 26
0
        public void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            
            string unitId = paragraphUnit.Properties.Contexts.Contexts[1].GetMetaData("UnitID");
            XmlNode xmlUnit = _targetFile.SelectSingleNode("//tu[" + unitId + "]");
            MessageBox.Show(_targetFile.SelectSingleNode("//tu[" + unitId + "]").OuterXml);

            CreateParagraphUnit(paragraphUnit, xmlUnit);
        }
Ejemplo n.º 27
0
        public override void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            if (paragraphUnit.IsStructure || !paragraphUnit.SegmentPairs.Any())
            {
                base.ProcessParagraphUnit(paragraphUnit);
                return;
            }

            var updatedSegmentPairs = _updatedSegmentPairs.Where(a =>
                                                                 a.ParagraphUnitId == paragraphUnit.Properties.ParagraphUnitId.Id).ToList();

            TotalSegments = paragraphUnit.SegmentPairs.Count();

            if (updatedSegmentPairs.Any())
            {
                foreach (var segmentPair in paragraphUnit.SegmentPairs)
                {
                    var updatedSegmentPair = updatedSegmentPairs.FirstOrDefault(a =>
                                                                                a.SegmentId == segmentPair.Properties.Id.Id);

                    if (updatedSegmentPair?.SegmentPair?.Target == null ||
                        IsSame(segmentPair.Target, updatedSegmentPair.SegmentPair.Target) ||
                        IsEmpty(updatedSegmentPair.SegmentPair.Target))
                    {
                        continue;
                    }


                    if (_excludeFilterIds.Count > 0)
                    {
                        var status = segmentPair.Properties.ConfirmationLevel.ToString();
                        var match  = _filterItemService.GetTranslationOriginType(segmentPair.Target.Properties.TranslationOrigin,
                                                                                 _analysisBands);

                        if ((segmentPair.Properties.IsLocked && _excludeFilterIds.Exists(a => a == "Locked")) ||
                            _excludeFilterIds.Exists(a => a == status) ||
                            _excludeFilterIds.Exists(a => a == match))
                        {
                            ExcludedSegments++;
                            continue;
                        }
                    }

                    segmentPair.Target.Clear();
                    foreach (var item in updatedSegmentPair.SegmentPair.Target)
                    {
                        segmentPair.Target.Add(item.Clone() as IAbstractMarkupData);
                    }

                    segmentPair.Properties = updatedSegmentPair.SegmentPair.Properties;

                    UpdatedSegments++;
                }
            }

            base.ProcessParagraphUnit(paragraphUnit);
        }
Ejemplo n.º 28
0
        /// <summary>
        /// The following member performs the actual verification. It traverses the segment pairs of the current document,
        /// and checks whether a particular segment has any numbers. It then determines whether
        /// the target and the source contains the same numbers.
        /// If not, a warning message will be generated, which is then displayed between the source and target segments,
        /// and in the Messages window of SDL Trados Studio.
        /// </summary>
        /// <param name="paragraphUnit"></param>
        public void CheckParagraphUnit(IParagraphUnit paragraphUnit)
        {
            // loop through the whole paragraph unit
            foreach (var segmentPair in paragraphUnit.SegmentPairs.Where(FilterSegmentPairs))
            {
                var sourceText = GetSegmentText(segmentPair.Source);
                var targetText = GetSegmentText(segmentPair.Target);

                var errorMessageList = CheckSourceAndTarget(sourceText, targetText);

                #region ReportingMessage

                foreach (var errorMessage in errorMessageList)
                {
                    if (errorMessage.ExtendedErrorMessage != string.Empty && VerificationSettings.ReportExtendedMessages)
                    {
                        var extendedMessageReporter =
                            MessageReporter as IBilingualContentMessageReporterWithExtendedData;
                        if (extendedMessageReporter != null)
                        {
                            #region CreateExtendedData

                            var extendedData = new NumberVerifierMessageData(errorMessage.SourceNumberIssues,
                                                                             errorMessage.TargetNumberIssues,
                                                                             segmentPair.Target);

                            #endregion

                            #region ReportingMessageWithExtendedData

                            extendedMessageReporter.ReportMessage(this, PluginResources.Plugin_Name,
                                                                  errorMessage.ErrorLevel, errorMessage.ExtendedErrorMessage,
                                                                  new TextLocation(new Location(segmentPair.Target, true), 0),
                                                                  new TextLocation(new Location(segmentPair.Target, false),
                                                                                   segmentPair.Target.ToString().Length - 1),
                                                                  extendedData);

                            #endregion
                        }
                    }
                    else if (errorMessage.ErrorMessage != string.Empty)
                    {
                        #region ReportingMessageWithoutExtendedData

                        MessageReporter.ReportMessage(this, PluginResources.Plugin_Name,
                                                      errorMessage.ErrorLevel, errorMessage.ErrorMessage,
                                                      new TextLocation(new Location(segmentPair.Target, true), 0),
                                                      new TextLocation(new Location(segmentPair.Target, false),
                                                                       segmentPair.Target.ToString().Length - 1));

                        #endregion
                    }
                }
            }
        }
Ejemplo n.º 29
0
        public override void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            if (paragraphUnit.IsStructure)
            {
                UpdateParagraphUnit(paragraphUnit);
                return;
            }

            if (!paragraphUnit.SegmentPairs.Any())
            {
                return;
            }

            var segmentPairs = new List <ISegmentPair>();

            foreach (var segmentPair in paragraphUnit.SegmentPairs)
            {
                if (_subSegmentParagraphUnitIds.Contains(paragraphUnit.Properties.ParagraphUnitId.Id) ||
                    _selectedSegments.Exists(a =>
                                             a.ParagraphUnitId == paragraphUnit.Properties.ParagraphUnitId.Id &&
                                             a.SegmentId == segmentPair.Properties.Id.Id))
                {
                    segmentPairs.Add(segmentPair);

                    var subSegmentParagraphUnitIds = GetSubSegmentParagraphUnitIds(segmentPair);
                    foreach (var paragraphUnitId in subSegmentParagraphUnitIds.Where(paragraphUnitId =>
                                                                                     !_subSegmentParagraphUnitIds.Exists(a => a == paragraphUnitId)))
                    {
                        _subSegmentParagraphUnitIds.Add(paragraphUnitId);
                    }

                    var segmentPairInfo = new SegmentPairInfo
                    {
                        FileId          = _fileProperties.FileConversionProperties.FileId.Id,
                        ParagraphUnit   = paragraphUnit,
                        SegmentPair     = segmentPair,
                        ParagraphUnitId = paragraphUnit.Properties.ParagraphUnitId.Id,
                        SegmentId       = segmentPair.Properties.Id.Id
                    };

                    try
                    {
                        segmentPairInfo.SourceWordCounts = SegmentPairProcessor.GetSegmentPairInfo(segmentPair)?.SourceWordCounts;
                    }
                    catch
                    {
                        // catch all; ignore
                    }

                    SegmentPairInfos.Add(segmentPairInfo);
                }
            }

            AddSegmentPairs(paragraphUnit, segmentPairs);
        }
Ejemplo n.º 30
0
        /// <summary>
        /// The following member performs the actual verification. It traverses the segment pairs of the current document,
        /// and checks whether a particular segment has any context information (count > 0). It then determines whether
        /// the display code is identical to the display code entered in the plug-in settings.
        /// If this is the case, it determines whether the target segment is actually identical to the source segment.
        /// If not, a warning message will be generated, which is then displayed between the source and target segments,
        /// and in the Messages window of SDL Trados Studio.
        /// </summary>
        /// <param name="paragraphUnit"></param>
        #region "verify"
        private void CheckParagraphUnit(IParagraphUnit paragraphUnit)
        {
            // Declare and reset target segment text.
            string completeTextTarget = "";

            // loop through the whole paragraph unit
            foreach (ISegmentPair segmentPair in paragraphUnit.SegmentPairs)
            {
                // Determine if context information is available,
                // and if the context equals the one specified in the user interface.
                if (paragraphUnit.Properties.Contexts.Contexts.Count > 0 &&
                    paragraphUnit.Properties.Contexts.Contexts[0].DisplayCode == VerificationSettings.CheckContext.Value)
                {
                    // Check whether target differs from source.
                    // If this is the case, then output a warning message
                    if (segmentPair.Source.ToString() != segmentPair.Target.ToString())
                    {
                        // Generate the plain text information if ConsiderTags is not true.
                        #region "GetPlainText"
                        completeTextTarget += TextGeneratorProcessor.GetPlainText(segmentPair.Target, VerificationSettings.ConsiderTags.Value);
                        #endregion

                        #region ReportingMessage
                        if (MessageReporter is IBilingualContentMessageReporterWithExtendedData)
                        {
                            #region CreateExtendedData
                            string context = paragraphUnit.Properties.Contexts.Contexts[0].DisplayCode;
                            IdenticalVerifierMessageData extendedData = new IdenticalVerifierMessageData(completeTextTarget +
                                                                                                         " - must be identical to source because the paragraph has context " + context + ".", segmentPair.Source);
                            #endregion

                            #region ReportingMessageWithExtendedData
                            IBilingualContentMessageReporterWithExtendedData extendedMessageReporter = (IBilingualContentMessageReporterWithExtendedData)MessageReporter;
                            extendedMessageReporter.ReportMessage(this, PluginResources.Plugin_Name,
                                                                  ErrorLevel.Warning, PluginResources.Error_NotIdentical,
                                                                  new TextLocation(new Location(segmentPair.Target, true), 0),
                                                                  new TextLocation(new Location(segmentPair.Target, false), segmentPair.Target.ToString().Length - 1),
                                                                  extendedData);
                            #endregion
                        }
                        else
                        {
                            #region ReportingMessageWithoutExtendedData
                            MessageReporter.ReportMessage(this, PluginResources.Plugin_Name,
                                                          ErrorLevel.Warning, PluginResources.Error_NotIdentical,
                                                          new TextLocation(new Location(segmentPair.Target, true), 0),
                                                          new TextLocation(new Location(segmentPair.Target, false), segmentPair.Target.ToString().Length - 1));
                            #endregion
                        }
                        #endregion
                    }
                }
            }
        }
Ejemplo n.º 31
0
        public void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            //old: string unitId = paragraphUnit.Properties.Contexts.Contexts[1].MetaData["UnitID"];
            string  unitId  = paragraphUnit.Properties.Contexts.Contexts[1].GetMetaData("UnitID");
            XmlNode xmlUnit = _targetFile.SelectSingleNode("//unit[@id='" + unitId + "']");

            // call helper function to generate the paragraph unit
            CreateParagraphUnit(paragraphUnit, xmlUnit);
            // call helper function to consolidate all comments
            UpdateComments(paragraphUnit, xmlUnit);
        }
 public override void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
 {
     if (_isEnabled)
     {
         RemoveSegments(paragraphUnit.Source);
         ProcessParagraph(paragraphUnit.Source);
         paragraphUnit.Target.Clear();
         //ClearSegment(paragraphUnit.Target);
         //   ProcessParagraphUnit(paragraphUnit.Target);
     }
     base.ProcessParagraphUnit(paragraphUnit);
 }
 public override void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
 {
     if (_isEnabled)
     {
         RemoveSegments(paragraphUnit.Source);
         ProcessParagraph(paragraphUnit.Source);
         paragraphUnit.Target.Clear();
         //ClearSegment(paragraphUnit.Target);
         //   ProcessParagraphUnit(paragraphUnit.Target);
     }
     base.ProcessParagraphUnit(paragraphUnit);
 }
Ejemplo n.º 34
0
        public override void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            var sourceResult = new List <IndexData>();
            var targetResult = new List <IndexData>();

            if (!paragraphUnit.IsStructure)
            {
                foreach (var item in paragraphUnit.SegmentPairs)
                {
                    var itemStatus = item.Properties.ConfirmationLevel;

                    // extract text and tags from Segment
                    var sourceSegment = item.Source;
                    _dataExtractor.Process(sourceSegment);
                    var sourceTags = _dataExtractor.Tags;
                    //we need to add a space before the soft return so the soft return is highlightable when searching for it
                    var sourceText     = _dataExtractor.PlainText.ToString().Replace("\n", " \n");
                    var sourceLContent = _dataExtractor.LockedContent;

                    var targetSegment = item.Target;
                    _dataExtractor.Process(targetSegment);
                    //we need to add a space before the soft return so the soft return is highlightable when searching for it
                    var targetText     = _dataExtractor.PlainText.ToString().Replace("\n", " \n");
                    var targetTags     = _dataExtractor.Tags;
                    var targetLContent = _dataExtractor.LockedContent;

                    // perform search
                    if (_searcher.CheckSegment(item.Properties.IsLocked, item.Properties.ConfirmationLevel))
                    {
                        if (_searchSettings.SearchInSource && (sourceText.Length > 0 || sourceTags.Count > 0))
                        {
                            _searcher.SearchInSegment(sourceText, sourceTags, sourceLContent);
                            sourceResult = _searcher.ResultsInText;
                            sourceTags   = _searcher.ResultsInTags;
                        }

                        if (_searchSettings.SearchInTarget && (targetText.Length > 0 || targetTags.Count > 0))
                        {
                            _searcher.SearchInSegment(targetText, targetTags, targetLContent);
                            targetResult = _searcher.ResultsInText;
                            targetTags   = _searcher.ResultsInTags;
                        }

                        // collect results
                        if (SegmentHelper.ContainMatches(sourceResult, sourceTags) || SegmentHelper.ContainMatches(targetResult, targetTags))
                        {
                            CollectResults(item.Properties.Id.Id, sourceText, itemStatus, sourceSegment, sourceResult, sourceTags, true);
                            CollectResults(item.Properties.Id.Id, targetText, itemStatus, targetSegment, targetResult, targetTags, false);
                        }
                    }
                }
            }
        }
        public void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            //Example
            foreach (ISegmentPair segmentPair in paragraphUnit.SegmentPairs)
            {

                ContentGeneratorProcessor.GetPlainText(segmentPair.Source, true);
                string sourceText = ContentGeneratorProcessor.PlainText.ToString();

                ContentGeneratorProcessor.GetPlainText(segmentPair.Target, true);
                string targetText = ContentGeneratorProcessor.PlainText.ToString();

                SegmentListExample.Add(new SegmentExampleClass(segmentPair.Properties.Id.Id, sourceText, targetText));

            }
        }
Ejemplo n.º 36
0
        private void CreateParagraphUnit(IParagraphUnit paragraphUnit, XmlNode xmlUnit)
        {
            foreach (ISegmentPair segmentPair in paragraphUnit.SegmentPairs)
            {
                XmlNode source = xmlUnit.SelectSingleNode("./tuv[1]/seg");
                source.InnerXml = _textExtractor.GetPlainText(segmentPair.Source);

                XmlNode target = xmlUnit.SelectSingleNode("./tuv[2]/seg");
                target.InnerXml = _textExtractor.GetPlainText(segmentPair.Target);

                if (xmlUnit.SelectNodes("prop[@type='x-ConfirmationLevel']").Count > 0)
                {
                    xmlUnit.SelectSingleNode("prop[@type='x-ConfirmationLevel']").InnerText = UpdateEditedStatus(segmentPair.Properties.ConfirmationLevel);
                }
            }
        }
Ejemplo n.º 37
0
        /// <summary>
        /// The following member performs the actual verification. It traverses the segment pairs of the current document,
        /// and checks whether a particular segment has any numbers. It then determines whether
        /// the target and the source contains the same numbers.
        /// If not, a warning message will be generated, which is then displayed between the source and target segments,
        /// and in the Messages window of SDL Trados Studio.
        /// </summary>
        /// <param name="paragraphUnit"></param>
        private void CheckParagraphUnit(IParagraphUnit paragraphUnit)
        {

            var sourceNumberList = new List<string>();
            var targetNumberList = new List<string>();
            var sourceNormalizedNumberList = new List<string>();
            var targetNormalizedNumberList = new List<string>();

            // loop through the whole paragraph unit
            foreach (var segmentPair in paragraphUnit.SegmentPairs.Where(FilterSegmentPairs))
            {
                var sourceText = GetSegmentText(segmentPair.Source);
                var targetText = GetSegmentText(segmentPair.Target);
               

                // find all alphanumeric names in source and add to list
                var sourceAlphanumericsList = GetAlphanumericList(sourceText);

                // find all alphanumeric names in target and add to list
                var targetAlphanumericsList = GetAlphanumericList(targetText);

                // remove alphanumeric names found both in source and target from respective list
                RemoveMatchingAlphanumerics(sourceAlphanumericsList, targetAlphanumericsList);

                // find all numbers in source and add to list
                sourceNumberList.Clear();
                sourceNormalizedNumberList.Clear();
                NormalizeAlphanumerics(sourceText, sourceNumberList, sourceNormalizedNumberList,_sourceThousandSeparators,_sourceDecimalSeparators, VerificationSettings.SourceNoSeparator);

                // find all numbers in target and add to list
                targetNumberList.Clear();
                targetNormalizedNumberList.Clear();
                NormalizeAlphanumerics(targetText, targetNumberList, targetNormalizedNumberList,_targetThousandSeparators,_targetDecimalSeparators, VerificationSettings.TargetNoSeparator);

                // remove identical numbers found both in source and target from respective list
                RemoveIdenticalNumbers(sourceNumberList, targetNumberList, targetNormalizedNumberList, sourceNormalizedNumberList);

                // remove numbers found both in source and target from respective list disregarding difference in thousands and decimal separators
                RemoveNumbersIgnoreThousandsAndDecimalSeparators(sourceNumberList, targetNormalizedNumberList, sourceNormalizedNumberList, targetNumberList);

                // remove numbers found both in source and target from respective list disregarding difference when thousands and decimal separators are undefined due to ambiguity 
                RemoveNumbersUndefinedThousandsAndDecimalSeparator(targetNumberList, sourceNumberList, sourceNormalizedNumberList, targetNormalizedNumberList);



                var errorLevel = ErrorLevel.Unspecified;
                var errorMessage = String.Empty;
                var extendedErrorMessage = String.Empty;

                // check if numbers have been modified and should be reported
                if (sourceNumberList.Count > 0 && targetNumberList.Count > 0 && VerificationSettings.ReportModifiedNumbers.Value)
                {
                    switch (VerificationSettings.ModifiedNumbersErrorType.Value)
                    {
                        case "Error":
                            errorLevel = ErrorLevel.Error;
                            break;
                        case "Warning":
                            errorLevel = ErrorLevel.Warning;
                            break;
                        default:
                            errorLevel = ErrorLevel.Note;
                            break;
                    }
                    errorMessage = errorMessage + PluginResources.Error_NumbersNotIdentical;
                }

                // check if numbers have been added and should be reported
                if (sourceNumberList.Count < targetNumberList.Count && VerificationSettings.ReportAddedNumbers.Value)
                {
                    if (VerificationSettings.AddedNumbersErrorType.Value == "Error")
                    {
                        errorLevel = ErrorLevel.Error;
                    }
                    else if (VerificationSettings.AddedNumbersErrorType.Value == "Warning" && errorLevel != ErrorLevel.Error)
                    {
                        errorLevel = ErrorLevel.Warning;
                    }
                    else if (errorLevel != ErrorLevel.Error && errorLevel != ErrorLevel.Warning)
                    {
                        errorLevel = ErrorLevel.Note;
                    }
                    errorMessage = errorMessage + PluginResources.Error_NumbersAdded;
                }

                // check if numbers have been removed and should be reported
                if (sourceNumberList.Count > targetNumberList.Count && VerificationSettings.ReportRemovedNumbers.Value)
                {
                    if (VerificationSettings.RemovedNumbersErrorType.Value == "Error")
                    {
                        errorLevel = ErrorLevel.Error;
                    }
                    else if (VerificationSettings.RemovedNumbersErrorType.Value == "Warning" && errorLevel != ErrorLevel.Error)
                    {
                        errorLevel = ErrorLevel.Warning;
                    }
                    else if (errorLevel != ErrorLevel.Error && errorLevel != ErrorLevel.Warning)
                    {
                        errorLevel = ErrorLevel.Note;
                    }
                    errorMessage = errorMessage + PluginResources.Error_NumbersRemoved;
                }

                // check if alphanumeric names are mismatched and should be reported
                if ((targetAlphanumericsList.Count > 0 || sourceAlphanumericsList.Count > 0) && VerificationSettings.ReportModifiedAlphanumerics.Value)
                {
                    if (VerificationSettings.ModifiedAlphanumericsErrorType.Value == "Error")
                    {
                        errorLevel = ErrorLevel.Error;
                    }
                    else if (VerificationSettings.ModifiedAlphanumericsErrorType.Value == "Warning" && errorLevel != ErrorLevel.Error)
                    {
                        errorLevel = ErrorLevel.Warning;
                    }
                    else if (errorLevel != ErrorLevel.Error && errorLevel != ErrorLevel.Warning)
                    {
                        errorLevel = ErrorLevel.Note;
                    }
                    errorMessage = errorMessage + PluginResources.Error_AlphanumericsModified;
                }


                // if there are any mismatched numbers or alphanumerics to report, output a warning message
                if (errorMessage == String.Empty) continue;

                // collate remaining numbers and put into string variables for reporting of details
                var sourceNumberIssues = String.Empty;
                if (sourceNumberList.Count > 0 && (VerificationSettings.ReportAddedNumbers.Value || VerificationSettings.ReportRemovedNumbers.Value || VerificationSettings.ReportModifiedNumbers.Value))
                {
                    sourceNumberIssues = sourceNumberList.Aggregate(sourceNumberIssues, (current, t) => current + (t + " \r\n"));
                }

                if (sourceAlphanumericsList.Count > 0 && VerificationSettings.ReportModifiedAlphanumerics.Value)
                {
                    sourceNumberIssues = sourceAlphanumericsList.Aggregate(sourceNumberIssues, (current, t) => current + (t + " \r\n"));
                }

                var targetNumberIssues = String.Empty;
                if (targetNumberList.Count > 0 && (VerificationSettings.ReportAddedNumbers.Value || VerificationSettings.ReportRemovedNumbers.Value || VerificationSettings.ReportModifiedNumbers.Value))
                {
                    targetNumberIssues = targetNumberList.Aggregate(targetNumberIssues, (current, t) => current + (t + " \r\n"));
                }

                if (targetAlphanumericsList.Count > 0 && VerificationSettings.ReportModifiedAlphanumerics.Value)
                {
                    targetNumberIssues = targetAlphanumericsList.Aggregate(targetNumberIssues, (current, t) => current + (t + " \r\n"));
                }


                if (VerificationSettings.ReportExtendedMessages == true)
                {
                    extendedErrorMessage = "\r\n SOURCE: " + TextGeneratorProcessor.GetPlainText(segmentPair.Source, !VerificationSettings.ExcludeTagText.Value) + " \r\n TARGET: " + TextGeneratorProcessor.GetPlainText(segmentPair.Target, !VerificationSettings.ExcludeTagText.Value);
                }


                #region ReportingMessage

                var extendedMessageReporter = MessageReporter as IBilingualContentMessageReporterWithExtendedData;
                if (extendedMessageReporter != null)
                {
                    #region CreateExtendedData
                    var extendedData = new NumberVerifierMessageData(sourceNumberIssues, targetNumberIssues, segmentPair.Target);
                    #endregion

                    #region ReportingMessageWithExtendedData
                    extendedMessageReporter.ReportMessage(this, PluginResources.Plugin_Name,
                        errorLevel, errorMessage + extendedErrorMessage,
                        new TextLocation(new Location(segmentPair.Target, true), 0),
                        new TextLocation(new Location(segmentPair.Target, false), segmentPair.Target.ToString().Length - 1),
                        extendedData);
                    #endregion

                }
                else
                {
                    #region ReportingMessageWithoutExtendedData
                    MessageReporter.ReportMessage(this, PluginResources.Plugin_Name,
                        errorLevel, errorMessage + extendedErrorMessage,
                        new TextLocation(new Location(segmentPair.Target, true), 0),
                        new TextLocation(new Location(segmentPair.Target, false), segmentPair.Target.ToString().Length - 1));
                    #endregion
                }
            }
        }
Ejemplo n.º 38
0
        private void CreateParagraphUnit(IParagraphUnit paragraphUnit, XmlNode xmlUnit)
        {            
            int i = 0;            

            // iterate all segment pairs
            foreach (ISegmentPair segmentPair in paragraphUnit.SegmentPairs)
            {
                var xmlNodeList = xmlUnit.SelectNodes("segment");
                if (xmlNodeList != null && xmlNodeList[i] != null)
                {
                    XmlNode source = xmlNodeList[i].SelectSingleNode("source");

                    if (source != null)
                    {
                        source.InnerXml = _textExtractor.GetPlainText(segmentPair.Source);
                    }

                }

                Byte matchPercent;
                if (segmentPair.Properties.TranslationOrigin != null)
                    matchPercent = segmentPair.Properties.TranslationOrigin.MatchPercent;
                else
                    matchPercent = 0;
                
                XmlNode target;
                var segmentNodes = xmlUnit.SelectNodes("segment");
                if (segmentNodes != null && segmentNodes[i]!=null)
                {
                    if (segmentNodes[i].SelectSingleNode("target") == null)
                    {
                        if (segmentNodes[i].SelectSingleNode("target") == null)
                        {
                            XmlDocument segDoc = new XmlDocument();
                            string nodeContent = segmentNodes[i].OuterXml;
                            segDoc.LoadXml(nodeContent);
                            XmlNode trgNode = segDoc.CreateNode(XmlNodeType.Element, "target", null);

                            XmlNode importNode = segmentNodes[i].OwnerDocument.ImportNode(trgNode, true);
                            segmentNodes[i].AppendChild(importNode);
                            segmentNodes[i].SelectSingleNode("target").InnerXml =
                                _textExtractor.GetPlainText(segmentPair.Target);

                        }
                    }
                    else
                    {
                        if (segmentNodes[i] != null)
                        {
                            target = segmentNodes[i].SelectSingleNode("target");
                            target.InnerXml = _textExtractor.GetPlainText(segmentPair.Target);
                        }
                    }


                    //add comments (if applicable)
                    List<string> comments = _textExtractor.GetSegmentComment(segmentPair.Target);
                    if (comments.Count > 0 && segmentNodes[i].SelectSingleNode("comments") == null)
                    {
                        XmlElement commentsElement = _targetFile.CreateElement("comments");
                        XmlElement commentElement = _targetFile.CreateElement("comments");
                        segmentNodes[i].AppendChild(commentElement);
                    }

                    foreach (string comment in _textExtractor.GetSegmentComment(segmentPair.Target))
                    {
                        AddComment(segmentNodes[i].SelectSingleNode("comments"), comment);
                    }


                    //update score value
                    if (segmentNodes[i].SelectSingleNode("target").Attributes["score"] != null)
                    {
                        segmentNodes[i].SelectSingleNode("target").Attributes["score"].Value = matchPercent.ToString();
                    }
                    else
                    {
                        segmentNodes[i].SelectSingleNode("target")
                            .Attributes.Append(xmlUnit.OwnerDocument.CreateAttribute("score"));
                        segmentNodes[i].SelectSingleNode("target").Attributes["score"].Value = matchPercent.ToString();
                    }


                    //update modified status
                    if (xmlUnit.Attributes["modified"] != null)
                    {
                        segmentNodes[i].Attributes["modified"].Value =
                            UpdateEditedStatus(segmentPair.Properties.ConfirmationLevel);
                    }
                    else
                    {
                        segmentNodes[i].Attributes.Append(xmlUnit.OwnerDocument.CreateAttribute("modified"));
                        segmentNodes[i].Attributes["modified"].Value =
                            UpdateEditedStatus(segmentPair.Properties.ConfirmationLevel);
                    }
                }
                i++;
            }
        }
        public override void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
        {
            Text.Add(PlainTextExtractor.GetPlainText(paragraphUnit.Source));

            base.ProcessParagraphUnit(paragraphUnit);
        }
Ejemplo n.º 40
0
 public void ProcessParagraphUnit(IParagraphUnit paragraphUnit)
 {
     if (Enabled)
     {
         // Apply the verification logic.
         CheckParagraphUnit(paragraphUnit);
     }
 }