-
Notifications
You must be signed in to change notification settings - Fork 0
/
statistics.py
executable file
·35 lines (24 loc) · 1.09 KB
/
statistics.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python3
import sys
from readers.read_ape import ApeReader
FILE_PATH = sys.argv[1]
ape_reader = ApeReader(FILE_PATH)
print('Ocorrencias do erro: {}'.format(len(ape_reader.error_lines)))
cores = list()
for k in ape_reader.corrections:
flat = [sub[1] for sub in k]
cores.append(flat)
print('Nenhuma sugestao de correcao: {}'.format(
len([x for x in cores if len(x) < 2])))
print('Efetivamente avaliadas: {}'.format(
len([x for x in cores if 'red' in x or 'green' in x or 'yellow' in x])))
print('Pelo menos uma sugestao correta: {}'.format(
len([x for x in cores if 'green' in x])))
print('Pelo menos uma sugestao parcialmente correta: {}'.format(
len([x for x in cores if 'yellow' in x])))
print('Pelo menos uma sugestao parcialmente correta e nenhuma correta: {}'.format(
len([x for x in cores if 'yellow' in x and 'green' not in x])))
print('Pelo menos uma sugestao errada: {}'.format(
len([x for x in cores if 'red' in x])))
print('Todas as sugestoes erradas: {}'.format(
len([x for x in cores if 'red' in x and 'green' not in x and 'yellow' not in x])))