@@ -0,0 +1,1767 @@
+import sys%0A%0Afrom pyspark import SparkContext, SparkConf%0Afrom petrarch2 import EventCoder%0A#from CameoEventCoder import CameoEventCoder %0A%0Adef map_articles(articleText):%0A    return articleText.encode('utf-8')%0A    %0A%0Adef code_articles(articleText):%0A     %0A    coder = EventCoder()%0A    #print articleText.encode('utf-8')%0A    events_map = coder.encode(articleText)%0A    #print events_map%0A    return str(events_map)%0A%0Aif __name__ == %22__main__%22:%0A    %0A  # create Spark context with Spark configuration%0A    conf = SparkConf().setAppName(%22Spark Petrarch2%22)%0A    sc = SparkContext(conf=conf)%0A    %0A    lines = %5B'%7B %22type%22 : %22story%22, %22doc_id%22 : %22nytasiapacific20160622.0002%22, %22head_line%22 : %22Lightning Ridge Journal: An Amateur Undertaking in Australian Mining Town With No Funeral Home%22, %22date_line%22 : %22Tue, 21 Jun 2016 03:52:15 GMT%22, %22sentences%22 : %7B%22array%22:%5B %7B %22sentence_id%22 : 1, %22sentence%22 : %22A Tunisian court has jailed a Nigerian student for two years for helping young militants join an armed Islamic group in Lebanon, his lawyer said Wednesday.%22, %22parse_sentence%22 : %22(ROOT (S (S (NP (DT A) (NNP Tunisian) (NN court)) (VP (VBZ has) (VP (VBN jailed) (NP (DT a) (NNP Nigerian) (NN student)) (PP (IN for) (NP (NP (CD two) (NNS years)) (PP (IN for) (S (VP (VBG helping) (S (NP (JJ young) (NNS militants)) (VP (VB join) (NP (DT an) (JJ armed) (JJ Islamic) (NN group)) (PP (IN in) (NP (NNP Lebanon))))))))))))) (, ,) (NP (PRP$ his) (NN lawyer)) (VP (VBD said) (NP (NNP Wednesday))) (. .)))%22 %7D %5D%7D, %22corref%22 : %22%22 %7D'%5D%0A        %0A    linesRDD = sc.parallelize(lines)%0A %0A    events_rdd = lines.map(map_articles)%0A    events_rdd.pprint(1)%0A    events_rdd = events_rdd.map(code_articles)%0A    events_rdd.pprint(1)%0A    %0A    events_rdd.saveAsTextFiles(%22hdfs://dmlhdpc10:9000/Events_SPEC%22, %22OUT%22)%0A%0A  %0A  %0A

TEST CODE ADDED