from aligned_textgrid import SequenceInterval, Word, SequenceTier
the = Word((0,1, "the"))
dog = Word((0,1,"dog"))
word_tier = SequenceTier([the, dog])
print(word_tier)Sequence tier of Word; .superset_class: Top_wp; .subset_class: Phone
sequences.tiers.SequenceTier(self, tier=SequenceList(), entry_class=None)
A sequence tier
Given a praatio IntervalTier or list of Intervals, creates entry_class instances for every interval.
In addition to the attributes and methods described below, the attributes and methods from TierMixins and WithinMixins are also available.
| Name | Type | Description | Default |
|---|---|---|---|
tier |
list[Interval] | list[SequenceInterval] | IntervalTier | Self |
A list of interval entries. Defaults to SequenceList(). |
SequenceList() |
entry_class |
Type[SequenceInterval] | The sequence class for this tier. Defaults to SequenceInterval. | None |
| Name | Type | Description |
|---|---|---|
| sequence_list | SequenceList[SequenceInterval] | A SequenceList of intervals in the tier. |
| entry_class | Type[SequenceInterval] | The entry class of the tier |
| superset_class | Type[SequenceInterval] | The superset class of the tier |
| subset_class | Type[SequenceInterval] | The subset class of the tier |
| starts | np.ndarray[np.float64] | An array of start times for all intervals |
| ends | np.ndarray[np.float64] | An array of end times for all intervals |
| labels | list[str] | A list of the labels of all intervals |
| xmin | float | The minimum start time of the tier |
| xmax | float | The minumum end time of the tier |
| name | str | The name of the tier |
| [] | Indexable. Returns a SequenceInterval | |
| Iterable |
| Name | Description |
|---|---|
| cleanup | Insert empty intervals where there are gaps in the existing tier. |
| get_interval_at_time | Gets interval index at specified time |
| pop | Pop an interval |
| return_tier | Returns a praatio interval tier |
| save_as_tg | Saves as a textgrid |
sequences.tiers.SequenceTier.cleanup()
Insert empty intervals where there are gaps in the existing tier.
sequences.tiers.SequenceTier.get_interval_at_time(time)
Gets interval index at specified time
| Name | Type | Description | Default |
|---|---|---|---|
time |
float | time at which to get an interval | required |
| Type | Description |
|---|---|
| int | Index of the interval |
sequences.tiers.SequenceTier.pop(entry)
Pop an interval
| Name | Type | Description | Default |
|---|---|---|---|
entry |
SequenceInterval | Interval to pop | required |
sequences.tiers.SequenceTier.return_tier(name=None)
Returns a praatio interval tier
| Type | Description |
|---|---|
praatio.data_classes.interval_tier.IntervalTier |
A praatio interval tier. Useful for saving results back as a Praat TextGrid. |
sequences.tiers.SequenceTier.save_as_tg(save_path)
Saves as a textgrid
Uses praatio.data_classes.textgrid.Textgrid.save() method.
| Name | Type | Description | Default |
|---|---|---|---|
save_path |
str | Output path | required |