Package net.sf.okapi.filters.xliff
Class XLIFFITSFilterExtension
- java.lang.Object
-
- net.sf.okapi.filters.xliff.XLIFFITSFilterExtension
-
public class XLIFFITSFilterExtension extends Object
Extension to the XLIFFFilter to handle ITS metadata in the XLIFF document.
-
-
Constructor Summary
Constructors Constructor Description XLIFFITSFilterExtension(XMLInputFactory xmlFactory, IITSDataStore datastore, URI docURI, XLIFFFilter filter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static StringgetFragmentIdPart(String uriRef)ITSStandoffManagergetITSStandoffManager()Gets the standoff manager object for this helper object.protected static StringgetResourcePart(String uriRef)Separates the fragment ID from the URI reference.voidparseInDocumentITSStandoff(XMLEventReader eventReader, String inStreamCharset)static int[]parseXLQIPos(String data, org.slf4j.Logger logger)Parse a four value lqiPos attribute.protected GenericAnnotationsreadInlineCodeITSAttributes()protected GenericAnnotationreadITSAllowedCharacters()protected GenericAnnotationreadITSExternalResource()protected GenericAnnotationreadITSLocaleFilter()protected ITSLQIAnnotationsreadITSLQI()Resolves standoff and on-element ITS Language Quality Issue data attached to the current element being processed by the XMLStreamReader.protected GenericAnnotationreadITSLQR()protected GenericAnnotationreadITSMtConfidence()protected ITSProvenanceAnnotationsreadITSProvenance()Resolves ITS Provenance standoff data attached to the current element being processed by the XMLStreamReader.protected GenericAnnotationreadITSStorageSize()protected GenericAnnotationsreadTextContainerITSAttributes()protected voidreadTextUnitITSAttributes(ITextUnit resource)voidsetXLIFFReader(XMLStreamReader reader)Sets the reader for this object.
-
-
-
Constructor Detail
-
XLIFFITSFilterExtension
public XLIFFITSFilterExtension(XMLInputFactory xmlFactory, IITSDataStore datastore, URI docURI, XLIFFFilter filter)
-
-
Method Detail
-
parseInDocumentITSStandoff
public void parseInDocumentITSStandoff(XMLEventReader eventReader, String inStreamCharset) throws XMLStreamException
- Throws:
XMLStreamException
-
parseXLQIPos
public static int[] parseXLQIPos(String data, org.slf4j.Logger logger)
Parse a four value lqiPos attribute.- Parameters:
data- the value to parse.logger- the logger to use for warnings.- Returns:
- an array of four integers set to {0,-1,0,-1} by default.
-
setXLIFFReader
public void setXLIFFReader(XMLStreamReader reader)
Sets the reader for this object. The Reader contains parsing state of the XLIFF file and should be set before parsing begins.
-
getITSStandoffManager
public ITSStandoffManager getITSStandoffManager()
Gets the standoff manager object for this helper object.- Returns:
- the standoff manager object for this helper object.
-
readTextUnitITSAttributes
protected void readTextUnitITSAttributes(ITextUnit resource) throws IOException
- Throws:
IOException
-
readTextContainerITSAttributes
protected GenericAnnotations readTextContainerITSAttributes() throws IOException
- Throws:
IOException
-
readInlineCodeITSAttributes
protected GenericAnnotations readInlineCodeITSAttributes() throws IOException
- Throws:
IOException
-
readITSLQI
protected ITSLQIAnnotations readITSLQI() throws IOException
Resolves standoff and on-element ITS Language Quality Issue data attached to the current element being processed by the XMLStreamReader.- Throws:
IOException
-
readITSProvenance
protected ITSProvenanceAnnotations readITSProvenance() throws IOException
Resolves ITS Provenance standoff data attached to the current element being processed by the XMLStreamReader.- Throws:
IOException
-
readITSAllowedCharacters
protected GenericAnnotation readITSAllowedCharacters()
-
readITSMtConfidence
protected GenericAnnotation readITSMtConfidence()
-
readITSLQR
protected GenericAnnotation readITSLQR()
-
readITSStorageSize
protected GenericAnnotation readITSStorageSize()
-
readITSExternalResource
protected GenericAnnotation readITSExternalResource()
-
readITSLocaleFilter
protected GenericAnnotation readITSLocaleFilter()
-
getResourcePart
protected static String getResourcePart(String uriRef)
Separates the fragment ID from the URI reference.- Parameters:
uriRef- the URI to process.- Returns:
- the resource part of the given URI, or an empty string (e.g. for "#myId").
-
-