from pyannote.core import *

"""
Explanation: Documentation for pyannote.core
Install
pyannote.core package can be installed the easy way:
bash
$ pip install pyannote.core
Adding support for Jupyter/IPython Notebook graphical representations is as easy as:
bash
$ pip install pyannote.core[notebook]
Available data structures
End of explanation
"""


segment = Segment(start=0, end=10)
segment

"""
Explanation: Segment (pyannote.core.segment)
End of explanation
"""


timeline = Timeline([Segment(1, 5), Segment(6, 8), Segment(12, 18), Segment(7, 20)])
timeline

"""
Explanation: Timeline (pyannote.core.timeline)
End of explanation
"""


annotation = Annotation()
annotation[Segment(1, 5)] = 'John'
annotation[Segment(6, 8)] = 'Jack'
annotation[Segment(12, 18)] = 'John'
annotation[Segment(7, 20)] = 'Alice'
annotation

"""
Explanation: Annotation (pyannote.core.annotation)
End of explanation
"""


transcription = Transcription()
transcription.add_edge(T(1), T(5), speech='Hi Jack', speaker='John')
transcription.add_edge(T(5), T(6))
transcription.add_edge(T(6), T(8), speech='Hello John', speaker='Jack')
transcription.add_edge(T(1), T(8), summary='Jack meets John')
transcription

"""
Explanation: Transcription (pyannote.core.transcription)
End of explanation
"""


# one 4-dimensional feature vector extracted every 100ms from a 200ms window
frame = SlidingWindow(start=0.0, step=0.100, duration=0.200)
data = np.random.randn(100, 4)
features = SlidingWindowFeature(data, frame)

features.crop(Segment(2, 3))

"""
Explanation: Feature (pyannote.core.feature)
End of explanation
"""


scores = Scores()
scores[Segment(3, 5), '_', 'Penny'] = 0.8
scores[Segment(3, 5), '_', 'Leonard'] = 0.15
scores[Segment(3, 5), '_', 'Sheldon'] = 0.05
scores[Segment(5.5, 7), '_', 'Penny'] = 0.4
scores[Segment(5.5, 7), '_', 'Leonard'] = 0.5
scores[Segment(5.5, 7), '_', 'Sheldon'] = 0.1
scores[Segment(8, 10), '_', 'Penny'] = 0.4
scores[Segment(8, 10), '_', 'Leonard'] = 0.25
scores[Segment(8, 10), '_', 'Sheldon'] = 0.35
scores

"""
Explanation: Scores (pyannote.core.scores)
End of explanation
"""


