public class Match extends java.lang.Object implements IWithExtElements, IWithExtAttributes, IWithMetadata, IWithStore
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_TYPE
Default value for the
type attribute of <match>. |
static java.lang.String |
ELEM_MTC_MATCH |
static java.lang.String |
MATCH_REF_PREFIX |
| Constructor and Description |
|---|
Match()
Creates a new empty
Match object. |
Match(Match original)
Copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
static Match |
annotate(Fragment fragment,
int start,
int end,
Match match)
Tries to reuse an existing
mtc:match annotation to add a given match. |
java.lang.String |
getAnnotatorRef()
Gets the ITS annotator reference for this match.
|
ExtAttributes |
getExtAttributes()
Gets the
ExtAttributes object for the parent object. |
java.lang.String |
getExtAttributeValue(java.lang.String namespaceURI,
java.lang.String localName)
Gets the value for a given extension attribute.
|
ExtElements |
getExtElements()
Gets the
ExtElements object associated with this object. |
java.lang.String |
getId()
Gets the id for this match.
|
java.lang.Double |
getMatchQuality()
Gets the quality for this match.
|
java.lang.Double |
getMatchSuitability()
Gets the suitability for this match.
|
Metadata |
getMetadata()
Gets the
Metadata object for the parent, creates an empty of if there is none. |
java.lang.Double |
getMTConfidence()
Gets the ITS MT Confidence for this match.
|
java.lang.String |
getOrigin()
Gets the origin for this match.
|
java.lang.String |
getRef()
Gets the ref for this match.
|
java.lang.Double |
getSimilarity()
Gets the similarity value for this match
|
Fragment |
getSource()
Gets the source fragment for this match.
|
Directionality |
getSourceDir() |
Store |
getStore()
Gets the
Store object associated with this match. |
java.lang.String |
getSubType()
Gets the subType for this match.
|
Fragment |
getTarget()
Gets the target fragment for this match.
|
Directionality |
getTargetDir() |
java.lang.String |
getType()
Gets the type for this match.
|
boolean |
hasExtAttribute()
Indicates if at least one extension attribute is present.
|
boolean |
hasExtElements()
Indicates if there is a
ExtElements object associated with this object. |
boolean |
hasMetadata()
Indicates if the object has metadata.
|
boolean |
isIdUsed(java.lang.String id)
|
boolean |
isReference()
Gets the reference for this match.
|
void |
setAnnoatorRef(java.lang.String annotatorRef)
Sets the the ITS annotator reference for this match.
|
void |
setExtAttributes(ExtAttributes attributes)
Sets the
ExtAttributes object associated with this object. |
ExtElements |
setExtElements(ExtElements elements)
Sets the
ExtElements object associated with this object. |
void |
setId(java.lang.String id)
Sets the id for this match.
|
void |
setMatchQuality(java.lang.Double matchQuality)
Sets the quality for this match.
|
void |
setMatchSuitability(java.lang.Double matchSuitability)
Sets the suitability for this match.
|
void |
setMetadata(Metadata metadata)
sets the
Metadata object for the parent. |
void |
setMTConfidence(java.lang.Double mtConfidence)
Sets the ITS MT Confidence for this match.
|
void |
setOrigin(java.lang.String origin)
Sets the origin for this match.
|
void |
setRef(java.lang.String ref)
Sets the ref for this match.
|
void |
setReference(boolean reference)
Sets the reference for this match.
|
void |
setSimilarity(java.lang.Double similarity)
Sets the similarity value for this match.
|
void |
setSource(Fragment source)
Sets the source fragment for this match.
|
void |
setSourceDir(Directionality dir) |
void |
setSubType(java.lang.String subType)
Sets the subType for this match.
|
void |
setTarget(Fragment target)
Sets the target fragment for this match.
|
void |
setTargetDir(Directionality dir) |
void |
setType(java.lang.String type)
Sets the type for this match.
|
public static final java.lang.String ELEM_MTC_MATCH
public static final java.lang.String MATCH_REF_PREFIX
public static final java.lang.String DEFAULT_TYPE
type attribute of <match>.public Match()
Match object.public Match(Match original)
original - the original object to duplicate.public static Match annotate(Fragment fragment, int start, int end, Match match)
mtc:match annotation to add a given match.
If no existing annotation is found for the given span, one is created.
The ref attribute of the match is set to the id of the annotation,
and the match object is added to the list of matches for the unit.fragment - the fragment to annotate.start - the start position (in the coded text)end - the position just after the last character of the span (in the coded text).
You can use -1 to indicate the end of the fragment.match - the Match to set with the annotation.public Store getStore()
Store object associated with this match.getStore in interface IWithStorepublic java.lang.String getId()
public void setId(java.lang.String id)
id - the new id to set (can be null).public java.lang.String getType()
public void setType(java.lang.String type)
type - the type to set (Use null to set the default (DEFAULT_TYPE)).public java.lang.String getSubType()
public void setSubType(java.lang.String subType)
subType - the new subType to set (can be null).public java.lang.Double getSimilarity()
public void setSimilarity(java.lang.Double similarity)
similarity - the new similarity value to set (between 0.0 and 100.0 or can be null).public java.lang.Double getMatchQuality()
getMTConfidence()public void setMatchQuality(java.lang.Double matchQuality)
matchQuality - the new quality to set (between 0.0 and 100.0 or can be null).setMTConfidence(Double)public java.lang.Double getMatchSuitability()
public void setMatchSuitability(java.lang.Double matchSuitability)
matchSuitability - the new suitability to set (between 0.0 and 100.0 or can be null).public java.lang.String getRef()
public void setRef(java.lang.String ref)
ref - the new ref value to set (an IRI or can be null)public java.lang.String getOrigin()
public void setOrigin(java.lang.String origin)
origin - the new origin value for this match (can be null).public boolean isReference()
public void setReference(boolean reference)
reference - the new reference value for this match.public Fragment getSource()
public void setSource(Fragment source)
source - the new source fragment for this match.public Fragment getTarget()
public void setTarget(Fragment target)
target - the new target fragment for this match.public ExtElements getExtElements()
IWithExtElementsExtElements object associated with this object.
If none exists one is created.getExtElements in interface IWithExtElementsExtElements object associated with this object. If none exists one is created.public boolean hasExtElements()
IWithExtElementsExtElements object associated with this object.hasExtElements in interface IWithExtElementsExtElements object associated with this object,
false otherwise.public ExtElements setExtElements(ExtElements elements)
IWithExtElementsExtElements object associated with this object.setExtElements in interface IWithExtElementselements - the ExtElements object associated with this object.
If null, a new ExtElements object is created.ExtElements object associated with this object, never null.public boolean isIdUsed(java.lang.String id)
IWithStoreisIdUsed in interface IWithStoreid - the id value to lookup.public Directionality getSourceDir()
getSourceDir in interface IWithStorepublic void setSourceDir(Directionality dir)
setSourceDir in interface IWithStorepublic Directionality getTargetDir()
getTargetDir in interface IWithStorepublic void setTargetDir(Directionality dir)
setTargetDir in interface IWithStorepublic void setExtAttributes(ExtAttributes attributes)
IWithExtAttributesExtAttributes object associated with this object.setExtAttributes in interface IWithExtAttributesattributes - the ExtAttributes object associated with this object.
If null, a new ExtAttributes object is created.public ExtAttributes getExtAttributes()
IWithExtAttributesExtAttributes object for the parent object.
If none exists, one is created.getExtAttributes in interface IWithExtAttributesExtAttributes object for the parent object, never null.public boolean hasExtAttribute()
IWithExtAttributeshasExtAttribute in interface IWithExtAttributespublic java.lang.String getExtAttributeValue(java.lang.String namespaceURI,
java.lang.String localName)
IWithExtAttributesgetExtAttributeValue in interface IWithExtAttributesnamespaceURI - the URI of the namespace for the attribute.localName - the name of the attribute.public java.lang.String getAnnotatorRef()
public void setAnnoatorRef(java.lang.String annotatorRef)
annotatorRef - the new ITS annotator reference (can be null).public java.lang.Double getMTConfidence()
getMatchQuality() divided by 100.0.getMatchQuality()public void setMTConfidence(java.lang.Double mtConfidence)
getMatchQuality() divided by 100.0.mtConfidence - the new MT Confidence value to set (can be null).setMatchQuality(Double)public boolean hasMetadata()
IWithMetadatahasMetadata in interface IWithMetadatapublic Metadata getMetadata()
IWithMetadataMetadata object for the parent, creates an empty of if there is none.getMetadata in interface IWithMetadataMetadata object for the parent (can be empty, but never null).public void setMetadata(Metadata metadata)
IWithMetadataMetadata object for the parent.setMetadata in interface IWithMetadatametadata - the new Metadata object for the parent.