Class Match

    • Constructor Detail

      • Match

        public Match()
        Creates a new empty Match object.
      • Match

        public Match​(Match original)
        Copy constructor
        Parameters:
        original - the original object to duplicate.
    • Method Detail

      • annotate

        public static Match annotate​(Fragment fragment,
                                     int start,
                                     int end,
                                     Match match)
        Tries to reuse an existing 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.
        Parameters:
        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.
        Returns:
        the match that was added.
      • getStore

        public Store getStore()
        Gets the Store object associated with this match.
        Specified by:
        getStore in interface IWithStore
        Returns:
        the store associated with this match (never null).
      • getId

        public String getId()
        Gets the id for this match.
        Returns:
        the id for this match (can be null).
      • setId

        public void setId​(String id)
        Sets the id for this match.
        Parameters:
        id - the new id to set (can be null).
      • getType

        public String getType()
        Gets the type for this match.
        Returns:
        the type for this match (never null).
      • setType

        public void setType​(String type)
        Sets the type for this match.
        Parameters:
        type - the type to set (Use null to set the default (DEFAULT_TYPE)).
      • getSubType

        public String getSubType()
        Gets the subType for this match.
        Returns:
        the subType for this match (can be null).
      • setSubType

        public void setSubType​(String subType)
        Sets the subType for this match.
        Parameters:
        subType - the new subType to set (can be null).
      • getSimilarity

        public Double getSimilarity()
        Gets the similarity value for this match
        Returns:
        the similarity value for this match (between 0.0 and 100.0 or can be null).
      • setSimilarity

        public void setSimilarity​(Double similarity)
        Sets the similarity value for this match.
        Parameters:
        similarity - the new similarity value to set (between 0.0 and 100.0 or can be null).
      • getMatchQuality

        public Double getMatchQuality()
        Gets the quality for this match.
        Returns:
        the quality for this match (between 0.0 and 100.0 or can be null).
        See Also:
        getMTConfidence()
      • setMatchQuality

        public void setMatchQuality​(Double matchQuality)
        Sets the quality for this match.
        Parameters:
        matchQuality - the new quality to set (between 0.0 and 100.0 or can be null).
        See Also:
        setMTConfidence(Double)
      • getMatchSuitability

        public Double getMatchSuitability()
        Gets the suitability for this match.
        Returns:
        the suitability for this match (between 0.0 and 100.0 or can be null).
      • setMatchSuitability

        public void setMatchSuitability​(Double matchSuitability)
        Sets the suitability for this match.
        Parameters:
        matchSuitability - the new suitability to set (between 0.0 and 100.0 or can be null).
      • getRef

        public String getRef()
        Gets the ref for this match.
        Returns:
        the ref for this match (an IRI or can be null)
      • setRef

        public void setRef​(String ref)
        Sets the ref for this match.
        Parameters:
        ref - the new ref value to set (an IRI or can be null)
      • getOrigin

        public String getOrigin()
        Gets the origin for this match.
        Returns:
        the origin for this match (can be null).
      • setOrigin

        public void setOrigin​(String origin)
        Sets the origin for this match.
        Parameters:
        origin - the new origin value for this match (can be null).
      • isReference

        public boolean isReference()
        Gets the reference for this match.
        Returns:
        the reference for this match.
      • setReference

        public void setReference​(boolean reference)
        Sets the reference for this match.
        Parameters:
        reference - the new reference value for this match.
      • getSource

        public Fragment getSource()
        Gets the source fragment for this match.
        Returns:
        the source fragment for this match.
      • setSource

        public void setSource​(Fragment source)
        Sets the source fragment for this match.
        Parameters:
        source - the new source fragment for this match.
      • getTarget

        public Fragment getTarget()
        Gets the target fragment for this match.
        Returns:
        the target fragment for this match.
      • setTarget

        public void setTarget​(Fragment target)
        Sets the target fragment for this match.
        Parameters:
        target - the new target fragment for this match.
      • isIdUsed

        public boolean isIdUsed​(String id)
        Description copied from interface: IWithStore
        Indicates if a given id value is already in use in the object (for a Part or for a Tag).
        Specified by:
        isIdUsed in interface IWithStore
        Parameters:
        id - the id value to lookup.
        Returns:
        true if the value is already used, false otherwise.
      • hasExtAttribute

        public boolean hasExtAttribute()
        Description copied from interface: IWithExtAttributes
        Indicates if at least one extension attribute is present.
        Specified by:
        hasExtAttribute in interface IWithExtAttributes
        Returns:
        true if at least one extension attribute is present; false otherwise.
      • getExtAttributeValue

        public String getExtAttributeValue​(String namespaceURI,
                                           String localName)
        Description copied from interface: IWithExtAttributes
        Gets the value for a given extension attribute.
        Specified by:
        getExtAttributeValue in interface IWithExtAttributes
        Parameters:
        namespaceURI - the URI of the namespace for the attribute.
        localName - the name of the attribute.
        Returns:
        the value of the extension attribute, or null if it does not exist.
      • getAnnotatorRef

        public String getAnnotatorRef()
        Gets the ITS annotator reference for this match.
        Returns:
        the ITS annotator reference for this match (can be null).
      • setAnnoatorRef

        public void setAnnoatorRef​(String annotatorRef)
        Sets the the ITS annotator reference for this match.
        Parameters:
        annotatorRef - the new ITS annotator reference (can be null).
      • hasMetadata

        public boolean hasMetadata()
        Description copied from interface: IWithMetadata
        Indicates if the object has metadata.
        Specified by:
        hasMetadata in interface IWithMetadata
        Returns:
        true if the object has metadata, false otherwise.
      • getMetadata

        public Metadata getMetadata()
        Description copied from interface: IWithMetadata
        Gets the Metadata object for the parent, creates an empty of if there is none.
        Specified by:
        getMetadata in interface IWithMetadata
        Returns:
        the Metadata object for the parent (can be empty, but never null).