Class UnitizingAnnotationUnit
java.lang.Object
org.dkpro.statistics.agreement.AnnotationUnit
org.dkpro.statistics.agreement.unitizing.UnitizingAnnotationUnit
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<IUnitizingAnnotationUnit>,IAnnotationUnit,IUnitizingAnnotationUnit
public class UnitizingAnnotationUnit extends AnnotationUnit implements IUnitizingAnnotationUnit
Default implementation of
IUnitizingAnnotationUnit holding the rater's index and the
category that the rater assigned to this unit as well as the position of the annotation unit
within the continuum of an annotation study. When using the default implementation, it is
recommended to use UnitizingAnnotationStudy.addUnit(long, long, int, Object) instead of
instantiating this type.- Author:
- Christian M. Meyer
- See Also:
UnitizingAnnotationStudy,IUnitizingAnnotationUnit, Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protectedUnitizingAnnotationUnit(long offset, long length, int raterIdx, java.lang.Object category)Initializes the unit with the given offset and length as well as the category assigned to the unit by the rater with the specified index. -
Method Summary
Modifier and Type Method Description intcompareTo(IUnitizingAnnotationUnit that)longgetEndOffset()Returns the right delimiter of the annotation unit (i.e., the end position of the identified segment).longgetLength()Returns the length of the annotation unit (i.e., the difference between the end and start position of the identified segment).longgetOffset()Returns the offset of the annotation unit (i.e., the start position of the identified segment).java.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.dkpro.statistics.agreement.IAnnotationUnit
getCategory, getRaterIdx
-
Field Details
-
Constructor Details
-
UnitizingAnnotationUnit
protected UnitizingAnnotationUnit(long offset, long length, int raterIdx, java.lang.Object category)Initializes the unit with the given offset and length as well as the category assigned to the unit by the rater with the specified index. Normally, the methodUnitizingAnnotationStudy.addUnit(long, long, int, Object)should be used to define the annotation units.
-
-
Method Details
-
getOffset
public long getOffset()Description copied from interface:IUnitizingAnnotationUnitReturns the offset of the annotation unit (i.e., the start position of the identified segment).- Specified by:
getOffsetin interfaceIUnitizingAnnotationUnit
-
getLength
public long getLength()Description copied from interface:IUnitizingAnnotationUnitReturns the length of the annotation unit (i.e., the difference between the end and start position of the identified segment).- Specified by:
getLengthin interfaceIUnitizingAnnotationUnit
-
getEndOffset
public long getEndOffset()Description copied from interface:IUnitizingAnnotationUnitReturns the right delimiter of the annotation unit (i.e., the end position of the identified segment). The method is a shorthand forIUnitizingAnnotationUnit.getOffset()+IUnitizingAnnotationUnit.getLength().- Specified by:
getEndOffsetin interfaceIUnitizingAnnotationUnit
-
compareTo
- Specified by:
compareToin interfacejava.lang.Comparable<IUnitizingAnnotationUnit>
-
toString
public java.lang.String toString()- Overrides:
toStringin classAnnotationUnit
-