/** * Writes a TextUnit (all targets) with all the properties associated to it. * <p>Note: If the srclang in the TMX header is "*all*", you must use * {@link #writeTUFull(ITextUnit, LocaleId)} instead. * @param item The text unit to write. */ public void writeTUFull (ITextUnit item) { writeTUFull(item, srcLoc); }
private void processTextUnit (Event event) { writer.writeTUFull(event.getTextUnit()); } }
/** * Exports only a specific target locale Pensieve to TMX * @param sourceLang The source language of desired translation * @param targetLang The target language of desired translation (or null for all target languages) * @param tmSeeker The TMSeeker to use when reading from the TM * @param tmxWriter The TMXWriter to use when writing out the TMX */ public void exportTmx(LocaleId sourceLang, LocaleId targetLang, ITmSeeker tmSeeker, TMXWriter tmxWriter) throws IOException { checkExportTmxParams(sourceLang, tmSeeker, tmxWriter); try { tmxWriter.writeStartDocument(sourceLang, targetLang, "pensieve", "0.0.1", "sentence", "pensieve", "unknown"); //TODO might eat up too much memory for large TMs Iterator<TranslationUnit> iterator = ((PensieveSeeker) tmSeeker).iterator(); while (iterator.hasNext()) { TranslationUnit tu = iterator.next(); if (isWriteTextUnit(sourceLang, targetLang, tu)) { tmxWriter.writeTUFull(PensieveUtil.convertToTextUnit(tu)); } } tmxWriter.writeEndDocument(); } finally { tmxWriter.close(); } }
tmx.writeTUFull(alignedTextUnit);
tmxTu.setTargetProperty(targetLocale3Extra, fmScore1to3Prop); tmx.writeTUFull(tmxTu);