#include <OCDM.h>
Public Member Functions | |
OCDM_Document () | |
This is a null constructor of an OCDM_Document Object. The purpose of this function is to create a null document, just to be used for programming reasons. | |
OCDM_Document (const char *TclCmdName) | |
This function servers as the main constructor of an OCDM_Document object. | |
OCDM_Document (const class OCDM_Document &obj) | |
This is the default copy constructor. | |
OCDM_Document (const Tcl_Obj *TclCmdName) | |
This function servers as the main constructor of an OCDM_Document object. | |
OCDM_Document (const CDM_Document) | |
A constructor that maps a CDM_Document to an OCDM_Document object. | |
~OCDM_Document () | |
This is the destructor of an OCDM_document object. | |
void | Close (void) |
This method will remove a Document from memory.. | |
OCDM_Document & | operator= (const class OCDM_Document &obj) |
This is the default Assignment operator. | |
void | storeObject (const class OCDM_Object *objPtr) const |
void | storeObject (const class OCDM_Collection *objPtr) const |
const class OCDM_Object * | getStoredObject (void) const |
void | releaseStoredObject (void) const |
long | AddAnnotation (const OCDM_Annotation &Ann) |
OCDM_REF (OCDM_AnnotationSet) AnnotationsAt(const long position) const | |
OCDM_REF (OCDM_AnnotationSet) AnnotationsContaining(const long position) const | |
OCDM_REF (OCDM_AnnotationSet) AnnotationsContaining(const long position1 | |
OCDM_REF (OCDM_AnnotationSet) AnnotationsInRange(const long Start | |
OCDM_REF (OCDM_AnnotationSet) AnnotationsInRange(const OCDM_Annotation &Ann) const | |
OCDM_REF (OCDM_AnnotationSet) AnnotationsMatchingRange(const long Start | |
OCDM_REF (OCDM_AnnotationSet) AnnotationsMatchingRange(const OCDM_Annotation &Ann) const | |
OCDM_BOOL | AttributeExists (const char *name) const |
This function will return true if an Attribute with the specified name exists in the Document object. | |
int | DisplaceAnnotations (long offset, long displacement) |
OCDM_REF (OCDM_Annotation) FirstAnnotationContaining(const long Position) const | |
OCDM_REF (OCDM_Annotation) FirstAnnotationContaining(const long Position1 | |
OCDM_REF (OCDM_RawDataSet) GetAnnotatedTextRanges(const OCDM_Annotation &Ann) const | |
OCDM_REF (OCDM_Annotation) GetAnnotation(const long Id) const | |
OCDM_REF (OCDM_Attribute) GetAttribute(const char *name) const | |
OCDM_REF (OCDM_AttributeSet) GetAttributes(void) const | |
OCDM_REF (OCDM_ByteSequence) GetFirstAnnotatedTextRange(const OCDM_Annotation &Ann) const | |
OCDM_REF (OCDM_AnnotationSet) NextAnnotations(const long Position) const | |
int | PutAttribute (const OCDM_Attribute &Attr) |
This function will add a given Attribute to the specified Document object. | |
int | RemoveAnnotation (const long Id) |
As the name implies this function will remove the Annotation object that has as Id the value specified by the "Id" parameter. | |
const char * | GetId (void) const |
This function will return the Id of the Document object in use. | |
int | RemoveAttribute (const char *name) |
This function will remove the Attribute named exactly as the "Name" parameter. | |
OCDM_REF (OCDM_AnnotationSet) SelectAnnotations(const char *Type) const | |
OCDM_REF (OCDM_AnnotationSet) SelectAnnotations(const char *Type | |
OCDM_REF (OCDM_AnnotationSet) SelectAnnotationsSorted(const char *Type) const | |
OCDM_REF (OCDM_AnnotationSet) SelectAnnotationsSorted(const char *Type | |
OCDM_REF (OCDM_ByteSequence) ByteSequenceInsertString(const long pos | |
OCDM_REF (OCDM_ByteSequence) ByteSequenceReplace(const long first | |
OCDM_REF (OCDM_ByteSequence) ByteSequenceReplaceCharacters(const long first | |
int | DeleteAnnotations (const char *Type) |
int | DeleteAnnotations (const char *Type, const char *Constraints) |
long | FindMaxUsedAnnotationId (void) const |
OCDM_REF (OCDM_AnnotationSet) GetAnnotations(void) const | |
OCDM_REF (OCDM_ByteSequence) GetByteSequence(void) const | |
const char * | GetByteSequence (const char *encoding) const |
const char * | GetEncoding (void) const |
const char * | GetExternalId (void) const |
OCDM_REF (OCDM_Annotation) GetFirstAnnotation(const char *Type) const | |
OCDM_REF (OCDM_Annotation) GetNextAnnotation(void) const | |
OCDM_REF (OCDM_Collection) GetParent(void) const | |
OCDM_REF (OCDM_RawData) GetRawData(void) const | |
const char * | GetRawData (const char *encoding) const |
int | SetByteSequence (const OCDM_ByteSequence &Text) |
This function will change the text of a Document object to the text specified by the "Text" parameter. | |
void | SetProcessStatus (const int value) const |
Updates the Percent Bar displayed when an Annotator runs... | |
const char * | SetEncoding (const char *encoding) |
const char * | SetExternalId (const char *ExternalId) |
This function will modify the external Id (XID) of the Document object in use. | |
OCDM_REF (OCDM_ByteSequence) Status(void) const | |
int | Sync (void) const |
This function will save the Document object in disk. | |
OCDM_REF (OCDM_RawData) RawDataReplace(const long first | |
OCDM_REF (OCDM_RawData) RawDataInsertString(const long pos | |
OCDM_REF (OCDM_RawData) RawDataReplaceCharacters(const long first | |
void | Log (const char *str,...) const |
This method logs information. It is equivalent to OCDM_Utilities::Log(). | |
OCDM_BOOL | Valid (void) const |
As the name implies this function checks for a valid Document. | |
const char * | toString (void) const |
Return object as a formatted string. | |
const char * | objectType (void) const |
Public Attributes | |
const long position2 | const |
const long End | const |
const long Position2 | const |
const char *Constraints | const |
const char *Constraints | const |
const char * | string |
const long | last |
const long const char * | newstring |
const long const char * | string |
const long const char * | newstring |
const char * | string |
const int | characters |
const int const char * | string |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
All Annotations will be seached. If Annotations having as type the first word are found, they are examined whether they contain an Attribute named as the second word. If such an Attribute is found in an Annotation and the OCDM_BOOLean expression is true for this Annotation, it will be deleted from the Annotation. The total number of deleted Attributes will be returned as the return value of this function. The OCDM_BOOLean expression that can be specified through the "Constraints" parameter will be evaluated before an Annotation or an Annotation Attribute is deleted. If the expression is true, then the deletion will be done. Else, this Annotation or Annotation Attribute will not be deleted. This expression can be any valid Tcl OCDM_BOOLean expression (i.e. a OCDM_BOOLean expression that will be accepted by the "expr" Tcl command), with the following excepion: The OCDM_BOOLean expression can contain references to the values of Atttributes of the Annotation, by utilising the notation "ann::<Attribute Name>". The only limitation is that "<Attribute Name>" cannot exceed 120 characters. For example, the following code will delete all Annotations from the specified Document that their type is token, they have a "type" Attribute which has as value "EFW" and also have a "pos" Attribute that has a value other than "NN": DeleteAnnotations("token", "ann::type == \"EFW\" && ann::pos != \"NN\""); If the value of the "Type" parameter is an empty string or NULL, then all Annotations will be searched for deletion, regardless their type. If the value of the "Constraints" parameter is an empty string or NULL, then the expression is ignored and the deletions will be based only on the value of the "Type" parameter. Note that if all Annotations are deleted from the Document object in use then the set of utilised Ids will also be reseted. As a result, the first Annotation that will be added to this Document after the deletion will take the value "0" as Annotation Id, if it does not already have an Id. If any deletion are done successfully, the total number of the deleted (or modified) Annotations will be returned. If this function fails to delete any Annotation or any Annotation Attribute, then the value "0" will be deleted. In case of an error, an exception of type OCDM_Exception will be thrown. |
|
If Annotations having as type the value of the "Type" parameter exist, then all these Annotations will be deleted from the Document. If the deletion is done successfully, the total number of the deleted Annotations will be returned. If all Annotations have been searched and no Annotation having as type the value of the "Type" parameter was found, the value of the "Type" parameter is examined whether it can be splitted in two words. If this is the case (the value of the "Type" parameter contains at least one space character), then the value is splitted in two parts on the first space character that is found. The first word will be used as an Annotation type and the rest of the value (second word) will be used as an Attribute name. All Annotations will be seached. If Annotations having as type the first word are found, they are examined whether they contain an Attribute named as the second word. If such an Attribute is found in an Annotation, it will be deleted from the Annotation. The total number of deleted Attributes will be returned as the return value of this function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|