Note changes in M32 causes notes not to be preserved in my custom pipelines

Issue #596 resolved
Mike Bryant created an issue

Notes are no longer preserved for my custom pipelines in M32 (this has worked on M29-M31). For example, my pipeline to pseudo translate an XLF looks like this:

    /**
     * Pseudo-translates an XLF file using the PseudoTranslationStep specified
     */
    public static void pseudoTranslateXlf(PseudoTranslationStep transStep,
            LocaleId targetLocale, File srcFile, File destFile) throws OkapiException {

        String rootDir = getRootDir(srcFile);
        try (RawDocument rawSrc = new RawDocument(srcFile.toURI(), UTF8,
                    LocaleId.ENGLISH, targetLocale)) {
            IFilter filter = new XLIFFFilter();
            rawSrc.setFilterConfigId(filter.getName());
            PipelineDriver pipeline = getPipelineDriver(filter, rootDir);
            pipeline.addStep(new RawDocumentToFilterEventsStep());
            pipeline.addStep(transStep);
            pipeline.addStep(getXliffWriterStep());
            pipeline.addBatchItem(rawSrc, destFile.toURI(), UTF8);
            pipeline.processBatch();
            pipeline.destroy();
        }
    }

The getXliffWriterStep() method returns a FilterEventsWriterStep with a filter writer set to a subclass of XLIFFWriter. The transStep is always a subclass of BasePipelineStep.

Comments (7)

  1. Chase Tingley

    That would be a good cleanup. If we're going to do Property.NOTE, we should also do Property.TRANSNOTE and just use the note annotation for everything. Then we can delete the old properties.

    Mike if we go that route, do you have any interest in taking on switching over a couple of the filters?

  2. Mike Bryant reporter

    I'm interested, but I'm not setup to contribute to the project currently. In other words, my availability to contribute in a timely manner is suspect :-)

  3. Chase Tingley

    Oh well, it was worth a shot :)

    If you haven't yet, you should feel free to join the okapi-devel mailing list, at least to lurk. If we do decide to clean house on some of this stuff there will surely be some discussion about it, and it will help keep you alert to anything else we're going to break by accident.

  4. Log in to comment