예제 #1
0
        public ContentExporter(List <SegmentPairInfo> selectedSegments, SegmentBuilder segmentBuilder)
        {
            _selectedSegments = selectedSegments;
            _segmentBuilder   = segmentBuilder;

            _projectFilesFiltered = new List <string>();
            SegmentPairInfos      = new List <SegmentPairInfo>();
        }
 public SdlxliffImporter(ProjectFileService projectFileService, FilterItemService filterItemService,
                         ParagraphUnitProvider paragraphUnitProvider, SegmentBuilder segmentBuilder)
 {
     _projectFileService    = projectFileService;
     _filterItemService     = filterItemService;
     _paragraphUnitProvider = paragraphUnitProvider;
     _segmentBuilder        = segmentBuilder;
 }
예제 #3
0
        public ContentImporter(List <SegmentPairInfo> updatedSegmentPairs, List <string> excludeFilterIds,
                               FilterItemService filterItemService, ParagraphUnitProvider paragraphUnitProvider, SegmentBuilder segmentBuilder)
        {
            _updatedSegmentPairs   = updatedSegmentPairs;
            _excludeFilterIds      = excludeFilterIds;
            _filterItemService     = filterItemService;
            _paragraphUnitProvider = paragraphUnitProvider;
            _segmentBuilder        = segmentBuilder;

            UpdatedSegments  = 0;
            ExcludedSegments = 0;
            TotalSegments    = 0;
        }
예제 #4
0
        public OutputFile ExportFile(List <SegmentPairInfo> selectedSegments, string filePathInput, string filePathOutput)
        {
            var fileTypeManager = DefaultFileTypeManager.CreateInstance(true);
            var converter       = fileTypeManager.GetConverterToDefaultBilingual(filePathInput, filePathOutput, null);

            var segmentBuilder = new SegmentBuilder();
            var contentWriter  = new ContentExporter(selectedSegments, segmentBuilder);

            converter.AddBilingualProcessor(contentWriter);
            converter.SynchronizeDocumentProperties();

            converter.Parse();


            var outputFile = new OutputFile
            {
                FilePath     = filePathOutput,
                SegmentCount = contentWriter.SegmentPairInfos.Count,
                WordCount    = contentWriter.SegmentPairInfos.Sum(a => a.SourceWordCounts.Words)
            };


            return(outputFile);
        }
예제 #5
0
 public SdlxliffExporter(SegmentBuilder segmentBuilder)
 {
     _segmentBuilder = segmentBuilder;
 }