We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe69e31 commit 30fdd19Copy full SHA for 30fdd19
lib/corpus.py
@@ -166,6 +166,15 @@ def segments(self) -> Iterable[Segment]:
166
for sc in self.subcorpora:
167
yield from sc.segments()
168
169
+ def get_segment_by_name(self, name: str) -> Segment:
170
+ """
171
+ :return: the segment specified by its name
172
173
+ for seg in self.segments():
174
+ if seg.fullname() == name:
175
+ return seg
176
+ assert False, f"Segment '{name}' was not found in corpus"
177
+
178
def all_recordings(self) -> Iterable[Recording]:
179
yield from self.recordings
180
0 commit comments