|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.okapi.common.filterwriter.ext.ITSContent
public class ITSContent
Utilities for writing out ITS markup.
Field Summary | |
---|---|
static java.lang.String |
REF_PREFIX
|
static java.lang.String |
STANDOFFMARKER
Marker used in a skeleton part to indicate where standoff markup can be inserted when merging. |
Constructor Summary | |
---|---|
ITSContent(java.nio.charset.CharsetEncoder encoder,
boolean isHTML5,
boolean isXLIFF)
Creates an ITSContent object with a given character set encoder. |
Method Summary | |
---|---|
void |
clearStandoff()
Clears the standoff markup. |
java.util.List<net.sf.okapi.common.annotation.GenericAnnotations> |
getStandoff()
Gets the current standoff markup. |
boolean |
hasStandoff()
Indicates if this object has at least standoff item. |
static boolean |
isExtendedMatch(java.lang.String langRanges,
java.lang.String langTag)
Indicates if a given language tag matches at least one item of a list of extended language ranges. |
void |
outputAnnotations(net.sf.okapi.common.annotation.GenericAnnotations anns,
java.lang.StringBuilder output,
boolean inline,
boolean mrk,
net.sf.okapi.common.LocaleId trgLocId)
Generates the markup for the ITS attributes for a given annotation set. |
java.lang.String |
writeAttributeProvenance(net.sf.okapi.common.annotation.GenericAnnotation ann)
|
java.lang.String |
writeAttributesLQI(net.sf.okapi.common.annotation.GenericAnnotation ann)
Writes the data attributes for a given LQI annotation (not locQualityIssuesRef). |
java.lang.String |
writeStandoffLQI()
Output the standoff markup for this object and clear it afterward. |
java.lang.String |
writeStandoffLQI(java.util.List<net.sf.okapi.common.annotation.GenericAnnotations> annotations)
Output all the Localization Quality issue annotation groups in a given list. |
java.lang.String |
writeStandoffProvenance(java.util.List<net.sf.okapi.common.annotation.GenericAnnotations> annotations)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String STANDOFFMARKER
public static final java.lang.String REF_PREFIX
Constructor Detail |
---|
public ITSContent(java.nio.charset.CharsetEncoder encoder, boolean isHTML5, boolean isXLIFF)
encoder
- the character set encoder to use (can be null for UTF-8)isHTML5
- true to generate markup for HTML5, false for XML.isXLIFF
- true if the XML output is XLIFF, false for generic ITS.
This parameter is ignored if isHTML5
Method Detail |
---|
public static boolean isExtendedMatch(java.lang.String langRanges, java.lang.String langTag)
Based on the algorithm described at: http://tools.ietf.org/html/rfc4647#section-3.3.2
langRanges
- the list of extended language ranges (with optional '!' prefix for 'exclude')langTag
- the language tag.
public java.lang.String writeStandoffLQI()
this.writeStandoffLQI(this.getStandoff());
then this.clearStandoff()
public java.lang.String writeStandoffLQI(java.util.List<net.sf.okapi.common.annotation.GenericAnnotations> annotations)
annotations
- the list of annotation set to process.
public java.lang.String writeAttributesLQI(net.sf.okapi.common.annotation.GenericAnnotation ann)
ann
- the annotation to output.
public java.lang.String writeStandoffProvenance(java.util.List<net.sf.okapi.common.annotation.GenericAnnotations> annotations)
public java.lang.String writeAttributeProvenance(net.sf.okapi.common.annotation.GenericAnnotation ann)
public void outputAnnotations(net.sf.okapi.common.annotation.GenericAnnotations anns, java.lang.StringBuilder output, boolean inline, boolean mrk, net.sf.okapi.common.LocaleId trgLocId)
anns
- the annotations set (can be null).output
- the buffer where to append the output.inline
- true if the element is an inline element.mrk
- true if the element is an XLIFF mrk element.trgLocId
- target locale (can be null). This is use with mrk and Locale Filter.public java.util.List<net.sf.okapi.common.annotation.GenericAnnotations> getStandoff()
public boolean hasStandoff()
public void clearStandoff()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |