Commits

Erik Wognsen  committed dae6c65

Changes for readability

  • Participants
  • Parent commits 1277c8b

Comments (0)

Files changed (1)

 # Process
 text = ''.join(sys.stdin.readlines()).lower()
 dig_count_map = {
-		letter0 + letter1 : text.count(letter0 + letter1)
+		(letter0 + letter1) : text.count(letter0 + letter1)
 		for letter0 in ALPHABET
 		for letter1 in ALPHABET
 		if letter0 != letter1}
 
 max_count = max(dig_count_map.values())
-width_count = len(str(max_count)) + 1
-width_rank = len(str(len(ALPHABET) ** 2))
+count_width = len(str(max_count)) + 1
+rank_width = len(str(len(ALPHABET) ** 2))
 threshold = 0
 # nonzero_counts = [v for v in dig_count_map.values() if v > 0]
 # avg_nonzero_count = sum(nonzero_counts) / len(nonzero_counts)
 			else:
 				n = dig_count_map[letter1 + letter2]
 				out = n if n > threshold else ''
-		print(str(out).rjust(width_count), end='')
+		print(str(out).rjust(count_width), end='')
 	print()
 print()
 
 	indices_dvorak =  get_finger_indices(dig, FINGERS_DVORAK)
 	indices_qwerty =  get_finger_indices(dig, FINGERS_QWERTY)
 
-	handing = ''.join('L' if index in range(4) else 'R' for index in indices_colemak)
+	# handing = ''.join('L' if index in range(4) else 'R' for index in indices_colemak)
 
 	print('',
-			str(rank + 1).rjust(width_rank),
+			str(rank + 1).rjust(rank_width),
 			dig,
 			# '   ' * handing.count('R') + handing + '   ' * handing.count('L'),
 			'=C=' if eq(*indices_colemak) else '   ',
 			'=D=' if eq(*indices_dvorak)  else '   ',
 			'=Q=' if eq(*indices_qwerty)  else '   ',
-			str(count).rjust(width_count),
+			str(count).rjust(count_width),
 			'#' * int(count / max_count * BAR_GRAPH_WIDTH),
 			sep='   ')
 print()