Package net.sf.okapi.lib.xliff2.its
Class ITSReader
- java.lang.Object
-
- net.sf.okapi.lib.xliff2.its.ITSReader
-
public class ITSReader extends Object
Provides utility methods to read ITS attributes and stand-off elements.
-
-
Field Summary
Fields Modifier and Type Field Description static StringANNOTATORSREFstatic StringDOMAINSstatic StringLOCQUALITYISSUEstatic StringLOCQUALITYISSUECOMMENTstatic StringLOCQUALITYISSUEENABLEDstatic StringLOCQUALITYISSUEPROFILEREFstatic StringLOCQUALITYISSUESstatic StringLOCQUALITYISSUESEVERITYstatic StringLOCQUALITYISSUESREFstatic StringLOCQUALITYISSUETYPEstatic StringMTCONFIDENCEstatic StringPROVENANCERECORDstatic StringPROVENANCERECORDSstatic StringPROVENANCERECORDSREFstatic StringPROVORGstatic StringPROVORGREFstatic StringPROVPERSONstatic StringPROVPERSONREFstatic StringPROVREFstatic StringPROVREVORGstatic StringPROVREVORGREFstatic StringPROVREVPERSONstatic StringPROVREVPERSONREFstatic StringPROVREVTOOLstatic StringPROVREVTOOLREFstatic StringPROVTOOLstatic StringPROVTOOLREFstatic StringTACLASSREFstatic StringTACONFIDENCEstatic StringTAIDENTstatic StringTAIDENTREFstatic StringTASOURCEstatic StringTERMCONFIDENCE
-
Constructor Summary
Constructors Constructor Description ITSReader(XMLStreamReader reader)Creates a newITSReaderobject for a given reader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfetchUnresolvedITSGroups(IWithITSAttributes parent)Tries to resolve any un-resolved reference to ITS stand-off group.AnnotatorsRefreadAnnotatorsRef(boolean local, AnnotatorsRef parentAR)Reads the annotatorsRef attribute from the current element.booleanreadAttributes(IWithITSGroups groupHolder, IWithITSAttributes object, AnnotatorsRef ar)Reads the ITS attributes for the current element.voidreadStandOffElements(String initialLocName, IWithITSGroups groupHolder, AnnotatorsRef ar)Reads the stand-off ITS elementsvoidreadTerminology(TermTag marker, AnnotatorsRef ar)Reads the ITS attributes for terminology.
-
-
-
Field Detail
-
ANNOTATORSREF
public static final String ANNOTATORSREF
- See Also:
- Constant Field Values
-
MTCONFIDENCE
public static final String MTCONFIDENCE
- See Also:
- Constant Field Values
-
DOMAINS
public static final String DOMAINS
- See Also:
- Constant Field Values
-
TACONFIDENCE
public static final String TACONFIDENCE
- See Also:
- Constant Field Values
-
TACLASSREF
public static final String TACLASSREF
- See Also:
- Constant Field Values
-
TASOURCE
public static final String TASOURCE
- See Also:
- Constant Field Values
-
TAIDENT
public static final String TAIDENT
- See Also:
- Constant Field Values
-
TAIDENTREF
public static final String TAIDENTREF
- See Also:
- Constant Field Values
-
LOCQUALITYISSUES
public static final String LOCQUALITYISSUES
- See Also:
- Constant Field Values
-
LOCQUALITYISSUE
public static final String LOCQUALITYISSUE
- See Also:
- Constant Field Values
-
LOCQUALITYISSUETYPE
public static final String LOCQUALITYISSUETYPE
- See Also:
- Constant Field Values
-
LOCQUALITYISSUECOMMENT
public static final String LOCQUALITYISSUECOMMENT
- See Also:
- Constant Field Values
-
LOCQUALITYISSUEENABLED
public static final String LOCQUALITYISSUEENABLED
- See Also:
- Constant Field Values
-
LOCQUALITYISSUESEVERITY
public static final String LOCQUALITYISSUESEVERITY
- See Also:
- Constant Field Values
-
LOCQUALITYISSUEPROFILEREF
public static final String LOCQUALITYISSUEPROFILEREF
- See Also:
- Constant Field Values
-
LOCQUALITYISSUESREF
public static final String LOCQUALITYISSUESREF
- See Also:
- Constant Field Values
-
PROVENANCERECORDS
public static final String PROVENANCERECORDS
- See Also:
- Constant Field Values
-
PROVENANCERECORD
public static final String PROVENANCERECORD
- See Also:
- Constant Field Values
-
PROVTOOL
public static final String PROVTOOL
- See Also:
- Constant Field Values
-
PROVTOOLREF
public static final String PROVTOOLREF
- See Also:
- Constant Field Values
-
PROVREVTOOL
public static final String PROVREVTOOL
- See Also:
- Constant Field Values
-
PROVREVTOOLREF
public static final String PROVREVTOOLREF
- See Also:
- Constant Field Values
-
PROVPERSON
public static final String PROVPERSON
- See Also:
- Constant Field Values
-
PROVPERSONREF
public static final String PROVPERSONREF
- See Also:
- Constant Field Values
-
PROVREVPERSON
public static final String PROVREVPERSON
- See Also:
- Constant Field Values
-
PROVREVPERSONREF
public static final String PROVREVPERSONREF
- See Also:
- Constant Field Values
-
PROVORG
public static final String PROVORG
- See Also:
- Constant Field Values
-
PROVORGREF
public static final String PROVORGREF
- See Also:
- Constant Field Values
-
PROVREVORG
public static final String PROVREVORG
- See Also:
- Constant Field Values
-
PROVREVORGREF
public static final String PROVREVORGREF
- See Also:
- Constant Field Values
-
PROVREF
public static final String PROVREF
- See Also:
- Constant Field Values
-
PROVENANCERECORDSREF
public static final String PROVENANCERECORDSREF
- See Also:
- Constant Field Values
-
TERMCONFIDENCE
public static final String TERMCONFIDENCE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ITSReader
public ITSReader(XMLStreamReader reader)
Creates a newITSReaderobject for a given reader.- Parameters:
reader- the XML stream reader to associate with this object.
-
-
Method Detail
-
readStandOffElements
public void readStandOffElements(String initialLocName, IWithITSGroups groupHolder, AnnotatorsRef ar) throws XMLStreamException
Reads the stand-off ITS elements- Parameters:
initialLocName- name of the element on which the method is called.groupHolder- object where the group is located.ar- the annotator reference context.- Throws:
XMLStreamException- if a reading error occurs.
-
readAttributes
public boolean readAttributes(IWithITSGroups groupHolder, IWithITSAttributes object, AnnotatorsRef ar)
Reads the ITS attributes for the current element.- Parameters:
groupHolder- the object where any stand-off group for the object being looked at is expected to be.object- the object where to read from.ar- the current annotators references (can be null).- Returns:
- true if one or more of the ITS items read has an unresolved stand-off reference.
-
readTerminology
public void readTerminology(TermTag marker, AnnotatorsRef ar)
Reads the ITS attributes for terminology.- Parameters:
marker- the marker where to set the informationar- the current annotators references (can be null).
-
fetchUnresolvedITSGroups
public void fetchUnresolvedITSGroups(IWithITSAttributes parent)
Tries to resolve any un-resolved reference to ITS stand-off group.- Parameters:
parent- the object where the attribute(s) referencing the stand-off group is.
-
readAnnotatorsRef
public AnnotatorsRef readAnnotatorsRef(boolean local, AnnotatorsRef parentAR)
Reads the annotatorsRef attribute from the current element.- Parameters:
local- true to use the local namespace, false to use ITS prefix.parentAR- optional parent values to inherit (can be null).- Returns:
- the
AnnotatorsRefobject read, or null if none was present.
-
-