Package net.sf.okapi.filters.xliff
Class XLIFFSkeletonWriter
- java.lang.Object
-
- net.sf.okapi.common.skeleton.GenericSkeletonWriter
-
- net.sf.okapi.filters.xliff.XLIFFSkeletonWriter
-
- All Implemented Interfaces:
ISkeletonWriter
- Direct Known Subclasses:
IwsXliffSkeletonWriter,SdlXliffSkeletonWriter
public class XLIFFSkeletonWriter extends GenericSkeletonWriter
-
-
Field Summary
Fields Modifier and Type Field Description static StringALTTRANSMARKERstatic StringCONTEXT_GROUP_MARKERstatic StringITSNSDECLstatic StringNOTEMARKERstatic StringSEGSOURCEMARKER-
Fields inherited from class net.sf.okapi.common.skeleton.GenericSkeletonWriter
allowEmptyOutputTarget, ALLOWEMPTYOUTPUTTARGET, encoderManager, inputLoc, isMultilingual, layer, outputEncoding, outputLoc, storageStack
-
-
Constructor Summary
Constructors Constructor Description XLIFFSkeletonWriter()XLIFFSkeletonWriter(Parameters params)XLIFFSkeletonWriter(Parameters params, XLIFFContent fmt, ITSContent itsCont, ITSStandoffManager itsStandoffManager, Map<String,GenericAnnotations> lqiStandoff, Map<String,GenericAnnotations> provStandoff, CharsetEncoder chsEnc)
-
Method Summary
-
Methods inherited from class net.sf.okapi.common.skeleton.GenericSkeletonWriter
_processEndGroup, _processStartGroup, addToReferents, close, getContent, getEncoderManager, getInputLoc, getLayer, getOutputEncoding, getOutputLoc, getReference, getReferentCopies, getReferents, getSfWriter, getString, getString, getString, getString, isAllowEmptyOutputTarget, isCodeThatDisablesEncoding, isMultilingual, processDocumentPart, processEndGroup, processEndSubDocument, processEndSubfilter, processStartSubfilter, setAllowEmptyOutputTarget, setEncoderManager, setLayer, setMultilingual, setOutputEncoding, setOutputLoc, setReferentCopies, setReferents
-
-
-
-
Field Detail
-
SEGSOURCEMARKER
public static final String SEGSOURCEMARKER
- See Also:
- Constant Field Values
-
ALTTRANSMARKER
public static final String ALTTRANSMARKER
- See Also:
- Constant Field Values
-
ITSNSDECL
public static final String ITSNSDECL
- See Also:
- Constant Field Values
-
NOTEMARKER
public static final String NOTEMARKER
- See Also:
- Constant Field Values
-
CONTEXT_GROUP_MARKER
public static final String CONTEXT_GROUP_MARKER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
XLIFFSkeletonWriter
public XLIFFSkeletonWriter()
-
XLIFFSkeletonWriter
public XLIFFSkeletonWriter(Parameters params)
-
XLIFFSkeletonWriter
public XLIFFSkeletonWriter(Parameters params, XLIFFContent fmt, ITSContent itsCont, ITSStandoffManager itsStandoffManager, Map<String,GenericAnnotations> lqiStandoff, Map<String,GenericAnnotations> provStandoff, CharsetEncoder chsEnc)
-
-
Method Detail
-
processStartDocument
public String processStartDocument(LocaleId outputLocale, String outputEncoding, ILayerProvider layer, EncoderManager encoderManager, StartDocument resource)
Description copied from interface:ISkeletonWriterProcesses the START_DOCUMENT event.- Specified by:
processStartDocumentin interfaceISkeletonWriter- Overrides:
processStartDocumentin classGenericSkeletonWriter- Parameters:
outputLocale- the output locale.outputEncoding- the name of the output charset encoding.layer- the layer provider to use.encoderManager- the encoder manager to use.resource- the StartDocument resource associated with the event.- Returns:
- the string output corresponding to this event.
-
processTextUnit
public String processTextUnit(ITextUnit resource)
Description copied from interface:ISkeletonWriterProcesses the TEXT_UNIT event.- Specified by:
processTextUnitin interfaceISkeletonWriter- Overrides:
processTextUnitin classGenericSkeletonWriter- Parameters:
resource- the TextUnit resource associated with the event.- Returns:
- the string output corresponding to this event.
-
processStartSubDocument
public String processStartSubDocument(StartSubDocument resource)
Description copied from interface:ISkeletonWriterProcesses a START_SUBDOCUMENT event.- Specified by:
processStartSubDocumentin interfaceISkeletonWriter- Overrides:
processStartSubDocumentin classGenericSkeletonWriter- Parameters:
resource- the StartSubDocument resource associated with the event.- Returns:
- the string output corresponding to this event.
-
processStartGroup
public String processStartGroup(StartGroup resource)
Description copied from interface:ISkeletonWriterProcesses the START_GROUP event.- Specified by:
processStartGroupin interfaceISkeletonWriter- Overrides:
processStartGroupin classGenericSkeletonWriter- Parameters:
resource- the StartGroup resource associated with the event.- Returns:
- the string output corresponding to this event.
-
processEndDocument
public String processEndDocument(Ending resource)
Description copied from interface:ISkeletonWriterProcesses the END_DOCUMENT event.- Specified by:
processEndDocumentin interfaceISkeletonWriter- Overrides:
processEndDocumentin classGenericSkeletonWriter- Parameters:
resource- the Ending resource associated with the event.- Returns:
- the string output corresponding to this event.
-
addUnusedAnnotations
public void addUnusedAnnotations(StringBuilder endDoc, ITSContent itsContent, Collection<String> storedAnns, HashMap<String,GenericAnnotations> standoff, Class<? extends GenericAnnotations> type)
-
getString
protected String getString(GenericSkeletonPart part, EncoderContext context)
- Overrides:
getStringin classGenericSkeletonWriter
-
getContent
protected String getContent(ITextUnit tu, LocaleId locToUse, EncoderContext context)
Description copied from class:GenericSkeletonWriterGets the original content of a given text unit.- Overrides:
getContentin classGenericSkeletonWriter- Parameters:
tu- The text unit to process.locToUse- locale to output. Use null for the source, or the locale for the target locales.context- Context flag: 0=text, 1=skeleton, 2=inline.- Returns:
- The string representation of the text unit content.
-
expandCodeContent
protected String expandCodeContent(Code code, LocaleId locToUse, EncoderContext context)
- Overrides:
expandCodeContentin classGenericSkeletonWriter
-
getPropertyValue
protected String getPropertyValue(INameable resource, String name, LocaleId locToUse, EncoderContext context)
- Overrides:
getPropertyValuein classGenericSkeletonWriter
-
getITSStandoffManager
public ITSStandoffManager getITSStandoffManager()
-
setITSStandoffManager
public void setITSStandoffManager(ITSStandoffManager itsStandoffManager)
-
getParams
public Parameters getParams()
-
getFmt
public XLIFFContent getFmt()
-
getItsCont
public ITSContent getItsCont()
-
getLqiStandoff
public Map<String,GenericAnnotations> getLqiStandoff()
-
getProvStandoff
public Map<String,GenericAnnotations> getProvStandoff()
-
getCharsetEncoder
public CharsetEncoder getCharsetEncoder()
-
-