PGAnnotationType

class polyglotdb.io.types.standardized.PGAnnotationType(name)[source]

Methods

__init__(name) Initialize self.
add(annotation) adds annotation to PGAnnotationType object
lookup(timepoint[, speaker]) Searches the lookup_dict for a particular begin time, and optionally a speaker
lookup_range(begin, end[, speaker]) Searches the lookup_dict for objects between begin time, end time, and optionally a speaker
optimize_lookups() optimizes the lookup dictionary
add(annotation)[source]

adds annotation to PGAnnotationType object

Parameters:
annotation :class: `~polyglotdb.io.types.BaseAnnotation`

the annotation to add

lookup(timepoint, speaker=None)[source]

Searches the lookup_dict for a particular begin time, and optionally a speaker

Parameters:
timepoint : double

the begin of the desired linguistic object

speaker : str

Defaults to None

lookup_range(begin, end, speaker=None)[source]

Searches the lookup_dict for objects between begin time, end time, and optionally a speaker

Parameters:
begin : double

the lower bound of the range

end : double

the upper bound of the range

speaker : str

Defaults to None

optimize_lookups()[source]

optimizes the lookup dictionary

speakers

Gets the speakers from a PGAnnotationType object

Returns:
speakers : set

a set of speakers