Jython Annotator
The Jython Layer Manager allows annotations to be generated by executing a script written in Python.
The script is executed for each transcript, with a variable called transcript which stores the transcript's Annotation Graph. transcript can be traversed to inspect annotations, and can have annotations added to it (on this layer only), which will be saved back to LaBB-CAT's annotation store when the script completes.
The transcript variable is populated with annotations from the layers that are ticked on the panel to the right of the script. Only those layers will be available to the script, no other layers are loaded.
The script might look something like the following, which tags each word with its length:
# for each turn in the transcript for turn in transcript.all("turns"): if annotator.cancelling: break # cancelled by the user # for each word for word in turn.all("word"): # tag the word with it's length word.createTag(thisLayer.id, "length: " + str(len(word.label))) log("Tagged word: " + word.label)