Commit bba89c53 authored by Sulfyderz's avatar Sulfyderz
Browse files

[Error Update]:Correcting useless boundary create action.

parent 4eeb5d83
......@@ -1379,10 +1379,13 @@ class Show(object):
for z in listHypRefSegment:
# on coupe si frontiere pas ok pour rester que dans le segment de reference
if z['stop']>(valueRef['stop']+tolerance):
actionsSegmentationBoundaryCreateThr.append(copy.deepcopy([z,valueRef['stop']]))
if actionsIncremental:
actionsIncrementalSegmentationBoundaryCreateThrTurn.append(copy.deepcopy([z,valueRef['stop']]))
valueTmp=DiarTools.splitSegment(z,valueTmp,valueRef['stop'])
#NEW LALA
if not z['start']>=(valueRef['stop']-tolerance):
#NEW LALA
actionsSegmentationBoundaryCreateThr.append(copy.deepcopy([z,valueRef['stop']]))
if actionsIncremental:
actionsIncrementalSegmentationBoundaryCreateThrTurn.append(copy.deepcopy([z,valueRef['stop']]))
valueTmp=DiarTools.splitSegment(z,valueTmp,valueRef['stop'])
if tolerance!=0:
valueTmp2=copy.deepcopy(valueTmp)
......@@ -1480,7 +1483,10 @@ class Show(object):
if tolerance==0:
listHypRefSegment.append(y)
elif tolerance!=0 and y['start']>=(valueRef['start']-tolerance):
listHypRefSegment.append(y)
#NEW LALA
if not y['start']>=(valueRef['stop']-tolerance):
#NEW LALA
listHypRefSegment.append(y)
# remplace les segments qui n'ont pas le bon cluster
if modeTranscriber == False:
......@@ -2275,10 +2281,13 @@ class Show(object):
for z in listHypRefSegment:
# on coupe si frontiere pas ok pour rester que dans le segment de reference
if z['stop']>(valueRef['stop']+tolerance):
actionsSegmentationBoundaryCreateThr.append(copy.deepcopy([z,valueRef['stop']]))
if actionsIncremental:
actionsIncrementalSegmentationBoundaryCreateThrTurn.append(copy.deepcopy([z,valueRef['stop']]))
valueTmp=DiarTools.splitSegment(z,valueTmp,valueRef['stop'])
#NEW LALA
if not z['start']>=(valueRef['stop']-tolerance):
#NEW LALA
actionsSegmentationBoundaryCreateThr.append(copy.deepcopy([z,valueRef['stop']]))
if actionsIncremental:
actionsIncrementalSegmentationBoundaryCreateThrTurn.append(copy.deepcopy([z,valueRef['stop']]))
valueTmp=DiarTools.splitSegment(z,valueTmp,valueRef['stop'])
# Enleve les segments compris dans la marge tolérance (+ ou - tolérance)
if tolerance!=0:
......@@ -2291,13 +2300,16 @@ class Show(object):
break
# recupere les indices des segments nouveaux, modifiés par les etapes precedentes.
listIndexHypRefSegment=list()
for idx,y in enumerate(valueTmp):
if Segment.intersection(y,valueRef) is not None:
if tolerance==0:
listIndexHypRefSegment.append(idx)
elif tolerance!=0 and y['start']>=(valueRef['start']-tolerance):
listIndexHypRefSegment.append(idx)
#listIndexHypRefSegment=list()
#for idx,y in enumerate(valueTmp):
# if Segment.intersection(y,valueRef) is not None:
# if tolerance==0:
# listIndexHypRefSegment.append(idx)
# elif tolerance!=0 and y['start']>=(valueRef['start']-tolerance):
# #NEW LALA
# if not y['start']>=(valueRef['stop']-tolerance):
# #NEW LALA
# listIndexHypRefSegment.append(idx)
if not perfectBoundary:
# recupere les segments nouveaux, modifiés par les etapes precedentes.
......@@ -2385,7 +2397,10 @@ class Show(object):
if tolerance==0:
listHypRefSegment.append(y)
elif tolerance!=0 and y['start']>=(valueRef['start']-tolerance):
listHypRefSegment.append(y)
#NEW LALA
if not y['start']>=(valueRef['stop']-tolerance):
#NEW LALA
listHypRefSegment.append(y)
# remplace les segments qui n'ont pas le bon cluster
if modeTranscriber == False:
......@@ -2994,10 +3009,13 @@ class Show(object):
for z in listHypRefSegment:
# on coupe si frontiere pas ok pour rester que dans le segment de reference
if z['stop']>(valueRef['stop']+tolerance):
actionsSegmentationBoundaryCreateThr.append(copy.deepcopy([z,valueRef['stop']]))
if actionsIncremental:
actionsIncrementalSegmentationBoundaryCreateThrTurn.append(copy.deepcopy([z,valueRef['stop']]))
valueTmp=DiarTools.splitSegment(z,valueTmp,valueRef['stop'])
#NEW LALA
if not z['start']>=(valueRef['stop']-tolerance):
#NEW LALA
actionsSegmentationBoundaryCreateThr.append(copy.deepcopy([z,valueRef['stop']]))
if actionsIncremental:
actionsIncrementalSegmentationBoundaryCreateThrTurn.append(copy.deepcopy([z,valueRef['stop']]))
valueTmp=DiarTools.splitSegment(z,valueTmp,valueRef['stop'])
if tolerance!=0:
valueTmp2=copy.deepcopy(valueTmp)
......@@ -3078,7 +3096,10 @@ class Show(object):
if tolerance==0:
listHypRefSegment.append(y)
elif tolerance!=0 and y['start']>=(valueRef['start']-tolerance):
listHypRefSegment.append(y)
#NEW LALA
if not y['start']>=(valueRef['stop']-tolerance):
#NEW LALA
listHypRefSegment.append(y)
# fusionne entre eux si >1
if len(listHypRefSegment)>1:
......@@ -3124,7 +3145,10 @@ class Show(object):
if tolerance==0:
listHypRefSegment.append(y)
elif tolerance!=0 and y['start']>=(valueRef['start']-tolerance):
listHypRefSegment.append(y)
#NEW LALA
if not y['start']>=(valueRef['stop']-tolerance):
#NEW LALA
listHypRefSegment.append(y)
for idx,z in enumerate(listHypRefSegment):
# partie affectation
......
Supports Markdown
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