Commit b95c728c authored by Sulfyderz's avatar Sulfyderz
Browse files

[Error Update]:Deleting useless Boundary Create action in the automaton methods from diar_tools.

parent 83a82e57
......@@ -505,9 +505,10 @@ def automatonSegmentation(diarHyp,diarRef,diarUem=None,tolerance=0,modeNoGap=Fal
for z in listHypRefSegment:
# We cut if boundary not ok to stay in the reference segment
if z['stop']>(valueRef['stop']+tolerance):
actionsSegmentationBoundaryCreate.append(copy.deepcopy([z,valueRef['stop']]))
actionsIncrementalSegmentationBoundaryCreateTurn.append(copy.deepcopy([z,valueRef['stop']]))
valueTmp=splitSegment(z,valueTmp,valueRef['stop'])
if not z['start']>=(valueRef['stop']-tolerance):
actionsSegmentationBoundaryCreate.append(copy.deepcopy([z,valueRef['stop']]))
actionsIncrementalSegmentationBoundaryCreateTurn.append(copy.deepcopy([z,valueRef['stop']]))
valueTmp=splitSegment(z,valueTmp,valueRef['stop'])
if tolerance!=0:
valueTmp2=copy.deepcopy(valueTmp)
for u in valueTmp2:
......@@ -594,7 +595,8 @@ def automatonSegmentation(diarHyp,diarRef,diarUem=None,tolerance=0,modeNoGap=Fal
if tolerance==0:
listHypRefSegment.append(y)
elif tolerance!=0 and y['start']>=(valueRef['start']-tolerance):
listHypRefSegment.append(y)
if not y['start']>=(valueRef['stop']-tolerance):
listHypRefSegment.append(y)
# Replaces the segments which are not in the correct cluster
if modeNoGap == False:
replaced=False
......@@ -620,7 +622,8 @@ def automatonSegmentation(diarHyp,diarRef,diarUem=None,tolerance=0,modeNoGap=Fal
if tolerance==0:
listTmp.append(y)
elif tolerance!=0 and y['start']>=(valueRef['start']-tolerance):
listTmp.append(y)
if not y['start']>=(valueRef['stop']-tolerance):
listTmp.append(y)
if not (not deleteBoundarySameConsecutiveSpk and listTmp[0]['cluster']==listTmp[1]['cluster']):
actionsSegmentationBoundaryMerge.append(copy.deepcopy([listTmp[0],listTmp[1]]))
actionsIncrementalSegmentationBoundaryMergeTurn.append(copy.deepcopy([listTmp[0],listTmp[1]]))
......@@ -1033,9 +1036,10 @@ def automatonSegmentationAssignment(diarHyp,diarRef,diarUem=None,tolerance=0,mod
for z in listHypRefSegment:
# We cut if boundary not ok to stay in the reference segment
if z['stop']>(valueRef['stop']+tolerance):
actionsSegmentationBoundaryCreate.append(copy.deepcopy([z,valueRef['stop']]))
actionsIncrementalSegmentationBoundaryCreateTurn.append(copy.deepcopy([z,valueRef['stop']]))
valueTmp=splitSegment(z,valueTmp,valueRef['stop'])
if not z['start']>=(valueRef['stop']-tolerance):
actionsSegmentationBoundaryCreate.append(copy.deepcopy([z,valueRef['stop']]))
actionsIncrementalSegmentationBoundaryCreateTurn.append(copy.deepcopy([z,valueRef['stop']]))
valueTmp=splitSegment(z,valueTmp,valueRef['stop'])
if tolerance!=0:
valueTmp2=copy.deepcopy(valueTmp)
for u in valueTmp2:
......@@ -1107,7 +1111,8 @@ def automatonSegmentationAssignment(diarHyp,diarRef,diarUem=None,tolerance=0,mod
if tolerance==0:
listHypRefSegment.append(y)
elif tolerance!=0 and y['start']>=(valueRef['start']-tolerance):
listHypRefSegment.append(y)
if not y['start']>=(valueRef['stop']-tolerance):
listHypRefSegment.append(y)
# Merges among them if > 1
if len(listHypRefSegment)>1:
# Gets the new segments, modified by the previous steps
......@@ -1117,7 +1122,8 @@ def automatonSegmentationAssignment(diarHyp,diarRef,diarUem=None,tolerance=0,mod
if tolerance==0:
listTmp.append(y)
elif tolerance!=0 and y['start']>=(valueRef['start']-tolerance):
listTmp.append(y)
if not y['start']>=(valueRef['stop']-tolerance):
listTmp.append(y)
if not (not deleteBoundarySameConsecutiveSpk and listTmp[0]['cluster']==listTmp[1]['cluster'] and valueRef['cluster'] in dictionary and listTmp[1]['cluster']==dictionary[valueRef['cluster']]):
actionsSegmentationBoundaryMerge.append(copy.deepcopy([listTmp[0],listTmp[1]]))
actionsIncrementalSegmentationBoundaryMergeTurn.append(copy.deepcopy([listTmp[0],listTmp[1]]))
......@@ -1149,7 +1155,8 @@ def automatonSegmentationAssignment(diarHyp,diarRef,diarUem=None,tolerance=0,mod
if tolerance==0:
listHypRefSegment.append(y)
elif tolerance!=0 and y['start']>=(valueRef['start']-tolerance):
listHypRefSegment.append(y)
if not y['start']>=(valueRef['stop']-tolerance):
listHypRefSegment.append(y)
for idx,z in enumerate(listHypRefSegment):
# Affectation part
applyChange=False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment