commit d9380ab9ddada6886a52b05a2b568d3895a0fad2
Author: dsorber <david.sorber@gmail.com>
Date:   Thu Aug 28 22:08:10 2014 -0400

    Adding a new project the term frequency simulator which will be used to simulate our term freqeuncy approach and measure various statistics.

diff --git a/software/term_freq_sim/simulator.py b/software/term_freq_sim/simulator.py
new file mode 100644
index 0000000..d63c6aa
--- /dev/null
+++ b/software/term_freq_sim/simulator.py
@@ -0,0 +1,45 @@
+import sys
+
+from lxml import etree
+
+MEDIA_WIKI_NAMESPACE = 'http://www.mediawiki.org/xml/export-0.8/'
+
+def main():
+
+	# Validate the input
+	if len(sys.argv) < 2:
+		print '\nERROR: Not enough arguments provided!'
+		print '\nUSAGE: simulator.py <xml input file>\n'
+		return -1
+
+	# Attempt to open the input file
+	try:
+		xml_file = open(sys.argv[1], 'r')
+	except IOError:
+		print '\nERROR: unable to open file "{:s}"'.format(sys.argv[1])
+		return -2
+
+	# Parse the input file into an ElementTree
+	tree = etree.parse(xml_file)
+	xml_file.close()
+	root = tree.getroot()
+
+	# Get all article titles
+	# tree.xpath('//w:page/w:title/text()', 
+	# 		   namespaces={'w': 'http://www.mediawiki.org/xml/export-0.8/'})
+
+	# Get article text
+	article_text = tree.xpath('(//w:page/w:revision/w:text/text())[130]', 
+			   				  namespaces={'w': MEDIA_WIKI_NAMESPACE})
+
+	# print len(article_text)
+	# print article_text
+
+	word_list = [word for word in article_text[0].split()]
+
+	for word in word_list:
+		print word
+
+
+if __name__ == '__main__':
+	sys.exit(main())
\ No newline at end of file
