galahad.server.annotations

Module Contents

Classes

Annotations

class galahad.server.annotations.Annotations(text: str)[source]
create_annotation(self, type_name, begin: int, end: int, features: Dict[str, Any] = None) galahad.server.dataclasses.Annotation[source]
static from_dict(text: str, annotations: Dict[str, List[galahad.server.dataclasses.Annotation]]) Annotations[source]
static from_document(document: galahad.server.dataclasses.Document) Annotations[source]
get_annotations(self) Dict[str, List[galahad.server.dataclasses.Annotation]][source]
get_covered_text(self, annotation: galahad.server.dataclasses.Annotation) str[source]
select(self, type_name: str) List[galahad.server.dataclasses.Annotation][source]
select_covered(self, type_name: str, covering_annotation: galahad.server.dataclasses.Annotation) List[galahad.server.dataclasses.Annotation][source]

Returns a list of covered annotations.

Return all annotations that are covered Only returns annotations that are fully covered, overlapping annotations are ignored.

Parameters
  • type_name – The type name of the annotations to be returned.

  • covering_annotation – The name of the annotation which covers.

Returns

A list of covered annotations

property text(self) str
to_dict(self) Dict[str, List[Dict[str, Any]]][source]