equal
deleted
inserted
replaced
64 line = line[5:] |
64 line = line[5:] |
65 for c in line: |
65 for c in line: |
66 counts[c] += 1 |
66 counts[c] += 1 |
67 for c in '\r/\n': |
67 for c in '\r/\n': |
68 counts.pop(c, None) |
68 counts.pop(c, None) |
69 t = sum(pycompat.itervalues(counts)) / 100.0 |
69 t = sum(counts.values()) / 100.0 |
70 fp.write('probtable = (') |
70 fp.write('probtable = (') |
71 for i, (k, v) in enumerate( |
71 for i, (k, v) in enumerate( |
72 sorted(counts.items(), key=lambda x: x[1], reverse=True) |
72 sorted(counts.items(), key=lambda x: x[1], reverse=True) |
73 ): |
73 ): |
74 if (i % 5) == 0: |
74 if (i % 5) == 0: |