python-gatenlp icon indicating copy to clipboard operation
python-gatenlp copied to clipboard

Create class hierarchy for AnnotationSet

Open johann-petrak opened this issue 3 years ago • 0 comments

Consider:

  • AnnotationSet is an abstract base class
  • DetachedAnnotationSet is the class used for detached sets
  • AttachedAnnotationSet is the class used for in-document sets

We could just use the API we have now for AnnotationSet for both, but ideally refactor:

  • anything related to logging is only in AttachedSet
  • constructor only possible for DetachedSet

Advantages:

  • easier to see with print etc. what set we are dealing with
  • clearer what each type of set can do
  • can be used with type hinting to document which methods return which sets

johann-petrak avatar Nov 26 '21 08:11 johann-petrak