SequencePoint

points.points.SequencePoint(self, point=(None, None))

Sequence Points

Parameters

Name Type Description Default
point list | tuple | Point | Self A list or tuple of a time and label value. (None, None)

Examples

from aligned_textgrid import SequencePoint, SequenceInterval

first_point = SequencePoint((0, "first"))
print(first_point)
Class SequencePoint, label: first;
second_point = SequencePoint((1, "second"))
interval = SequenceInterval((0.5, 2, "word"))

print(
    first_point.distance_from(second_point)
)

print(
    first_point.distance_from(interval)
)
-1
[-0.5 -2. ]

Attributes

Name Type Description
All attributes and methods included in PrecedenceMixins and InTierMixins
time float Time value associated with the point.
label str Label associated with the point
intier SequencePointTier If the SequencePoint is within a tier, this accesses the tier.
fol SequencePoint If defined, the following SequencePoint within the same tier
prev SequencePoint If defined, the previous SequencePoint within the same tier.
fol_distance float If fol is defined, the difference between the current point and fol (should be >= 0)
prev_distance float if prev is defined, the difference between the current point and prev (should be <= 0).

Methods

Name Description
distance_from Distance from an entry
get_interval_at_point Get the SequenceInterval the current point falls within
get_interval_index_at_time Get the index of an interval at the point’s time

distance_from

points.points.SequencePoint.distance_from(entry)

Distance from an entry

Parameters

Name Type Description Default
entry Self | SequenceInterval A point or an interval to get the distance of the current point from required

Returns

Type Description
np.array a single value in the case of a point, a numpy array in the case of an interval.

get_interval_at_point

points.points.SequencePoint.get_interval_at_point(tier=None)

Get the SequenceInterval the current point falls within

Parameters

Name Type Description Default
tier SequenceTier The sequence tier within which to look for a matching SequenceInterval None

Returns

Type Description
SequenceInterval The SequenceInterval within which the current point falls

get_interval_index_at_time

points.points.SequencePoint.get_interval_index_at_time(tier=None)

Get the index of an interval at the point’s time

Parameters

Name Type Description Default
tier SequenceTier A SequenceTier. None

Returns

Type Description
int The index of the SequenceInterval within which the point falls

Reuse

GPLv3