From f96096341c30d92c3740b362ee9d5ef1439b24a2 Mon Sep 17 00:00:00 2001 From: Karim Hamidou Date: Mon, 8 Feb 2016 20:48:33 -0800 Subject: [PATCH] a basic script to build an index. --- src/build-index.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/build-index.py diff --git a/src/build-index.py b/src/build-index.py new file mode 100644 index 00000000..76bbd599 --- /dev/null +++ b/src/build-index.py @@ -0,0 +1,26 @@ +# This script reads a stackoverflow post archive +# and creates a table of questions related to RFCs. +# Stages: 1. build table of questions +# 2. Go through every question & answer to find RFC references +# 3. Link the question and the RFC number together +# 4. Dump the result to a file. +import sys +import lxml +from collections import defaultdict + +questions_table = defaultdict([]) + +xml_tree = None +def load_posts_file(filename): + global xml_tree + + +def main(): + if len(sys.argv) != 2: + print "usage: build-index Posts.xml" + + load_posts_file(sys.argv[1]) + +if __name__ == '__main__': + main() + -- 2.43.0