Go to the previous, next section.

Annotation Manager

The annotation manager keeps track of the annotations that have been registered. For each annotation name, it records whether the annotation is flat or structured and whether it should be written to the output file. Additional information is stored for structured annotations.

The annotation manager is implemented in the files `aman.h' and `aman.cc'. The annote_def class is used to hold the annotation information. Each annote_def object records the information for annotations with a particular name (which can be accessed with the name method). As with the annotations themselves, the name in the annote_def is entered in the lexicon (see section Lexicon), except that in this case the annote_def constructor automatically makes sure that the name is in the lexicon.

The manager is implemented as a list of annote_def objects. This list is initialized by the init_aman function, which is automatically called when the library is initialized. The register_annote function adds an annote_def to the list. An error occurs if the name in the annote_def is already used in another registered annote_def. Rather than calling the register_annote function directly, use the ANNOTE and STRUCT_ANNOTE macros described below to enter new annotations.

The information in the manager can be retrieved using the lookup_annote function. Given an annotation name that is entered in the lexicon, lookup_annote searches the list of registered annotations and returns the annote_def corresponding to that name. If the name is not found, it returns NULL.

Go to the previous, next section.