#include <OCDM.h>
Inheritance diagram for OCDM_Annotation:
Public Member Functions | |
OCDM_Annotation () | |
OCDM_Annotation (const CDM_Object obj) | |
OCDM_Annotation (const class OCDM_Annotation &obj) | |
OCDM_Annotation (const char *type, const OCDM_SpanSet &Spans, const OCDM_AttributeSet &Attributes) | |
OCDM_Annotation (const char *type, const long start, const long end, const OCDM_AttributeSet &Attributes) | |
OCDM_Annotation & | operator= (const class OCDM_Object &obj) |
This is the default assignment operator. | |
OCDM_BOOL | AnnotationContainsPosition (const long Position) const |
This function will check if the Annotation contains in any of its spans the specified position. | |
OCDM_BOOL | AnnotationMatchesRange (const long Start, const long End) const |
This function will check if the Annotation contains a span that has the specified start and end offsets. | |
OCDM_BOOL | AttributeExists (const char *name) const |
This function will return true if an Attribute with the specified name exists in the Annotation object. | |
int | CompareAnnotations (const OCDM_Annotation &Ann) const |
This function will compare the Annotation in use and the Annotation defined. | |
void | DisplaceAnnotation (const long offset, const long displacement) |
This function displases or "moves" the specified Annotation by "displacement" characters. | |
OCDM_REF (OCDM_Attribute) GetAttribute(const char *name) const | |
OCDM_REF (OCDM_AttributeSet) GetAttributes(void) const | |
OCDM_REF (OCDM_Span) GetFirstSpan(void) const | |
int | GetFirstSpanOffsets (long &start, long &end) const |
OCDM_REF (OCDM_SpanSet) GetSpans(void) const | |
void | PutAttribute (const OCDM_Attribute &Attr) |
This function adds a new Attribute in the Annotation object we are currently use. | |
const char * | GetType (void) const |
void | ReconstructAnnotation (void) const |
This function will construct a new Annotation object an replace the Annotation object in use with the new one. | |
void | RemoveAttribute (const char *name) |
This function will remove the Attribute having as name the value of the "Name" parameter from the Annotation object in use, if such an Attribute exists. | |
void | AddSpan (const OCDM_Span &span) |
void | RemoveSpan (const long start, const long end) |
long | GetId (void) const |
This function will return the Id of the Annotation object in use. | |
const char * | objectType (void) const |
OCDM_Annotation | ( | ) |
OCDM_Annotation | ( | const CDM_Object | obj | ) |
OCDM_Annotation | ( | const class OCDM_Annotation & | obj | ) |
OCDM_Annotation | ( | const char * | type, | |
const OCDM_SpanSet & | Spans, | |||
const OCDM_AttributeSet & | Attributes | |||
) |
/brief This is the constructor function fo the OCDM_Annotation class.
type:
Annotation types are textual values that are used to classify annotations into categories Spans:
This is a set of pairs of two byte offsets that denote the range(s) of the annotated textual data. Attributes:
These attributes usually contain the necessary linguistic information. OCDM_Annotation | ( | const char * | type, | |
const long | start, | |||
const long | end, | |||
const OCDM_AttributeSet & | Attributes | |||
) |
/brief This is the constructor function fo the OCDM_Annotation class.
type:
Annotation types are textual values that are used to classify annotations into categories start:
This is the start character offset to be placed in the Span of the Annotation. end:
This is the end character offset to be placed in the Span of the Annotation. Attributes:
These attributes usually contain the necessary linguistic information. (Can be also NULL)
class OCDM_Annotation& operator= | ( | const class OCDM_Object & | obj | ) | [virtual] |
obj:
the object to be copied. Reimplemented from OCDM_Object.
int AnnotationContainsPosition | ( | const long | Position | ) | const |
Position:
The position to me checked. int AnnotationMatchesRange | ( | const long | Start, | |
const long | End | |||
) | const |
Start:
The span start to me matched. End:
The span end to me matched. OCDM_BOOL AttributeExists | ( | const char * | name | ) | const |
name:
The Attribute name to be found.int CompareAnnotations | ( | const OCDM_Annotation & | Ann | ) | const |
Ann:
The Annotation to be compared with the annotation object in use.void DisplaceAnnotation | ( | const long | offset, | |
const long | displacement | |||
) |
offset:
The function checks whether any of this offsets is equal or greater than the value specified through the "offset" parameter, displacement:
If any of this offsets is equal or greater than the value specified through the "offset" parameter, then the value of the "displacement" parameter will be added to it. OCDM_REF | ( | OCDM_Attribute | ) | const |
OCDM_REF | ( | OCDM_AttributeSet | ) | const |
OCDM_REF | ( | OCDM_Span | ) | const |
int GetFirstSpanOffsets | ( | long & | start, | |
long & | end | |||
) | const |
OCDM_REF | ( | OCDM_SpanSet | ) | const |
void PutAttribute | ( | const OCDM_Attribute & | Attr | ) |
Attr:
The new attribute to be added to the Annotation object we are currently use const char * GetType | ( | void | ) | const |
void ReconstructAnnotation | ( | void | ) | const |
void RemoveAttribute | ( | const char * | name | ) |
name:
The name of the attribute to be removed.void AddSpan | ( | const OCDM_Span & | span | ) |
span:
The Span object that should be added. void RemoveSpan | ( | const long | start, | |
const long | end | |||
) |
start:
The starting value of the span to be removed end:
The ending value of the span to be removed long GetId | ( | void | ) | const |
const char* objectType | ( | void | ) | const [virtual] |
This method returns the type of the object as a string.
Reimplemented from OCDM_Object.