Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pierre-Alexandre Broux
s4dl
Commits
8f86d0ce
Commit
8f86d0ce
authored
Apr 26, 2018
by
Sulfyderz
Browse files
Test: ON
parent
34cfd385
Changes
1
Hide whitespace changes
Inline
Side-by-side
s4dl/Show.py
View file @
8f86d0ce
...
...
@@ -3862,6 +3862,7 @@ class Show(object):
# si 1 alors affectation + move bound si besoin/et ou create bound sur stop
# si > 1 alors affectation + move bound si besoin/et ou create bound sur stop + merge
else
:
print
(
"SAME IN:"
,
DiarTools
.
sameDiar
(
valueTmp
,
diarRef
))
# verifie que la valueRef ne se trouve pas recouvert par la tolerance
if
not
DiarTools
.
segmentExistsAccordingToTolerance
(
valueRef
,
tolerance
):
for
z
in
listHypRefSegment
:
...
...
@@ -3966,7 +3967,6 @@ class Show(object):
elif
tolerance
!=
0
and
y
[
'start'
]
>=
(
valueRef
[
'start'
]
-
tolerance
):
listIndexHypRefSegment
.
append
(
idx
)
print
(
"SAME IN:"
,
DiarTools
.
sameDiar
(
valueTmp
,
diarRef
))
for
idx
,
z
in
enumerate
(
listIndexHypRefSegment
):
# partie affectation
applyChange
=
False
...
...
@@ -3974,7 +3974,6 @@ class Show(object):
# si en presence d'un segment overlap et si la "not reassignment__overlapIntoAccount" est vrai alors on ne prend pas en compte les segments dans la réaffectation auto
if
not
reassignment__overlapIntoAccount
and
DiarTools
.
segmentWithinDiar
(
valueRef
,
diarOverlapArea
):
if
valueTmp
[
z
][
'cluster'
]
in
actionsAssignmentCreateThrBis
:
print
(
"BAD CREATE overlap"
)
dictionary
[
copy
.
deepcopy
(
valueRef
[
'cluster'
])]
=
'speakerManualOverlap'
+
str
(
cpt
+
1
)
actionsAssignmentCreateThrBis
.
append
(
'speakerManualOverlap'
+
str
(
cpt
+
1
))
actionsAssignmentCreateThr
.
append
([
copy
.
deepcopy
(
valueRef
[
'cluster'
]),
'speakerManualOverlap'
+
str
(
cpt
+
1
),
copy
.
deepcopy
(
valueTmp
[
z
])])
...
...
@@ -3983,7 +3982,6 @@ class Show(object):
applyChange
=
True
cpt
+=
1
else
:
print
(
"GOOD CREATE overlap"
)
dictionary
[
copy
.
deepcopy
(
valueRef
[
'cluster'
])]
=
copy
.
deepcopy
(
valueTmp
[
z
][
'cluster'
])
actionsAssignmentCreateThrBis
.
append
(
copy
.
deepcopy
(
valueTmp
[
z
][
'cluster'
]))
actionsAssignmentCreateThr
.
append
(
copy
.
deepcopy
([
valueRef
[
'cluster'
],
valueTmp
[
z
][
'cluster'
],
copy
.
deepcopy
(
valueTmp
[
z
])]))
...
...
@@ -3991,7 +3989,6 @@ class Show(object):
actionsIncrementalAssignmentCreateThrTurn
.
append
(
copy
.
deepcopy
([
valueRef
[
'cluster'
],
valueTmp
[
z
][
'cluster'
],
copy
.
deepcopy
(
valueTmp
[
z
])]))
else
:
if
valueTmp
[
z
][
'cluster'
]
in
actionsAssignmentCreateThrBis
:
print
(
"BAD CREATE"
)
valueTmpBis
=
valueTmp
if
not
reassignment__toleranceIntoAccount
:
...
...
@@ -4117,8 +4114,7 @@ class Show(object):
# MAJ du cluster vu qu'on a repris les segments checked initiaux sans changement du cluster en cours
valueTmp
[
z
][
'cluster'
]
=
clusterTmp
else
:
print
(
"GOOD CREATE"
)
dictionary
[
copy
.
deepcopy
(
valueRef
[
'cluster'
])]
=
copy
.
deepcopy
(
valueTmp
[
z
][
'cluster'
])
actionsAssignmentCreateThrBis
.
append
(
copy
.
deepcopy
(
valueTmp
[
z
][
'cluster'
]))
actionsAssignmentCreateThr
.
append
(
copy
.
deepcopy
([
valueRef
[
'cluster'
],
valueTmp
[
z
][
'cluster'
],
copy
.
deepcopy
(
valueTmp
[
z
])]))
...
...
@@ -4131,7 +4127,6 @@ class Show(object):
if
actionsIncremental
:
actionsIncrementalAssignmentNothingThrTurn
.
append
(
copy
.
deepcopy
(
valueTmp
[
z
]))
else
:
print
(
"CHANGE:"
,
valueTmp
[
z
][
'cluster'
],
dictionary
[
valueRef
[
'cluster'
]])
if
(
modeTranscriber
==
True
and
idx
==
0
)
or
(
modeTranscriber
==
False
):
actionsAssignmentChangeThr
.
append
(
copy
.
deepcopy
([
dictionary
[
valueRef
[
'cluster'
]],
valueTmp
[
z
]]))
if
actionsIncremental
:
...
...
@@ -4165,7 +4160,7 @@ class Show(object):
reassignment__thrValue
=
reassignment__thr
else
:
reassignment__thrValue
=
key
print
(
"2"
)
if
not
constrainedClustering
:
if
actionsTime
:
t1
=
time
.
time
()
...
...
@@ -4282,7 +4277,7 @@ class Show(object):
valueTmp
.
append_seg
(
segmentTmp
)
valueTmp
.
sort
()
print
(
"SAME OUT:"
,
DiarTools
.
sameDiar
(
valueTmp
,
diarRef
))
if
not
perfectBoundary
:
# recupere les segments nouveaux, modifiés par les etapes precedentes.
...
...
@@ -4385,6 +4380,7 @@ class Show(object):
if
actionsIncremental
:
actionsIncrementalSegmentationBoundaryMergeThrTurn
.
append
(
copy
.
deepcopy
([
newSegment
,
listTmp
[
y
]]))
newSegment
,
valueTmp
=
DiarTools
.
mergeSegment
(
newSegment
,
listTmp
[
y
],
valueTmp
)
print
(
"SAME OUT:"
,
DiarTools
.
sameDiar
(
valueTmp
,
diarRef
))
# MAJ diar
value
=
valueTmp
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment