src/cm/utils/comment_positioning.py
changeset 496 c3df46754007
parent 454 b7a092a52eae
child 497 b478eb3f1a0d
equal deleted inserted replaced
495:f86b611f1876 496:c3df46754007
    63         #    id, initial_start, initial_end, computed_start, computed_end, valid = self.computationResults[i]
    63         #    id, initial_start, initial_end, computed_start, computed_end, valid = self.computationResults[i]
    64 
    64 
    65     for cc in commentList:        
    65     for cc in commentList:        
    66         if cc.valid:
    66         if cc.valid:
    67             for id in xrange(len(span_starts_new.keys())):
    67             for id in xrange(len(span_starts_new.keys())):
    68                 start = span_starts_new.get(id)
    68                 if (span_starts_new.get(id)):
       
    69                 start = span_starts_new.get(id, 0)
    69                 end = span_starts_new.get(id+1, sys.maxint)
    70                 end = span_starts_new.get(id+1, sys.maxint)
       
    71                 if (not(start) and cc.computed_start_offset >= start and cc.computed_start_offset < end):
    70 
    72 
    71                 # adjust start                
    73                 # adjust start                
    72                 if cc.computed_start_offset >= start and cc.computed_start_offset < end:
    74                 if cc.computed_start_offset >= start and cc.computed_start_offset < end:
    73                     cc.start_wrapper = id
    75                     cc.start_wrapper = id
    74                     cc.start_offset = cc.computed_start_offset - start
    76                     cc.start_offset = cc.computed_start_offset - start