File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 11# CHANGELOG
22
3+ ## Version 6.0.1 (2025-09-16)
4+
5+ - feat: add ` Annotation.__iter__ ` (turn: Segment, speaker: str) iterator
6+
37## Version 6.0.0 (2025-09-09)
48
59- BREAKING: drop support to ` Python ` < 3.10
Original file line number Diff line number Diff line change 22Changelog
33#########
44
5+ Version 6.0.1 (2025-09-16)
6+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
7+
8+ - feat: add `Annotation.__iter__ ` (turn: Segment, speaker: str) iterator
9+
510Version 6.0.0 (2025-09-09)
611~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
712
Original file line number Diff line number Diff line change @@ -247,6 +247,18 @@ def __bool__(self):
247247 """
248248 return len (self ._tracks ) > 0
249249
250+ def __iter__ (self ) -> Iterator [Tuple [Segment , Label ]]:
251+ """Iterate over (segment, label) pairs in chronological order
252+
253+ Examples
254+ --------
255+
256+ >>> for segment, label in annotation:
257+ ... # do something with the segment and its label
258+ """
259+ for segment , _ , label in self .itertracks (yield_label = True ):
260+ yield segment , label
261+
250262 def itersegments (self ):
251263 """Iterate over segments (in chronological order)
252264
You can’t perform that action at this time.
0 commit comments