From: Karim Hamidou Date: Tue, 9 Feb 2016 04:48:33 +0000 (-0800) Subject: a basic script to build an index. X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=f96096341c30d92c3740b362ee9d5ef1439b24a2;p=rfcspot.git a basic script to build an index. --- 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() +