points.points.SequencePoint(self, point=(None, None))
Sequence Points
Parameters
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)
)
Attributes
… |
|
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
distance_from
points.points.SequencePoint.distance_from(entry)
Distance from an entry
Parameters
entry |
Self | SequenceInterval |
A point or an interval to get the distance of the current point from |
required |
Returns
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
tier |
SequenceTier |
The sequence tier within which to look for a matching SequenceInterval |
None |
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
Returns
int |
The index of the SequenceInterval within which the point falls |