commit a4718d3c3f5e2b8b2b603537298ef68c0ad60d4b
Author: dsorber <david.sorber@gmail.com>
Date:   Sat Sep 20 16:55:32 2014 -0400

    Created simple script to total up the output files for each instance of the key_classify.py script.

diff --git a/software/key_classify/total.py b/software/key_classify/total.py
new file mode 100644
index 0000000..7398653
--- /dev/null
+++ b/software/key_classify/total.py
@@ -0,0 +1,42 @@
+import os
+import sys
+
+def main():
+	# NOTE: Developed with Python 3.4
+	# Validate the input
+	if len(sys.argv) < 2:
+		print('\nERROR: Not enough arguments provided!')
+		print('\nUSAGE: total.py <output directory>\n')
+		return -1
+
+	path = sys.argv[1]
+	
+	# Iterate over each output file
+	total_counts = {}
+	for filename in os.listdir(path):
+		full_path = os.path.join(path, filename)
+		print(full_path)
+
+		# Iterate over the contents of each output file and parse the index 
+		# and counts
+		with open(full_path, 'r') as output_file:
+			for line in output_file:
+				if not line or line.startswith('Parsing'):
+					continue
+
+				index, count = line.split(' ')
+				index = int(index)
+				count = int(count)
+
+				if index not in total_counts:
+					total_counts[index] = count
+				else:
+					total_counts[index] += count
+
+	# After building the histogram print out the results
+	print('Usage: {:d}'.format(len(total_counts)))
+	for index in sorted(total_counts.keys()):
+		print(index, total_counts[index])
+
+if __name__ == '__main__':
+	sys.exit(main())
\ No newline at end of file
