from aligned_textgrid import SequencePoint, SequencePointTier
point_a = SequencePoint((0,"a"))
point_b = SequencePoint((1, "b"))
point_tier = SequencePointTier([point_a, point_b])
print(point_tier)Sequence Point tier of SequencePoint;
points.tiers.SequencePointTier(self, tier=[], entry_class=None)
A SequencePointTier class
SequencePointTiers have all the same methods and attributes as TierMixins and WithinMixins
| Name | Type | Description | Default |
|---|---|---|---|
tier |
list[Point] | list[SequencePoint] | PointTier | Self |
A list of SequencePoints, or another SequencePointTier | [] |
entry_class |
Type[SequencePoint] | A SequencePoint subclass | None |
| Name | Type | Description |
|---|---|---|
| entry_class | Type[SequencePoint] | The class of entries within the tier |
| name | str | The name of the tier |
| times | np.array | The times of points in the tier |
| labels | list[str, …] | The labels of points in the tier |
| xmin | float | The time of the first point in the tier |
| xmax | float | The time of the last point in the tier |
| [] | float | Indexable and iterable |
| Name | Description |
|---|---|
| get_nearest_point | Returns nearest point |
| get_nearest_point_index | Returns the index of the closest point to time |
| return_tier | Returns SequencePointTier as a praatio PointTier |
| save_as_tg | Saves the current point tier as a textgrid |
points.tiers.SequencePointTier.get_nearest_point(time)
Returns nearest point
| Name | Type | Description | Default |
|---|---|---|---|
time |
float | time at which to get the nearest point | required |
| Type | Description |
|---|---|
| SequencePoint | the nearest point to time |
points.tiers.SequencePointTier.get_nearest_point_index(time)
Returns the index of the closest point to time
| Name | Type | Description | Default |
|---|---|---|---|
time |
float | The time at which to get the nearest point | required |
| Type | Description |
|---|---|
| int | The index of the nearest point within the tier |
points.tiers.SequencePointTier.return_tier(name=None)
Returns SequencePointTier as a praatio PointTier
| Type | Description |
|---|---|
PointTier |
A praatio point tier |
points.tiers.SequencePointTier.save_as_tg(save_path)
Saves the current point tier as a textgrid
| Name | Type | Description | Default |
|---|---|---|---|
save_path |
str | path to where you want to save the textgrid. | required |