SequencePointTier

points.tiers.SequencePointTier(self, tier=[], entry_class=None)

A SequencePointTier class

SequencePointTiers have all the same methods and attributes as TierMixins and WithinMixins

Parameters

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

Examples

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;
print(point_tier.sequence_list)
[Class SequencePoint, label: a; tier_index: 0, Class SequencePoint, label: b; tier_index: 1]

Attributes

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

Methods

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

get_nearest_point

points.tiers.SequencePointTier.get_nearest_point(time)

Returns nearest point

Parameters

Name Type Description Default
time float time at which to get the nearest point required

Returns

Type Description
SequencePoint the nearest point to time

get_nearest_point_index

points.tiers.SequencePointTier.get_nearest_point_index(time)

Returns the index of the closest point to time

Parameters

Name Type Description Default
time float The time at which to get the nearest point required

Returns

Type Description
int The index of the nearest point within the tier

return_tier

points.tiers.SequencePointTier.return_tier()

Returns SequencePointTier as a praatio PointTier

Returns

Type Description
PointTier A praatio point tier

save_as_tg

points.tiers.SequencePointTier.save_as_tg(save_path)

Saves the current point tier as a textgrid

Parameters

Name Type Description Default
save_path str path to where you want to save the textgrid. required

Reuse

GPLv3