GateNLP / gate-core

The GATE Embedded core API and GATE Developer application
GNU Lesser General Public License v3.0
75 stars 29 forks source link

All the get methods in gate.Utils should return immutable sets #88

Closed greenwoodma closed 5 years ago

greenwoodma commented 5 years ago

All the get methods on AnnotationSet return instances of ImmutableAnnotationSetImpl to force you to modify annotations via the main original document annotation set. Some of the methods on gate.Utils do the same when they simply delegate, but if they create a new set they don't make it immutable. This can result in some weird cases where you can some times modify a set and some times not.

My feeling is that all the methods on gate.Utils that return an AnnotationSet should be consistent and return an ImmutableAnnotationSetImpl