Comparison with the GATE API

Generally, the priority in the gatenlp package is to make the API pythonic, make use of Python features (e.g. keyword arguments) and use names that are easy to remember and easy to understand when completion in an IDE is used.

In the Jave GATE API, many functions are overloaded (e.g. AnnotationSet.get) and return different things depending on the type of parameter(s). In the Python API, the method name should make it clear what gets returned, unless it is clear or easy to assume.

Also, most methods related to a kind of object are directly available through the instance or class, e.g. in the Java GATE API, to create or load a document one has to call a method of the Factory, to save a document one has to find the correct Exporter class and call their method and so on. In Python gatenlp all these actions are performed by methods on the class or instance.

Documents:

There is no support or equivalent implementation for the following GATE features and functionality in gatenlp:

There is no support or equivalent for the following GateNLP functions in GATE:

Here is a comparison of the most important API methods related to documents, showing first the GATE method, then the corresponding Python method (if any) and/or remarks:

Features:

Setting a feature:

Getting a feature:

Annotations:

The main differences and properties are:

Here is a comparison of the most important API methods related to annotations, showing first the GATE method, then the corresponding Python method (if any) and/or remarks:

Python also has iscovering(annorsetorrange) and isinside(offset)

GATE methods getEndNode(), getStartNode() are not needed in Python.

AnnotationSet