bvd757 commited on
Commit
3b1b881
·
1 Parent(s): 4c1a4df
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -54,10 +54,10 @@ def check_text(text, tool):
54
  errors = sorted(errors, key=lambda x: x['end'])
55
 
56
  shift = 0
57
- for i, error in errors:
58
  error['start'] += shift
59
  error['end'] += shift
60
- inp = f"({len(errors) - i})"
61
  text = text[:error['end']] + inp + text[error['end']:]
62
  shift += len(inp)
63
 
 
54
  errors = sorted(errors, key=lambda x: x['end'])
55
 
56
  shift = 0
57
+ for i, error in enumerate(errors):
58
  error['start'] += shift
59
  error['end'] += shift
60
+ inp = f"({i + 1})"
61
  text = text[:error['end']] + inp + text[error['end']:]
62
  shift += len(inp)
63