/** * Set the mime type on the current {@link TextUnit} * @param mimeType - mime type */ public void setTextUnitMimeType(String mimeType) { ITextUnit tu = peekMostRecentTextUnit(); if (tu != null) { tu.setMimeType(mimeType); } }
tuRes.setMimeType(MIMETYPE); //TODO: work-out something for escapes in regex if ( rule.preserveWS ) { tuRes.setPreserveWhitespaces(true);
tuRes.setMimeType(MimeTypeMapper.PROPERTIES_MIME_TYPE); tuRes.setPreserveWhitespaces(true); if (note.length() > 0) {
tu.setMimeType(getMimeType()); eventBuilder.endTextUnit();
tu.setPreserveWhitespaces(true); tu.setSourceContent(tf); tu.setMimeType(MimeTypeMapper.MIF_MIME_TYPE); tu.setName(resname); resname = null; processILC(tu);
refTU.setType(resType); refTU.setIsReferent(true); refTU.setMimeType(MIFSTRING_MIME_TYPE);
tu.setMimeType(MimeTypeMapper.TS_MIME_TYPE); if (ts.messageId != null) { tu.setName(ts.messageId);
tu.setSkeleton(skel); tu.setMimeType(getMimeType());
ITextUnit tu = new TextUnit(String.valueOf(++tuId)); tu.setSourceContent(new TextFragment(data)); tu.setMimeType(MimeTypeMapper.XML_MIME_TYPE); tu.setType("x-"+partName); queue.add(new Event(EventType.TEXT_UNIT, tu));
public Event next() { // Change the mime type by regex filter ("text/x-regex") to "text/plain" Event event = regex.next(); if (event == null) return event; // Returns null IResource res = event.getResource(); if (res == null) return event; // Do not change event if (event.getEventType() == EventType.TEXT_UNIT) { ITextUnit textUnit = event.getTextUnit(); // Change mime type textUnit.setMimeType(this.getMimeType()); // Lines are what the regex considers the lines, so line numbering is actually TU numbering ((ITextUnit)res).setSourceProperty(new Property(AbstractLineFilter.LINE_NUMBER, String.valueOf(++lineNumber), true)); // Automatically replace text fragments with in-line codes (based on regex rules of codeFinder) if (params.useCodeFinder && codeFinder != null) { // We can use getFirstPartContent() because nothing is segmented yet TextContainer source = textUnit.getSource(); if (source == null) return event; codeFinder.process(source.getFirstContent()); } } return event; }
tu.setMimeType(mimeType); tu.setSourceContent(frag); if (this.trgLangCode != null && targetText != null) {
tuRes.setMimeType(MIMETYPE); //TODO: work-out something for escapes in regex if ( rule.preserveWS ) { tuRes.setPreserveWhitespaces(true);
private ITextUnit embeddedTextUnit(PropertyTextUnitPlaceholder propOrText, String tag) { ITextUnit tu = new TextUnit(textUnitId.createId(), propOrText.getValue()); tu.setPreserveWhitespaces(this.preserveWhitespace); tu.setMimeType(propOrText.getMimeType()); tu.setIsReferent(true); tu.setType(propOrText.getElementType() == null ? propOrText.getName() : propOrText.getElementType()); GenericSkeleton skel = new GenericSkeleton(); skel.add(tag.substring(propOrText.getMainStartPos(), propOrText.getValueStartPos())); skel.addContentPlaceholder(tu); skel.add(tag.substring(propOrText.getValueEndPos(), propOrText.getMainEndPos())); tu.setSkeleton(skel); postProcessTextUnit(tu); return tu; }
tu.setSourceContent(tf); tu.setName(resname); resname = null; tu.setMimeType(MIFSTRING_MIME_TYPE); processILC(tu); queue.add(new Event(EventType.TEXT_UNIT, tu, skel));
tf_target.setMimeType(MimeTypeMapper.TS_MIME_TYPE); queue.add(new Event(EventType.TEXT_UNIT, tf_target)); skel = new GenericSkeleton();
textUnit.setMimeType(getMimeType()); textUnit.setPreserveWhitespaces(params.preserveWS);
tu.setMimeType(MimeTypeMapper.TMX_MIME_TYPE);
dupTu.setMimeType(MimeTypeMapper.TMX_MIME_TYPE);
tu.setMimeType(getMimeType()); queue.add(new Event(EventType.TEXT_UNIT, tu, skel)); skel = new XMLSkeleton();
tu.setMimeType(this.mimeType); tu.setPreserveWhitespaces(this.preserveWhitespace);