Commits

remusao  committed 58d9d02

add a python version of topic extraction using numpy and scipy. Much simpler than the c++ version

  • Participants
  • Parent commits 4ed05db

Comments (0)

Files changed (11)

File pyxtraction/corpus.py

+
+import os
+from index import Index
+from document import Document
+from preprocessor import getTokens
+
+
+class Corpus:
+
+    def __init__(self, path):
+        # Store documents and their ids
+        self.doc2id = {}
+        self.id2doc = {}
+        self.nextId = 0
+
+        # Index of words
+        self.index = Index()
+
+        # path of the corpus
+        self.path = path
+
+        # Create the corpus from the directory
+        for f in os.listdir(path):
+            # Check that it's a regular file and the extension is .corpus
+            if not os.path.isdir(f) and 'corpus' in f.split('.'):
+                print('Reading document:', f)
+                abs_path = path + '/' + f
+                with open(abs_path) as doc:
+                    # Create document from Systran analyze
+                    newDoc = Document(f)
+
+                    # Update index
+                    for token in getTokens(doc):
+                        newDoc.addWord(self.index.addWord(token.getLemma()))
+
+                    # Save document
+                    self.doc2id[newDoc] = self.nextId
+                    self.id2doc[self.nextId] = newDoc
+                    self.nextId += 1
+
+
+    # Iterate on documents
+    def __iter__(self):
+        return (self.id2doc[i] for i in range(0, self.nextId))
+
+
+    def getDocument(self, id):
+        if id in self.id2doc:
+            return self.id2doc[id]
+        else:
+            return None
+
+
+    def getId(self, url):
+        if url in self.doc2id:
+            return self.doc2id[url]
+        else:
+            return None
+
+
+    def getNbTerms(self):
+        return self.index.getNbTerms()
+
+
+    def getNbDocuments(self):
+        return self.nextId

File pyxtraction/corpus/distance.corpus

+À	noun:acronym	à		à	nb=sg;human=0;modifies_another_noun=@2	0	1
+À Distance	noun:acronym *noun:common	à distance		{???}	nb=sg;human=0;agent_of_verb=@3	0	2
+Distance	noun:common	distance		distance	nb=sg;human=0;agent_of_verb=@3;governs_another_noun=@1	1	2
+is	verb:plain	be		être	agent_of_action=@2;linked_to_predicate=@6;modified_by_prep1=@7	2	3
+the	det	the		le	modifies_right_head=@6	3	4
+fifth	numeric	fifth		cinquième	modifies_right_head=@6	4	5
+album	noun:common	album		album	nb=sg;human=0;modified_on_left=@4;predadj_of=@3	5	6
+by	prep	by		par	dirobj=@9;govern=@9;governed_by=@3	6	7
+Canadian	adj	canadian		canadien	modifies_right_head=@9;semantic_modifier_of=@9	7	8
+Canadian singer	adj *noun:common	canadian singer		{???}	nb=sg;human=1;dirobj_of=@7;has_apposition=@10	7	9
+singer	noun:common	singer		chanteur	nb=sg;human=1;dirobj_of=@7;has_apposition=@10;modified_by_adj=@8;modified_on_left=@8	8	9
+Marie-Chantal Toupin	noun:propernoun	Marie-Chantal Toupin		Marie-Chantal Toupin	nb=sg;human=1;apposition_to=@9	9	10
+.	punct	.		.		10	11
+It	pron	it		$$$	antecedent=@6;object_of_verb=@14	11	12
+was	verb:plain	be		être		12	13
+released	verb:plain	release		sortir	modified_by_adverb=@15;modified_by_adverb=@15;object_of_action=@12	13	14
+on September 30, 2008	adv	on September 30, 2008		le 30 septembre 2008	modifies=@14	14	15
+.	punct	.		.		15	16
+---------------------------------------
++++++++++++++++++++++++++++++++++++++++
+Source	noun:common	source		source	nb=sg;human=0	0	1
+:	punct	:		:		1	2
+iTunes	noun:propernoun	iTunes		iTunes	nb=sg;human=0	2	3
+---------------------------------------
++++++++++++++++++++++++++++++++++++++++

File pyxtraction/corpus/is_for_gumshoe.corpus

+"	punct	"		"	closing_quote_ptr=@3;opening_quote_ptr=@1	0	1
+G	noun:acronym	g		g	nb=sg;human=0;agent_of_verb=@4;closing_quote_ptr=@3;opening_quote_ptr=@1	1	2
+"	punct	"		"	closing_quote_ptr=@3;opening_quote_ptr=@1	2	3
+Is	verb:plain	be		être	agent_of_action=@2;modified_by_prep1=@5	3	4
+for	prep	for		pour	dirobj=@6;govern=@6;governed_by=@4	4	5
+for Gumshoe	*prep noun:common	for gumshoe		{???}	governed_by=@4	4	6
+Gumshoe	noun:common	gumshoe		chaussure en caoutchouc	nb=sg;human=0;dirobj_of=@5	5	6
+is	verb:plain	be		être	linked_to_predicate=@10;previous_enum=@20	6	7
+the	det	the		le	modifies_right_head=@10	7	8
+seventh	numeric	seventh		septième	modifies_right_head=@10	8	9
+novel	noun:common	novel		roman	nb=sg;human=0;modified_by_prep1=@11;modified_on_left=@8;predadj_of=@7	9	10
+in	prep	in		en	dirobj=@16;govern=@16;governed_by=@10;possible_governed_by=@10;possible_governed_by=@4	10	11
+Sue Grafton's	noun:propernoun	Sue Grafton		Sue Grafton	nb=sg;human=1;modifies_another_noun=@14	11	12
+"	punct	"		"	closing_quote_ptr=@15;opening_quote_ptr=@13	12	13
+Alphabet	noun:common	alphabet		alphabet	nb=sg;human=0;closing_quote_ptr=@15;governs_another_noun=@12;modifies_another_noun=@16;opening_quote_ptr=@13	13	14
+"	punct	"		"	closing_quote_ptr=@15;opening_quote_ptr=@13	14	15
+series	noun:common	series		série	nb=sg;human=0;dirobj_of=@11;governs_another_noun=@14;modified_by_prep1=@17	15	16
+series of mystery novels	*noun:common prep noun:common	series of mystery novel		{???}	nb=sg;human=0;dirobj_of=@11;governs_another_noun=@14	15	18
+of	prep	of		$$$	dirobj=@18;govern=@18;governed_by=@16;possible_governed_by=@16;possible_governed_by=@4	16	17
+of mystery novels	*prep noun:common	of mystery novel		{???}	governed_by=@16;possible_governed_by=@16;possible_governed_by=@4	16	18
+mystery novels	noun:common	mystery novel		roman policier	nb=pl;human=0;dirobj_of=@17	17	18
+and	conj	and		et		18	19
+features	verb:plain	feature		comporter	agent_of_action=@2;dirobj=@21;govern=@21;next_enum=@7;object_of_action=@21	19	20
+Kinsey	noun:propernoun	Kinsey		kinsey	nb=sg;human=0;dirobj_of=@20;has_apposition=@22;object_of_verb=@20	20	21
+Millhone	noun:propernoun	Millhone		millhone	nb=sg;human=0;apposition_to=@21;has_apposition=@26	21	22
+,	punct	,		,		22	23
+a	det	a		un	modifies_right_head=@26	23	24
+private	adj	private		{???}	modifies_right_head=@26;semantic_modifier_of=@26	24	25
+private eye	adj *noun:common	private eye		détective	nb=sg;human=0;apposition_to=@22;modified_on_left=@24;modified_on_right=@27;object_of_verb=@27	24	26
+eye	noun:common	eye		{???}	nb=sg;human=0;apposition_to=@22;modified_by_adj=@25;modified_on_left=@24;modified_on_right=@27;object_of_verb=@27	25	26
+based	verb:pastpart	base		baser	modified_by_prep1=@28;modifies_left_head=@26;object_of_action=@26;semantic_modifier_of=@26	26	27
+in	prep	in		en	dirobj=@29;govern=@29;governed_by=@27;possible_governed_by=@27;possible_governed_by=@4	27	28
+Santa	noun:propernoun	Santa		Santa	nb=sg;human=1;dirobj_of=@28;has_apposition=@30	28	29
+Teresa	noun:propernoun	Teresa		Teresa	nb=sg;human=1;apposition_to=@29;has_apposition=@32	29	30
+,	punct	,		,		30	31
+California	noun:propernoun	California		Californie	nb=sg;human=0;apposition_to=@30	31	32
+.	punct	.		.		32	33
+---------------------------------------
++++++++++++++++++++++++++++++++++++++++
+In	prep	in		dans	dirobj=@3;govern=@3	0	1
+"	punct	"		"	closing_quote_ptr=@4;opening_quote_ptr=@2	1	2
+G	noun:acronym	g		g	nb=sg;human=0;closing_quote_ptr=@4;dirobj_of=@1;opening_quote_ptr=@2	2	3
+"	punct	"		"	closing_quote_ptr=@4;opening_quote_ptr=@2	3	4
+Is	verb:plain	be		être	modified_by_prep1=@6	4	5
+for	prep	for		pour	dirobj=@7;govern=@7;governed_by=@5	5	6
+for Gumshoe	*prep noun:common	for gumshoe		{???}	governed_by=@5	5	7
+Gumshoe	noun:common	gumshoe		chaussure en caoutchouc	nb=sg;human=0;dirobj_of=@6	6	7
+,	punct	,		,		7	8
+Kinsey	noun:propernoun	Kinsey		kinsey	nb=sg;human=0;agent_of_verb=@11;has_apposition=@10	8	9
+Kinsey Millhone	*noun:propernoun noun:propernoun	Kinsey Millhone		{???}	nb=sg;human=0;agent_of_verb=@11	8	10
+Millhone	noun:propernoun	Millhone		millhone	nb=sg;human=0;apposition_to=@9	9	10
+meets	verb:plain	meet		rencontrer	agent_of_action=@9;dirobj=@13;govern=@13;object_of_action=@13	10	11
+fellow	adj	fellow		semblable	modifies_right_head=@13;semantic_modifier_of=@13	11	12
+fellow investigator	adj *noun:common	fellow investigator		{???}	nb=sg;human=1;dirobj_of=@11;has_apposition=@14;object_of_verb=@11	11	13
+investigator	noun:common	investigator		investigateur	nb=sg;human=1;dirobj_of=@11;has_apposition=@14;modified_by_adj=@12;modified_on_left=@12;object_of_verb=@11	12	13
+Robert	noun:propernoun	Robert		Robert	nb=sg;human=1;apposition_to=@13;has_apposition=@15	13	14
+Dietz	noun:propernoun	Dietz		dietz	nb=sg;human=1;apposition_to=@14	14	15
+when	conj	when		quand		15	16
+someone	pron	someone		quelqu'un	agent_of_verb=@18;antecedent=@9	16	17
+hires	verb:plain	hire		engager	agent_of_action=@17;dirobj=@20;govern=@20;governs_nonfinite=@22;object_of_action=@20	17	18
+a	det	a		un	modifies_right_head=@20	18	19
+hit man	noun:common	hit man		tueur à gage	nb=sg;human=1;dirobj_of=@18;modified_on_left=@19;object_of_verb=@18	19	20
+to	part	to		pour		20	21
+kill	verb:inf	kill		tuer	agent_of_action=@17;dirobj=@23;govern=@23;nonfinite_governed_by=@18;object_of_action=@23	21	22
+her	pron	her		la	human=1;dirobj_of=@22;object_of_verb=@22	22	23
+.	punct	.		.	skip_end=@29	23	24
+While	conj	while		tandis que		24	25
+Kinsey	noun:propernoun	Kinsey		kinsey	nb=sg;human=0;object_of_verb=@29	25	26
+is	verb:plain	be		être		26	27
+being	verb:prespart	be		être		27	28
+stalked	verb:plain	stalk		égrapper	object_of_action=@26	28	29
+,	punct	,		,	skip_begin=@25	29	30
+she	pron	she		$$$	human=1	30	31
+uncovers	verb:plain	uncover		découvrir	dirobj=@35;govern=@35;object_of_action=@35	31	32
+an	det	an		un	modifies_right_head=@35	32	33
+unsolved	adj	unsolved		non résolu	modifies_right_head=@35;semantic_modifier_of=@35	33	34
+unsolved murder	adj *noun:common	unsolved murder		{???}	nb=sg;human=0;agent_of_verb=@37;antecedent_of_relpro=@36;dirobj_of=@32;modified_on_left=@33;object_of_verb=@32	33	35
+murder	noun:common	murder		meurtre	nb=sg;human=0;agent_of_verb=@37;antecedent_of_relpro=@36;dirobj_of=@32;modified_by_adj=@34;modified_on_left=@33;object_of_verb=@32	34	35
+that	pron	that		qui	antecedent=@35	35	36
+haunts	verb:plain	haunt		hanter	agent_of_action=@35;dirobj=@39;govern=@39;object_of_action=@39	36	37
+the	det	the		le	modifies_right_head=@39	37	38
+lives	noun:common	life		vie	nb=pl;human=0;dirobj_of=@37;modified_by_prep1=@40;modified_on_left=@38;object_of_verb=@37	38	39
+of	prep	of		$$$	dirobj=@49;govern=@49;governed_by=@39;possible_governed_by=@39;possible_governed_by=@37	39	40
+her	det	her		son	modifies_right_head=@49	40	41
+client	noun:common	client		client	nb=sg;human=1;modifies_another_noun=@47	41	42
+Mrs.	noun:common	mrs		Mme	nb=sg;human=1;governs_another_noun=@42;has_apposition=@44;modifies_another_noun=@49;previous_enum=@47	42	43
+Irene	noun:propernoun	Irene		Irène	nb=sg;human=1;apposition_to=@43;has_apposition=@45	43	44
+Gersh	noun:propernoun	Gersh		gersh	nb=sg;human=1;apposition_to=@44	44	45
+and	conj	and		et		45	46
+Irene's	noun:propernoun	Irene		Irène	nb=sg;human=1;governs_another_noun=@42;modifies_another_noun=@49;next_enum=@43	46	47
+"	punct	"		"	closing_quote_ptr=@50;opening_quote_ptr=@48	47	48
+mother	noun:common	mother		mère	nb=sg;human=1;agent_of_verb=@52;antecedent_of_relpro=@51;closing_quote_ptr=@50;dirobj_of=@40;governs_another_noun=@43;modified_on_left=@41;opening_quote_ptr=@48	48	49
+"	punct	"		"	closing_quote_ptr=@50;opening_quote_ptr=@48;skip_end=@75	49	50
+who	pron	who		qui	antecedent=@49	50	51
+uses	verb:plain	use		employer	agent_of_action=@49;dirobj=@54;govern=@54;modified_by_prep1=@69;object_of_action=@54	51	52
+the	det	the		le	modifies_right_head=@54	52	53
+alias	noun:common	alias		nom d'emprunt	nb=sg;human=0;dirobj_of=@52;has_apposition=@57;modified_on_left=@53;object_of_verb=@52	53	54
+"	punct	"		"	closing_quote_ptr=@58;opening_quote_ptr=@55	54	55
+Agnes	noun:propernoun	Agnes		Agnès	nb=sg;human=1;closing_quote_ptr=@58;modifies_another_noun=@57;opening_quote_ptr=@55	55	56
+Grey	noun:common	gray		gris	nb=sg;human=0;apposition_to=@54;closing_quote_ptr=@58;governs_another_noun=@56;opening_quote_ptr=@55	56	57
+"	punct	"		"	closing_quote_ptr=@58;opening_quote_ptr=@55;skip_end=@67	57	58
+(	punct	(		(		58	59
+the	det	the		le	modifies_right_head=@61	59	60
+title	noun:common	title		titre	nb=sg;human=0;modified_by_prep1=@62;modified_on_left=@60	60	61
+of	prep	of		$$$	dirobj=@66;govern=@66;governed_by=@61;possible_governed_by=@61	61	62
+an	det	an		un	modifies_right_head=@66	62	63
+Anne	noun:propernoun	Anne		Anne	nb=sg;human=1;has_apposition=@65;modifies_another_noun=@66	63	64
+Brontë	noun:propernoun	Brontë		brontë	nb=sg;human=1;apposition_to=@64	64	65
+novel	noun:common	novel		roman	nb=sg;human=0;dirobj_of=@62;governs_another_noun=@64;modified_on_left=@63	65	66
+)	punct	)		)		66	67
+.	punct	.		.	skip_begin=@59	67	68
+In	prep	in		dans	dirobj=@71;govern=@71;governed_by=@52	68	69
+other	det	other		autre	modifies_right_head=@71	69	70
+developments	noun:common	development		développement	nb=pl;human=0;dirobj_of=@69;modified_by_prep1=@72;modified_on_left=@70	70	71
+developments in Kinsey's personal story	*noun:common prep noun:propernoun adj noun:common	development in Kinsey's personal story		{???}	nb=pl;human=0;dirobj_of=@69;modified_on_left=@70	70	75
+in	prep	in		dans	dirobj=@75;govern=@75;governed_by=@71;possible_governed_by=@71;possible_governed_by=@52	71	72
+in Kinsey's personal story	*prep noun:propernoun adj noun:common	in Kinsey's personal story		{???}	governed_by=@71;possible_governed_by=@71;possible_governed_by=@52	71	75
+Kinsey's	noun:propernoun	Kinsey's		kinsey's	nb=sg;human=0;modifies_another_noun=@75	72	73
+Kinsey's personal story	noun:propernoun adj *noun:common	Kinsey's personal story		{???}	nb=sg;human=0;dirobj_of=@72	72	75
+personal	adj	personal		personnel	modifies_right_head=@75;semantic_modifier_of=@75	73	74
+personal story	adj *noun:common	personal story		{???}	nb=sg;human=0;dirobj_of=@72;governs_another_noun=@73	73	75
+story	noun:common	story		histoire	nb=sg;human=0;dirobj_of=@72;governs_another_noun=@73;modified_by_adj=@74;modified_on_left=@74	74	75
+,	punct	,		,	skip_begin=@51	75	76
+she	pron	she		$$$	human=1	76	77
+loses	verb:plain	lose		perdre	dirobj=@81;govern=@81;object_of_action=@81	77	78
+her	det	her		son	modifies_right_head=@81	78	79
+VW	noun:acronym	vw		VW	nb=sg;human=1;modifies_another_noun=@81	79	80
+VW car	noun:acronym *noun:common	vw car		{???}	nb=sg;human=0;dirobj_of=@78;modified_on_left=@79;object_of_verb=@78	79	81
+car	noun:common	car		voiture	nb=sg;human=0;dirobj_of=@78;governs_another_noun=@80;modified_on_left=@79;object_of_verb=@78	80	81
+,	punct	,		,		81	82
+and	conj	and		et		82	83
+her	det	her		son	modifies_right_head=@85	83	84
+friend	noun:common	friend		ami	nb=sg;human=1;agent_of_verb=@88;has_apposition=@86;modified_by_adj=@89;modified_on_left=@84	84	85
+Vera	noun:propernoun	Vera		Vera	nb=sg;human=1;apposition_to=@85;has_apposition=@87	85	86
+Lipton	noun:propernoun	Lipton		lipton	nb=sg;human=1;apposition_to=@86	86	87
+becomes	verb:plain	become		devenir	agent_of_action=@85;linked_to_predicate=@89	87	88
+engaged	verb:pastpart	engage		engager	predadj_of=@88;semantic_modifier_of=@85	88	89
+.	punct	.		.		89	90
+---------------------------------------
++++++++++++++++++++++++++++++++++++++++
+Three	numeric	three		trois	modifies_right_head=@2	0	1
+things	noun:common	thing		chose	nb=pl;human=0;agent_of_verb=@3;modified_on_left=@1	1	2
+happen	verb:plain	happen		{???}	agent_of_action=@2;modified_by_prep1=@4	2	3
+to	prep	to		{???}	dirobj=@5;govern=@5;governed_by=@3	3	4
+Kinsey	noun:propernoun	Kinsey		kinsey	nb=sg;human=0;dirobj_of=@4;has_apposition=@6;modified_by_prep1=@7	4	5
+Kinsey Millhone	*noun:propernoun noun:propernoun	Kinsey Millhone		{???}	nb=sg;human=0;dirobj_of=@4;modified_by_prep1=@7	4	6
+Millhone	noun:propernoun	Millhone		millhone	nb=sg;human=0;apposition_to=@5	5	6
+on	prep	on		sur	dirobj=@10;govern=@10;governed_by=@5;possible_governed_by=@5;possible_governed_by=@3	6	7
+her	det	her		son	modifies_right_head=@10	7	8
+thirty-third	numeric	thirty~third		trente-troisième	modifies_right_head=@10	8	9
+birthday	noun:common	birthday		anniversaire	nb=sg;human=0;dirobj_of=@7;modified_on_left=@8	9	10
+:	punct	:		:		10	11
+she	pron	she		$$$	human=1;agent_of_verb=@13	11	12
+moves	verb:plain	move		{???}	agent_of_action=@12;modified_by_prep1=@14	12	13
+into	prep	into		{???}	dirobj=@17;govern=@17;governed_by=@13	13	14
+her	det	her		son	modifies_right_head=@17	14	15
+remodelled	verb:pastpart	remodel		transformer	modifies_right_head=@17;object_of_action=@17;semantic_modifier_of=@17	15	16
+remodelled apartment	verb:pastpart *noun:common	remodel apartment		{???}	nb=sg;human=0;agent_of_verb=@22;antecedent_of_relpro=@19;dirobj_of=@14;modified_on_left=@15	15	17
+apartment	noun:common	apartment		appartement	nb=sg;human=0;agent_of_verb=@22;antecedent_of_relpro=@19;dirobj_of=@14;modified_by_adj=@16;modified_on_left=@15;object_of_verb=@16	16	17
+,	punct	,		,		17	18
+which	pron	which		qui	antecedent=@17	18	19
+has	verb:plain	have		avoir		19	20
+finally	adv	finally		final	modifies=@22	20	21
+been	verb:plain	be		être	agent_of_action=@17;linked_to_predicate=@25;modified_by_adverb=@21;modified_by_adverb=@21	21	22
+finished	verb:pastpart	finish		finir		22	23
+;	punct	;		;		23	24
+she	pron	she		$$$	human=1;predadj_of=@22	24	25
+is	verb:plain	be		être		25	26
+hired	verb:plain	hire		louer	agent_of_action=@29;governs_nonfinite=@49;modified_by_prep1=@28	26	27
+by	prep	by		par	dirobj=@29;govern=@29;governed_by=@27;possible_governed_by=@27;possible_governed_by=@22	27	28
+Irene	noun:propernoun	Irene		Irène	nb=sg;human=1;agent_of_verb=@27;dirobj_of=@28;has_apposition=@30	28	29
+Gersh	noun:propernoun	Gersh		gersh	nb=sg;human=1;apposition_to=@29;has_apposition=@36	29	30
+,	punct	,		,		30	31
+a	det	a		un	modifies_right_head=@36	31	32
+sickly	adj	sickly		maladif	modifies_right_head=@36;semantic_modifier_of=@36	32	33
+Santa	noun:propernoun	Santa		Santa	nb=sg;human=1;has_apposition=@35;modifies_another_noun=@36	33	34
+Theresa	noun:propernoun	Theresa		Theresa	nb=sg;human=1;apposition_to=@34	34	35
+resident	noun:common	resident		résident	nb=sg;human=1;apposition_to=@30;governs_another_noun=@34;modified_by_adj=@33;modified_on_left=@32	35	36
+,	punct	,		,		36	37
+to	part	to		pour		37	38
+head	verb:inf	head		{???}	modified_by_adverb=@40;modified_by_adverb=@40;modified_by_prep1=@41;modified_by_prep2=@44;nonfinite_governed_by=@27;previous_enum=@49	38	39
+out	adv	out		{???}	modifies=@39	39	40
+to	prep	to		$$$	dirobj=@43;govern=@43;governed_by=@39;possible_governed_by=@39;possible_governed_by=@22	40	41
+to the Slabs	*prep det noun:common	to the slab		{???}	governed_by=@39;possible_governed_by=@39;possible_governed_by=@22	40	43
+the	det	the		le	modifies_right_head=@43	41	42
+Slabs	noun:common	slab		dalle	nb=pl;human=0;dirobj_of=@41;modified_on_left=@42	42	43
+in	prep	in		dans	dirobj=@47;govern=@47;governed_by=@39;possible_governed_by=@39;possible_governed_by=@22	43	44
+in the Mojave Desert	*prep det noun:common noun:common	in the mojave desert		{???}	governed_by=@39;possible_governed_by=@39;possible_governed_by=@22	43	47
+the	det	the		le	modifies_right_head=@47	44	45
+Mojave	noun:common	mojave		{???}	nb=sg;human=0;modifies_another_noun=@47	45	46
+Mojave Desert	noun:common *noun:common	mojave desert		désert	nb=sg;human=0;dirobj_of=@44;modified_on_left=@45	45	47
+Desert	noun:common	desert		{???}	nb=sg;human=0;dirobj_of=@44;governs_another_noun=@46;modified_on_left=@45	46	47
+and	conj	and		et		47	48
+locate	verb:inf	locate		placer	dirobj=@51;govern=@51;next_enum=@39;nonfinite_governed_by=@27;object_of_action=@51	48	49
+her	det	her		son	modifies_right_head=@51	49	50
+mother	noun:common	mother		mère	nb=sg;human=1;dirobj_of=@49;modified_on_left=@50;object_of_verb=@49	50	51
+;	punct	;		;		51	52
+she	pron	she		$$$	human=1;agent_of_verb=@54	52	53
+gets	verb:plain	get		obtenir	agent_of_action=@53;dirobj=@56;govern=@56;object_of_action=@56	53	54
+the	det	the		le	modifies_right_head=@56	54	55
+news	noun:common	news		nouvelles	nb=sg;human=0;antecedent_of_relpro=@57;dirobj_of=@54;modified_on_left=@55;object_of_verb=@54	55	56
+that	pron	that		qui	antecedent=@56;indirobj_of=@70	56	57
+Tyrone	noun:propernoun	Tyrone		{???}	nb=sg;human=0;agent_of_verb=@66;has_apposition=@59	57	58
+Patty	noun:propernoun	Patty		{???}	nb=sg;human=1;apposition_to=@58	58	59
+,	punct	,		,		59	60
+a	det	a		un	modifies_right_head=@64	60	61
+particularly	adv	particularly		particulièrement	modifies_right_head=@63	61	62
+dangerous	adj	dangerous		dangereux	modified_on_left=@62;modifies_right_head=@64;semantic_modifier_of=@64	62	63
+criminal	noun:common	criminal		criminel	nb=sg;human=1;modified_by_adj=@63;modified_on_left=@61	63	64
+she	pron	she		$$$	human=1	64	65
+helped	verb:plain	help		aider	agent_of_action=@58;dirobj=@69;govern=@69;governs_nonfinite=@70;object_of_action=@69	65	66
+the	det	the		le	modifies_right_head=@69	66	67
+Carson City	noun:propernoun	Carson city		Carson City	nb=sg;human=0;modifies_another_noun=@69	67	68
+Police Department	noun:common	police department		Département de Police	nb=sg;human=1;agent_of_verb=@70;dirobj_of=@66;governs_another_noun=@68;modified_on_left=@67;object_of_verb=@66	68	69
+track	verb:inf	track		{???}	agent_of_action=@69;dirobj=@73;govern=@73;indirobj=@57;modified_by_adverb=@71;modified_by_adverb=@71;nonfinite_governed_by=@66;object_of_action=@73	69	70
+down	adv	down		{???}	modifies=@70	70	71
+a few	det	a few		quelque	modifies_right_head=@73	71	72
+years	noun:common	year		année	nb=pl;human=0;dirobj_of=@70;modified_by_adj=@74;modified_on_left=@72;modified_on_right=@74;object_of_verb=@70	72	73
+years back	*noun:common adj	year back		{???}	nb=pl;human=0;dirobj_of=@70;modified_on_left=@72;object_of_verb=@70	72	74
+back	adj	back		arrière	modifies_left_head=@73;semantic_modifier_of=@73	73	74
+,	punct	,		,		74	75
+has	verb:plain	have		avoir		75	76
+hired	verb:plain	hire		engager	dirobj=@79;govern=@79;governs_nonfinite=@81;object_of_action=@79	76	77
+a	det	a		un	modifies_right_head=@79	77	78
+hitman	noun:common	hitman		{???}	nb=sg;human=1;dirobj_of=@77;modified_on_left=@78;object_of_verb=@77	78	79
+to	part	to		pour		79	80
+kill	verb:inf	kill		tuer	dirobj=@82;govern=@82;nonfinite_governed_by=@77;object_of_action=@82	80	81
+her	pron	her		la	human=1;dirobj_of=@81;object_of_verb=@81	81	82
+.	punct	.		.		82	83
+---------------------------------------
++++++++++++++++++++++++++++++++++++++++
+After	prep	after		après	dirobj=@4;govern=@4	0	1
+her	det	her		son	modifies_right_head=@4	1	2
+first	numeric	first		premier	modifies_right_head=@4	2	3
+night	noun:common	night		nuit	nb=sg;human=0;dirobj_of=@1;modified_by_prep1=@5;modified_on_left=@2	3	4
+in	prep	in		dans	dirobj=@8;govern=@8;governed_by=@4;possible_governed_by=@4;possible_governed_by=@11	4	5
+her	det	her		son	modifies_right_head=@8	5	6
+new	adj	new		nouveau	modifies_right_head=@8;semantic_modifier_of=@8	6	7
+new place	adj *noun:common	new place		{???}	nb=sg;human=0;dirobj_of=@5;modified_on_left=@6	6	8
+place	noun:common	place		endroit	nb=sg;human=0;dirobj_of=@5;modified_by_adj=@7;modified_on_left=@6	7	8
+,	punct	,		,		8	9
+Kinsey	noun:propernoun	Kinsey		kinsey	nb=sg;human=0;agent_of_verb=@11	9	10
+heads	verb:plain	head		diriger	agent_of_action=@10;dirobj=@15;govern=@15;modified_by_adverb=@12;modified_by_adverb=@12;modified_by_prep1=@16;object_of_action=@15	10	11
+out	adv	out		$$$	modifies=@11	11	12
+early	adv	early		tôt	modifies=@11	12	13
+the	det	the		le	modifies_right_head=@15	13	14
+next day	noun:common	next day		{???}	nb=pl;human=0;dirobj_of=@11;has_apposition=@22;modified_on_left=@14;object_of_verb=@11	14	15
+in search of	prep	in search of		à la recherche	dirobj=@19;govern=@19;governed_by=@11	15	16
+Mrs	noun:common	mrs		Mme	nb=sg;human=1;has_apposition=@18;modifies_another_noun=@19	16	17
+Gersh's	noun:propernoun	Gersh's		gersh's	nb=sg;human=1;apposition_to=@17	17	18
+mother	noun:common	mother		mère	nb=sg;human=1;dirobj_of=@16;governs_another_noun=@17	18	19
+,	punct	,		,		19	20
+Agnes	noun:propernoun	Agnes		Agnès	nb=sg;human=1;modifies_another_noun=@22	20	21
+Grey	noun:common	gray		gris	nb=sg;human=0;agent_of_verb=@25;antecedent_of_relpro=@24;apposition_to=@15;governs_another_noun=@21	21	22
+,	punct	,		,		22	23
+who	pron	who		qui	antecedent=@22;modified_by_adj=@36	23	24
+lives	verb:plain	live		vivre	agent_of_action=@22;modified_by_prep1=@26	24	25
+in	prep	in		dans	dirobj=@28;govern=@28;governed_by=@25	25	26
+a	det	a		un	modifies_right_head=@28	26	27
+trailer	noun:common	trailer		remorque	nb=sg;human=0;dirobj_of=@26;modified_by_prep1=@29;modified_on_left=@27	27	28
+in	prep	in		dans	dirobj=@31;govern=@31;governed_by=@28;possible_governed_by=@28;possible_governed_by=@25	28	29
+the	det	the		le	modifies_right_head=@31	29	30
+desert	noun:common	desert		désert	nb=sg;human=0;dirobj_of=@29;has_apposition=@33;modified_on_left=@30	30	31
+.	punct	.		.		31	32
+Agnes	noun:propernoun	Agnes		Agnès	nb=sg;human=1;apposition_to=@31	32	33
+isn't	verb:plain	be		être	linked_to_predicate=@36	33	34
+	adv	not		non	modifies=@34	34	35
+home	adj	home		à la maison	predadj_of=@34;semantic_modifier_of=@24	35	36
+,	punct	,		,		36	37
+and	conj	and		et		37	38
+the	det	the		le	modifies_right_head=@40	38	39
+trailer	noun:common	trailer		remorque	nb=sg;human=0;agent_of_verb=@41;modified_on_left=@39;object_of_verb=@44	39	40
+seems	verb:plain	seem		sembler	agent_of_action=@40;governs_nonfinite=@44	40	41
+to	part	to		pour		41	42
+be	verb:inf	be		être		42	43
+occupied	verb:inf	occupy		occuper	agent_of_action=@48;modified_by_prep1=@45;nonfinite_governed_by=@41;object_of_action=@40	43	44
+by	prep	by		par	dirobj=@48;govern=@48;governed_by=@44;possible_governed_by=@44;possible_governed_by=@41	44	45
+by two teenage runaways	*prep numeric adj noun:common	by two teenage runaway		{???}	governed_by=@44;possible_governed_by=@44;possible_governed_by=@41	44	48
+two	numeric	two		deux	modifies_right_head=@48	45	46
+teenage	adj	teenage		adolescent	modifies_right_head=@48;semantic_modifier_of=@48	46	47
+teenage runaways	adj *noun:common	teenage runaway		{???}	nb=pl;human=0;agent_of_verb=@44;dirobj_of=@45;modified_on_left=@46	46	48
+runaways	noun:common	runaway		emballement	nb=pl;human=0;agent_of_verb=@44;dirobj_of=@45;modified_by_adj=@47;modified_on_left=@46	47	48
+,	punct	,		,		48	49
+but	conj	but		mais		49	50
+Kinsey	noun:propernoun	Kinsey		kinsey	nb=sg;human=0;agent_of_verb=@53	50	51
+eventually	adv	eventually		certain	modifies=@53	51	52
+tracks	verb:plain	track		dépister	agent_of_action=@51;dirobj=@54;govern=@54;modified_by_adverb=@55;modified_by_adverb=@55;modified_by_prep1=@56;object_of_action=@54	52	53
+Agnes	noun:propernoun	Agnes		Agnès	nb=sg;human=1;dirobj_of=@53;object_of_verb=@53	53	54
+down	adv	down		vers le bas	modifies=@53	54	55
+at	prep	at		$$$	dirobj=@60;govern=@60;governed_by=@53	55	56
+at a local convalescent hospital	*prep det adj adj noun:common	at a local convalescent hospital		{???}	governed_by=@53	55	60
+a	det	a		un	modifies_right_head=@60	56	57
+local	adj	local		local	modifies_right_head=@60;semantic_modifier_of=@60	57	58
+local convalescent hospital	adj adj *noun:common	local convalescent hospital		{???}	nb=sg;human=0;dirobj_of=@56;modified_on_left=@57;skip_end=@82	57	60
+convalescent	adj	convalescent		{???}	modifies_right_head=@60;semantic_modifier_of=@60	58	59
+convalescent hospital	adj *noun:common	convalescent hospital		{???}	nb=sg;human=0;dirobj_of=@56;modified_on_left=@57;skip_end=@82	58	60
+hospital	noun:common	hospital		{???}	nb=sg;human=0;dirobj_of=@56;modified_by_adj=@59;modified_on_left=@57;skip_end=@82	59	60
+,	punct	,		,		60	61
+where	conj	where		où		61	62
+she	pron	she		$$$	human=1;agent_of_verb=@65	62	63
+has	verb:plain	have		avoir		63	64
+been	verb:plain	be		être	agent_of_action=@63;modified_by_prep1=@66	64	65
+since	prep	since		depuis	dirobj=@68;govern=@68;governed_by=@65	65	66
+being	verb:prespart	be		être		66	67
+taken	verb:prespart	take		prendre	dirobj=@70;dirobj_of=@66;govern=@70;modified_by_adverb=@69;modified_by_adverb=@69;modified_by_prep1=@74;object_of_action=@70	67	68
+suddenly	adv	suddenly		soudain	modifies=@68	68	69
+ill	noun:common	ill		défectuosité	nb=sg;human=0;dirobj_of=@68;modified_by_prep1=@71;object_of_verb=@68	69	70
+ill on a trip	*noun:common prep det noun:common	ill on a trip		{???}	nb=sg;human=0;dirobj_of=@68;object_of_verb=@68	69	73
+on	prep	on		sur	dirobj=@73;govern=@73;governed_by=@70;possible_governed_by=@70;possible_governed_by=@65	70	71
+on a trip	*prep det noun:common	on a trip		{???}	governed_by=@70;possible_governed_by=@70;possible_governed_by=@65	70	73
+a	det	a		un	modifies_right_head=@73	71	72
+trip	noun:common	trip		voyage	nb=sg;human=0;dirobj_of=@71;modified_on_left=@72	72	73
+to	prep	to		$$$	dirobj=@77;govern=@77;governed_by=@68;possible_governed_by=@68;possible_governed_by=@65	73	74
+a	det	a		un	modifies_right_head=@77	74	75
+local	adj	local		local	modifies_right_head=@77;semantic_modifier_of=@77	75	76
+local town	adj *noun:common	local town		{???}	nb=sg;human=0;dirobj_of=@74;has_apposition=@81;modified_on_left=@75	75	77
+town	noun:common	town		ville	nb=sg;human=0;dirobj_of=@74;has_apposition=@81;modified_by_adj=@76;modified_on_left=@75	76	77
+sometime	adv	sometime		un jour ou l’autre	modifies_right_head=@79	77	78
+before	adv	before		avant	modified_on_left=@78;modifies=@68	78	79
+.	punct	.		.		79	80
+Agnes	noun:propernoun	Agnes		Agnès	nb=sg;human=1;apposition_to=@77	80	81
+,	punct	,		,		81	82
+83	numeric	83		83	modifies_right_head=@84;skip_begin=@61	82	83
+years old	noun:common	years~old		année	nb=pl;human=0;modified_on_left=@83	83	84
+,	punct	,		,		84	85
+hasn't	verb:plain	have		avoir		85	86
+	adv	not		non	modifies=@89	86	87
+exactly	adv	exactly		précis	modifies=@89	87	88
+been	verb:plain	be		être	linked_to_predicate=@92;modified_by_adverb=@88;modified_by_adverb=@88	88	89
+a	det	a		un	modifies_right_head=@92	89	90
+model	adj	model		modèle	modifies_right_head=@92;semantic_modifier_of=@92	90	91
+model patient	adj *noun:common	model patient		{???}	nb=sg;human=1;modified_on_left=@90;predadj_of=@89	90	92
+patient	noun:common	patient		patient	nb=sg;human=1;modified_by_adj=@91;modified_on_left=@90;predadj_of=@89	91	92
+,	punct	,		,		92	93
+and	conj	and		et		93	94
+the	det	the		le	modifies_right_head=@97	94	95
+hospital	noun:common	hospital		{???}	nb=sg;human=0;modifies_another_noun=@97	95	96
+hospital staff	noun:common *noun:common	hospital staff		personnel	nb=sg;human=0;agent_of_verb=@101;modified_on_left=@95;object_of_verb=@99	95	97
+staff	noun:common	staff		{???}	nb=sg;human=0;agent_of_verb=@101;governs_another_noun=@96;modified_on_left=@95;object_of_verb=@99	96	97
+are	verb:plain	be		être		97	98
+delighted	verb:plain	delight		enchanter	governs_nonfinite=@101;object_of_action=@97	98	99
+to	part	to		pour		99	100
+hear	verb:inf	hear		entendre	agent_of_action=@97;dirobj=@102;govern=@102;nonfinite_governed_by=@99;object_of_action=@102	100	101
+that	conj	that		que	dirobj_of=@101;object_of_verb=@101	101	102
+she	pron	she		$$$	human=1	102	103
+has	verb:plain	have		avoir	dirobj=@105;govern=@105;object_of_action=@105	103	104
+relatives	noun:common	relative		parent	nb=pl;human=1;antecedent_of_relpro=@106;dirobj_of=@104;object_of_verb=@104	104	105
+who	pron	who		qui	antecedent=@105	105	106
+can	verb:plain	can		pouvoir	governs_nonfinite=@108	106	107
+take	verb:inf	take		prendre	dirobj=@113;govern=@113;indirobj=@109;nonfinite_governed_by=@107;object_of_action=@113	107	108
+responsibility	noun:common	responsibility		responsabilité	nb=sg;human=0;indirobj_of=@108;modified_by_prep1=@110	108	109
+for	prep	for		pour	dirobj=@111;govern=@111;governed_by=@109;possible_governed_by=@109	109	110
+her	pron	her		la	human=1;dirobj_of=@110	110	111
+.	punct	.		.		111	112
+Irene	noun:propernoun	Irene		Irène	nb=sg;human=1;dirobj_of=@108;object_of_verb=@108	112	113
+makes	verb:plain	make		faire	dirobj=@115;govern=@115;governs_nonfinite=@117;object_of_action=@115	113	114
+plans	noun:common	plan		plan	nb=pl;human=0;dirobj_of=@114;object_of_verb=@114	114	115
+to	part	to		pour		115	116
+transfer	verb:inf	transfer		transférer	dirobj=@118;govern=@118;modified_by_prep1=@119;nonfinite_governed_by=@114;object_of_action=@118	116	117
+Agnes	noun:propernoun	Agnes		Agnès	nb=sg;human=1;dirobj_of=@117;object_of_verb=@117	117	118
+to	prep	to		$$$	dirobj=@121;govern=@121;governed_by=@117;possible_governed_by=@117	118	119
+a	det	a		un	modifies_right_head=@121	119	120
+facility	noun:common	facility		installation	nb=sg;human=0;dirobj_of=@119;modified_by_prep1=@122;modified_on_left=@120	120	121
+in	prep	in		en	dirobj=@123;govern=@123;governed_by=@121;possible_governed_by=@121	121	122
+Santa	noun:propernoun	Santa		Santa	nb=sg;human=1;dirobj_of=@122;has_apposition=@124	122	123
+Teresa	noun:propernoun	Teresa		Teresa	nb=sg;human=1;apposition_to=@123	123	124
+,	punct	,		,		124	125
+but	conj	but		mais		125	126
+Agnes	noun:propernoun	Agnes		Agnès	nb=sg;human=1	126	127
+seems	verb:plain	seem		sembler	linked_to_predicate=@129;previous_enum=@135	127	128
+terrified	verb:pastpart	terrify		terrifier	modified_by_prep1=@130;predadj_of=@128	128	129
+terrified of going there	verb:pastpart prep verb:prespart *adv	terrify of go there		{???}		128	132
+of	prep	of		$$$	dirobj=@131;govern=@131;governed_by=@129;possible_governed_by=@129	129	130
+of going	*prep verb:prespart	of go		{???}	governed_by=@129;possible_governed_by=@129	129	131
+going	verb:prespart	go		aller	dirobj_of=@130;modified_by_adverb=@132;modified_by_adverb=@132	130	131
+there	adv	there		là	modifies=@131	131	132
+,	punct	,		,		132	133
+and	conj	and		et		133	134
+tells	verb:plain	tell		{???}	dirobj=@139;govern=@139;indirobj=@136;next_enum=@128;object_of_action=@139	134	135
+Kinsey	noun:propernoun	Kinsey		kinsey	nb=sg;human=0;indirobj_of=@135	135	136
+a	det	a		un	modifies_right_head=@139	136	137
+confused	adj	confused		confus	modifies_right_head=@139;semantic_modifier_of=@139	137	138
+confused story	adj *noun:common	confused story		{???}	nb=sg;human=0;dirobj_of=@135;modified_by_prep1=@140;modified_on_left=@137;object_of_verb=@135	137	139
+story	noun:common	story		{???}	nb=sg;human=0;dirobj_of=@135;modified_by_adj=@138;modified_by_prep1=@140;modified_on_left=@137;object_of_verb=@135	138	139
+about	prep	about		au sujet	dirobj=@142;govern=@142;governed_by=@139;possible_governed_by=@139	139	140
+a number of	det	a number of		un certain nombre	modifies_right_head=@142	140	141
+people	noun:common	people		personne	nb=pl;human=1;dirobj_of=@140;modified_by_prep1=@143;modified_on_left=@141	141	142
+from	prep	from		$$$	dirobj=@145;govern=@145;governed_by=@142;possible_governed_by=@142	142	143
+the	det	the		le	modifies_right_head=@145	143	144
+past	noun:common	past		passé	nb=sg;human=0;dirobj_of=@143;modified_by_prep1=@147;modified_on_left=@144	144	145
+,	punct	,		,		145	146
+including	prep	including		y compris	dirobj=@148;govern=@148;governed_by=@145;possible_governed_by=@145	146	147
+including Lottie	*prep noun:propernoun	including Lottie		{???}	governed_by=@145;possible_governed_by=@145	146	148
+Lottie	noun:propernoun	Lottie		lottie	nb=sg;human=0;dirobj_of=@147	147	148
+,	punct	,		,		148	149
+---------------------------------------
++++++++++++++++++++++++++++++++++++++++
+---------------------------------------
++++++++++++++++++++++++++++++++++++++++
+---------------------------------------
++++++++++++++++++++++++++++++++++++++++
+Kinsey	noun:propernoun	Kinsey		kinsey	nb=sg;human=0;agent_of_verb=@13;object_of_verb=@3	0	1
+is	verb:plain	be		être		1	2
+convinced	verb:plain	convince		convaincre	governs_nonfinite=@13;object_of_action=@1;previous_enum=@19;skip_end=@11	2	3
+that	conj	that		que		3	4
+Patrick	noun:propernoun	Patrick		{???}	nb=sg;human=1;agent_of_verb=@6;modified_by_adj=@7	4	5
+is	verb:plain	be		{???}	agent_of_action=@5;linked_to_predicate=@7	5	6
+responsible	adj	responsible		{???}	modified_by_prep1=@8;predadj_of=@6;semantic_modifier_of=@5	6	7
+for	prep	for		{???}	dirobj=@10;govern=@10;governed_by=@7;possible_governed_by=@7;possible_governed_by=@6	7	8
+Agnes's	noun:propernoun	Agnes		Agnès	nb=sg;human=1;modifies_another_noun=@10	8	9
+death	noun:common	death		mort	nb=sg;human=0;dirobj_of=@8;governs_another_noun=@9	9	10
+,	punct	,		,		10	11
+to	part	to		pour	skip_begin=@4	11	12
+cover	verb:inf	cover		couvrir	agent_of_action=@1;dirobj=@16;govern=@16;nonfinite_governed_by=@3;object_of_action=@16	12	13
+his	det	his		son	modifies_right_head=@16	13	14
+past	adj	past		passé	modifies_right_head=@16;semantic_modifier_of=@16	14	15
+past crimes	adj *noun:common	past crime		{???}	nb=pl;human=0;dirobj_of=@13;modified_on_left=@14;object_of_verb=@13	14	16
+crimes	noun:common	crime		crime	nb=pl;human=0;dirobj_of=@13;modified_by_adj=@15;modified_on_left=@14;object_of_verb=@13	15	16
+,	punct	,		,		16	17
+and	conj	and		et		17	18
+discovers	verb:plain	discover		découvrir	agent_of_action=@1;dirobj=@20;govern=@20;modified_by_prep1=@24;next_enum=@3;object_of_action=@20	18	19
+evidence	noun:common	evidence		preuve	nb=sg;human=0;dirobj_of=@19;modified_by_prep1=@21;object_of_verb=@19	19	20
+of	prep	of		$$$	dirobj=@23;govern=@23;governed_by=@20;possible_governed_by=@20;possible_governed_by=@3	20	21
+further	adj	further		autre	modifies_right_head=@23;semantic_modifier_of=@23;comparative=1	21	22
+further killings	adj *noun:common	further killing		{???}	nb=pl;human=0;dirobj_of=@21	21	23
+killings	noun:common	killing		massacre	nb=pl;human=0;dirobj_of=@21;modified_by_adj=@22;modified_on_left=@22	22	23
+at	prep	at		$$$	dirobj=@26;govern=@26;governed_by=@19;possible_governed_by=@19;possible_governed_by=@3	23	24
+his	det	his		son	modifies_right_head=@26	24	25
+home	noun:common	home		maison	nb=sg;human=0;dirobj_of=@24;modified_on_left=@25	25	26
+.	punct	.		.	skip_end=@31	26	27
+When	conj	when		quand		27	28
+she	pron	she		$$$	human=1;agent_of_verb=@30	28	29
+confronts	verb:plain	confront		confronter	agent_of_action=@29;dirobj=@31;govern=@31;object_of_action=@31	29	30
+Patrick	noun:propernoun	Patrick		{???}	nb=sg;human=1;dirobj_of=@30;object_of_verb=@30	30	31
+,	punct	,		,	skip_begin=@28	31	32
+she	pron	she		$$$	human=1	32	33
+is	verb:plain	be		être		33	34
+interrupted	verb:plain	interrupt		interrompre	agent_of_action=@37;modified_by_prep1=@36	34	35
+by	prep	by		par	dirobj=@37;govern=@37;governed_by=@35;possible_governed_by=@35;possible_governed_by=@3	35	36
+Messinger	noun:propernoun	Messinger		messinger	nb=sg;human=1;agent_of_verb=@40;antecedent_of_relpro=@39;dirobj_of=@36	36	37
+,	punct	,		,		37	38
+who	pron	who		qui	antecedent=@37	38	39
+kills	verb:plain	kill		tuer	agent_of_action=@37;dirobj=@41;govern=@41;object_of_action=@41	39	40
+Patrick	noun:propernoun	Patrick		{???}	nb=sg;human=1;dirobj_of=@40;has_apposition=@43;object_of_verb=@40	40	41
+.	punct	.		.		41	42
+Dietz	noun:propernoun	Dietz		dietz	nb=sg;human=1;apposition_to=@41	42	43
+and	conj	and		et		43	44
+Rochelle	noun:propernoun	Rochelle		Rochelle	nb=sg;human=0;agent_of_verb=@49	44	45
+have	verb:plain	have		avoir		45	46
+managed	verb:plain	manage		parvenir	agent_of_action=@45;governs_nonfinite=@49	46	47
+to	part	to		pour		47	48
+get	verb:inf	get		obtenir	agent_of_action=@45;dirobj=@50;govern=@50;nonfinite_governed_by=@47;object_of_action=@50	48	49
+Eric	noun:propernoun	Eric		Éric	nb=sg;human=1;dirobj_of=@49;modified_by_prep1=@51;object_of_verb=@49	49	50
+away from	prep	away from		à partir	dirobj=@52;govern=@52;governed_by=@50;possible_governed_by=@50;possible_governed_by=@47	50	51
+away from Messinger	*prep noun:propernoun	away from Messinger		{???}	governed_by=@50;possible_governed_by=@50;possible_governed_by=@47	50	52
+Messinger	noun:propernoun	Messinger		messinger	nb=sg;human=0;dirobj_of=@51	51	52
+,	punct	,		,		52	53
+and	conj	and		et		53	54
+Messinger's	noun:propernoun	Messinger's		messinger's	nb=sg;human=1;modifies_another_noun=@57	54	55
+stated	verb:pastpart	state		énoncer	modifies_right_head=@57;object_of_action=@57;semantic_modifier_of=@57	55	56
+stated intention	verb:pastpart *noun:common	state intention		{???}	nb=sg;human=0;agent_of_verb=@58;governs_another_noun=@55	55	57
+intention	noun:common	intention		{???}	nb=sg;human=0;agent_of_verb=@58;governs_another_noun=@55;modified_by_adj=@56;modified_on_left=@56;object_of_verb=@56	56	57
+is	verb:plain	be		{???}	agent_of_action=@57;governs_nonfinite=@60;linked_to_predicate=@60	57	58
+to	part	to		pour		58	59
+use	verb:inf	use		employer	dirobj=@61;govern=@61;nonfinite_governed_by=@58;object_of_action=@61;predadj_of=@58	59	60
+Kinsey	noun:propernoun	Kinsey		kinsey	nb=sg;human=0;dirobj_of=@60;object_of_verb=@60	60	61
+as	conj	as		à mesure que		61	62
+a	det	a		un	modifies_right_head=@64	62	63
+hostage	noun:common	hostage		otage	nb=sg;human=1;modified_on_left=@63;modified_on_right=@66;object_of_verb=@84	63	64
+to	part	to		pour		64	65
+exchange	verb:inf	exchange		échanger	modified_by_prep1=@67;modifies_left_head=@64	65	66
+for	prep	for		pour	dirobj=@68;govern=@68;governed_by=@66;possible_governed_by=@66;possible_governed_by=@84	66	67
+Eric	noun:propernoun	Eric		Éric	nb=sg;human=1;dirobj_of=@67	67	68
+.	punct	.		.	skip_end=@80	68	69
+As	conj	as		à mesure que		69	70
+she	pron	she		$$$	human=1;agent_of_verb=@72	70	71
+drives	verb:plain	drive		conduire	agent_of_action=@71;dirobj=@73;govern=@73;governs_nonfinite=@79;modified_by_adverb=@77;modified_by_adverb=@77;modified_by_prep1=@74;object_of_action=@73	71	72
+Messinger	noun:propernoun	Messinger		messinger	nb=sg;human=0;dirobj_of=@72;object_of_verb=@72	72	73
+Messinger to the airport	*noun:propernoun prep det noun:common	Messinger to the airport		{???}	nb=sg;human=0;dirobj_of=@72;object_of_verb=@72	72	76
+to	prep	to		$$$	dirobj=@76;govern=@76;governed_by=@72	73	74
+to the airport	*prep det noun:common	to the airport		{???}	governed_by=@72	73	76
+the	det	the		le	modifies_right_head=@76	74	75
+airport	noun:common	airport		aéroport	nb=sg;human=0;dirobj_of=@74;modified_on_left=@75	75	76
+at gunpoint	adv	at gunpoint		sous la menace des armes	modifies=@72	76	77
+to	part	to		pour		77	78
+intercept	verb:inf	intercept		arrêter	agent_of_action=@71;dirobj=@80;govern=@80;nonfinite_governed_by=@72;object_of_action=@80	78	79
+Rochelle	noun:propernoun	Rochelle		Rochelle	nb=sg;human=0;dirobj_of=@79;object_of_verb=@79	79	80
+,	punct	,		,	skip_begin=@70	80	81
+Kinsey	noun:propernoun	Kinsey		kinsey	nb=sg;human=0	81	82
+is	verb:plain	be		être		82	83
+convinced	verb:plain	convince		convaincre	object_of_action=@64	83	84
+Messinger	noun:propernoun	Messinger		messinger	nb=sg;human=0;agent_of_verb=@87	84	85
+will	verb:plain	will		$$$		85	86
+kill	verb:plain	kill		tuer	agent_of_action=@85;dirobj=@88;govern=@88;modified_by_adverb=@91;modified_by_adverb=@91;object_of_action=@88	86	87
+them	pron	them		les	human=1;antecedent=@23;dirobj_of=@87;has_apposition=@89;object_of_verb=@87	87	88
+all	pron	all		tout	antecedent=@88;apposition_to=@88	88	89
+.	punct	.		.		89	90
+However	adv	however		cependant	modifies=@87	90	91
+,	punct	,		,		91	92
+Rochelle	noun:propernoun	Rochelle		Rochelle	nb=sg;human=0;agent_of_verb=@94	92	93
+outsmarts	verb:plain	outsmart		montrer plus malin que	agent_of_action=@93;dirobj=@95;govern=@95;object_of_action=@95;previous_enum=@97	93	94
+Messinger	noun:propernoun	Messinger		messinger	nb=sg;human=0;dirobj_of=@94;object_of_verb=@94	94	95
+and	conj	and		et		95	96
+kills	verb:plain	kill		tuer	agent_of_action=@93;dirobj=@98;govern=@98;modified_by_adverb=@99;modified_by_adverb=@99;next_enum=@94;object_of_action=@98	96	97
+him	pron	him		lui	human=1;dirobj_of=@97;object_of_verb=@97	97	98
+first	adv	first		d'abord	modifies=@97	98	99
+.	punct	.		.		99	100
+---------------------------------------
++++++++++++++++++++++++++++++++++++++++
+"	punct	"		"	closing_quote_ptr=@3;opening_quote_ptr=@1	0	1
+G	noun:acronym	g		g	nb=sg;human=0;agent_of_verb=@4;closing_quote_ptr=@3;opening_quote_ptr=@1	1	2
+"	punct	"		"	closing_quote_ptr=@3;opening_quote_ptr=@1	2	3
+Is	verb:plain	be		être	agent_of_action=@2;modified_by_prep1=@5	3	4
+for	prep	for		pour	dirobj=@6;govern=@6;governed_by=@4	4	5
+for Gumshoe	*prep noun:common	for gumshoe		{???}	governed_by=@4	4	6
+Gumshoe	noun:common	gumshoe		chaussure en caoutchouc	nb=sg;human=0;dirobj_of=@5	5	6
+was	verb:plain	be		être		6	7
+honored	verb:plain	honor		honorer	modified_by_prep1=@9	7	8
+with	prep	with		avec	dirobj=@14;govern=@14;governed_by=@8;possible_governed_by=@8;possible_governed_by=@4	8	9
+both	det	both		les deux	modifies_right_head=@14	9	10
+the	det	the		le	modifies_right_head=@14	10	11
+Private	adj	private		{???}	modifies_right_head=@13;semantic_modifier_of=@13	11	12
+Private Eye	adj *noun:common	private eye		détective	nb=sg;human=0;modifies_another_noun=@14	11	13
+Private Eye Writers	adj noun:common *noun:common	private eye writer		{???}	nb=pl;human=1;dirobj_of=@9;modified_by_prep1=@15;modified_on_left=@10	11	14
+Eye	noun:common	eye		{???}	nb=sg;human=0;modified_by_adj=@12;modified_on_left=@12;modifies_another_noun=@14	12	13
+Writers	noun:common	writer		auteur	nb=pl;human=1;dirobj_of=@9;governs_another_noun=@13;modified_by_prep1=@15;modified_on_left=@10	13	14
+of	prep	of		$$$	dirobj=@18;govern=@18;governed_by=@14;possible_governed_by=@14;possible_governed_by=@4	14	15
+America's	noun:propernoun	America		Amérique	nb=sg;human=0;modifies_another_noun=@17	15	16
+Shamus	noun:propernoun	Shamus		shamus	nb=sg;human=1;governs_another_noun=@16;modifies_another_noun=@18	16	17
+Award	noun:common	award		récompense	nb=sg;human=0;dirobj_of=@15;governs_another_noun=@17;modified_by_prep1=@19	17	18
+Award for best novel	*noun:common prep adj noun:common	award for best novel		{???}	nb=sg;human=0;dirobj_of=@15;governs_another_noun=@17	17	21
+for	prep	for		pour	dirobj=@21;govern=@21;governed_by=@18;possible_governed_by=@18;possible_governed_by=@4	18	19
+for best novel	*prep adj noun:common	for best novel		{???}	governed_by=@18;possible_governed_by=@18;possible_governed_by=@4	18	21
+best	adj	best		meilleur	modifies_right_head=@21;semantic_modifier_of=@21;superlative=1	19	20
+best novel	adj *noun:common	best novel		{???}	nb=sg;human=0;dirobj_of=@19	19	21
+novel	noun:common	novel		roman	nb=sg;human=0;dirobj_of=@19;modified_by_adj=@20;modified_on_left=@20	20	21
+and	conj	and		et		21	22
+Bouchercon's	noun:propernoun	Bouchercon's		bouchercon's	nb=sg;human=0;modifies_another_noun=@25	22	23
+1991	numeric	1991		1991	apposition_to=@26	23	24
+Anthony	noun:propernoun	Anthony		Anthony	nb=sg;human=1;governs_another_noun=@23;modifies_another_noun=@26	24	25
+Award	noun:common	award		récompense	nb=sg;human=0;agent_of_verb=@38;governs_another_noun=@25;has_apposition=@24;modified_by_adj=@47;modified_by_prep1=@27	25	26
+Award for Best Novel	*noun:common prep adj noun:common	award for best novel		{???}	nb=sg;human=0;agent_of_verb=@38;governs_another_noun=@25;has_apposition=@24;modified_by_adj=@47	25	29
+for	prep	for		pour	dirobj=@29;govern=@29;governed_by=@26;possible_governed_by=@26;possible_governed_by=@38	26	27
+for Best Novel	*prep adj noun:common	for best novel		{???}	governed_by=@26;possible_governed_by=@26;possible_governed_by=@38	26	29
+Best	adj	best		meilleur	modifies_right_head=@29;semantic_modifier_of=@29;superlative=1	27	28
+Best Novel	adj *noun:common	best novel		{???}	nb=sg;human=0;dirobj_of=@27	27	29
+Novel	noun:common	novel		roman	nb=sg;human=0;dirobj_of=@27;modified_by_adj=@28;modified_on_left=@28	28	29
+.	punct	.		.		29	30
+The	det	the		le	modifies_right_head=@32	30	31
+reviewer	noun:common	reviewer		critique	nb=sg;human=1;modified_by_prep1=@33;modified_on_left=@31	31	32
+for	prep	for		pour	dirobj=@37;govern=@37;governed_by=@32;possible_governed_by=@32;possible_governed_by=@38	32	33
+for the School Library Journal	*prep det noun:common noun:common noun:common	for the school library journal		{???}	governed_by=@32;possible_governed_by=@32;possible_governed_by=@38	32	37
+the	det	the		le	modifies_right_head=@37	33	34
+School	noun:common	school		{???}	nb=sg;human=0;modifies_another_noun=@36	34	35
+School Library	noun:common *noun:common	school library		{???}	nb=sg;human=0;modifies_another_noun=@37	34	36
+School Library Journal	noun:common noun:common *noun:common	school library journal		{???}	nb=sg;human=0;dirobj_of=@33;modified_on_left=@34	34	37
+Library	noun:common	library		{???}	nb=sg;human=0;governs_another_noun=@35;modifies_another_noun=@37	35	36
+Journal	noun:common	journal		journal	nb=sg;human=0;dirobj_of=@33;governs_another_noun=@36;modified_on_left=@34	36	37
+considered	verb:plain	consider		{???}	agent_of_action=@26;dirobj=@40;govern=@40;indirobj=@41;object_of_action=@40;previous_enum=@54	37	38
+the	det	the		le	modifies_right_head=@40	38	39
+book	noun:common	book		{???}	nb=sg;human=0;dirobj_of=@38;modified_by_adj=@41;modified_on_left=@39;object_of_verb=@38	39	40
+book oriented towards adults	*noun:common verb:pastpart prep noun:common	book orient toward adult		{???}	nb=sg;human=0;dirobj_of=@38;modified_on_left=@39;object_of_verb=@38	39	43
+oriented	verb:pastpart	orient		orienter	indirobj_of=@38;modified_by_adverb=@51;modified_by_adverb=@51;modified_by_prep1=@42;object_of_action=@40;semantic_modifier_of=@40	40	41
+towards	prep	toward		vers	dirobj=@43;govern=@43;governed_by=@41;possible_governed_by=@41;possible_governed_by=@38	41	42
+towards adults	*prep noun:common	toward adult		{???}	governed_by=@41;possible_governed_by=@41;possible_governed_by=@38	41	43
+adults	noun:common	adult		adulte	nb=pl;human=1;dirobj_of=@42	42	43
+but	conj	but		mais		43	44
+to	part	to		pour		44	45
+be	verb:inf	be		{???}	linked_to_predicate=@47	45	46
+suitable	adj	suitable		{???}	modified_by_prep1=@48;predadj_of=@46;semantic_modifier_of=@26	46	47
+suitable for young adults	*adj prep adj noun:common	suitable for young adult		{???}	predadj_of=@46;semantic_modifier_of=@26	46	50
+suitable for young adults as well	adj prep adj noun:common *adv	suitable for young adult as well		{???}	modifies=@41	46	51
+for	prep	for		pour	dirobj=@50;govern=@50;governed_by=@47;possible_governed_by=@47;possible_governed_by=@38	47	48
+for young adults	*prep adj noun:common	for young adult		{???}	governed_by=@47;possible_governed_by=@47;possible_governed_by=@38	47	50
+young	adj	young		jeune	modifies_right_head=@50;semantic_modifier_of=@50	48	49
+young adults	adj *noun:common	young adult		{???}	nb=pl;human=1;dirobj_of=@48	48	50
+adults	noun:common	adult		adulte	nb=pl;human=1;dirobj_of=@48;modified_by_adj=@49;modified_on_left=@49	49	50
+as well	adv	as well		aussi bien	modifies=@41	50	51
+,	punct	,		,		51	52
+and	conj	and		et		52	53
+wrote	verb:plain	write		écrire	agent_of_action=@26;dirobj=@55;govern=@55;next_enum=@38;object_of_action=@55	53	54
+that	conj	that		que	dirobj_of=@54;object_of_verb=@54	54	55
+"	punct	"		"	closing_quote_ptr=@65;opening_quote_ptr=@56	55	56
+this	det	this		ce	closing_quote_ptr=@65;modifies_right_head=@59;opening_quote_ptr=@56	56	57
+light	adj	light		léger	closing_quote_ptr=@65;modifies_right_head=@59;opening_quote_ptr=@56;semantic_modifier_of=@59	57	58
+light mystery	adj *noun:common	light mystery		{???}	nb=sg;human=0;agent_of_verb=@60;closing_quote_ptr=@65;modified_on_left=@57;opening_quote_ptr=@56	57	59
+mystery	noun:common	mystery		mystère	nb=sg;human=0;agent_of_verb=@60;closing_quote_ptr=@65;modified_by_adj=@58;modified_on_left=@57;opening_quote_ptr=@56	58	59
+maintains	verb:plain	maintain		maintenir	agent_of_action=@59;closing_quote_ptr=@65;dirobj=@61;govern=@61;modified_by_prep1=@62;object_of_action=@61;opening_quote_ptr=@56	59	60
+interest	noun:common	interest		intérêt	nb=sg;human=0;closing_quote_ptr=@65;dirobj_of=@60;object_of_verb=@60;opening_quote_ptr=@56	60	61
+interest to the end	*noun:common prep det noun:common	interest to the end		{???}	nb=sg;human=0;closing_quote_ptr=@65;dirobj_of=@60;object_of_verb=@60;opening_quote_ptr=@56	60	64
+to	prep	to		$$$	closing_quote_ptr=@65;dirobj=@64;govern=@64;governed_by=@60;opening_quote_ptr=@56	61	62
+to the end	*prep det noun:common	to the end		{???}	closing_quote_ptr=@65;governed_by=@60;opening_quote_ptr=@56	61	64
+the	det	the		le	closing_quote_ptr=@65;modifies_right_head=@64;opening_quote_ptr=@56	62	63
+end	noun:common	end		fin	nb=sg;human=0;closing_quote_ptr=@65;dirobj_of=@62;modified_on_left=@63;opening_quote_ptr=@56	63	64
+"	punct	"		"	closing_quote_ptr=@65;opening_quote_ptr=@56	64	65
+.	punct	.		.		65	66
+---------------------------------------
++++++++++++++++++++++++++++++++++++++++

File pyxtraction/corpus/test.py

+
+import sys
+
+def main(p):
+    with open(p) as f:
+        data = f.read().split('\n')
+        for line in data:
+            print(line.split('\t'))
+
+
+if __name__ == '__main__':
+    if len(sys.argv) > 1:
+        main(sys.argv[1])
+    else:
+        print('%s file' % sys.argv[0])

File pyxtraction/document.py

+
+
+class Document:
+    def __init__(self, url):
+        self.url = url
+        self.words = []
+
+    def addWord(self, id):
+        self.words.append(id)
+
+    def getWords(self):
+        return self.words
+
+    def getNbTerms(self):
+        return len(self.words)
+
+    def getUrl(self):
+        return self.url
+
+    def __iter__(self):
+        return (w for w in self.words)

File pyxtraction/index.py

+
+class Index:
+
+    def __init__(self):
+        self.word2id = {}
+        self.id2word = {}
+        self.nextId = 0
+
+    def addWord(self, word):
+        if word in self.word2id:
+            return self.word2id[word]
+        else:
+            self.word2id[word] = self.nextId
+            self.id2word[self.nextId] = word
+            self.nextId += 1
+            return (self.nextId - 1)
+
+    def getWord(self, id):
+        if id in self.id2word:
+            return self.id2word[id]
+        else:
+            return None
+
+    def getId(self, word):
+        if word in self.word2id:
+            return self.word2id[word]
+        else:
+            return None
+
+    def getNbTerms(self):
+        return self.nextId

File pyxtraction/lsi.py

+
+import numpy
+
+def lsi(terms, k):
+    U, s, V = numpy.linalg.svd(terms, full_matrices = True)
+
+    # extract k first singular values
+    s = numpy.diag(s[0 : k - 1])
+    U = U[:, 0 : k - 1]
+    V = V[0 : k - 1, :]
+
+    return U, s, V

File pyxtraction/main.py

+#! /usr/bin/python
+
+from sys import argv
+from corpus import Corpus
+from termDocumentMatrix import *
+from lsi import lsi
+
+from scipy.cluster.vq import whiten, kmeans, vq
+
+
+def main(path):
+    print('Creating corpus from:', path)
+    corpus = Corpus(path)
+    print('Creating term document matrix')
+    matrix = tf(corpus).T
+
+    # Latent Semantic Indexing
+    U, s, V = lsi(matrix, 2)
+
+    # Clustering of documents using kmeans
+    whitened = whiten(U * s * V)
+    centroids, distortion = kmeans(whitened, 2)
+    clusters, dist = vq(whitened, centroids)
+
+    print(clusters)
+
+
+
+if __name__ == '__main__':
+    if len(argv) > 1:
+        main(argv[1])
+    else:
+        print(argv[0], 'corpus_path')

File pyxtraction/preprocessor.py

+
+import re
+from wordAnalyzed import Token
+
+def getTokens(f):
+    tokens = []
+
+    # Filter tokens to keep nouns
+    good = re.compile('noun|verb|adj')
+
+    for line in f:
+        if good.search(line):
+            tags = line.split('\t')
+            if len(tags) > 1:
+                tokens.append(Token(line.split('\t')))
+
+    return tokens

File pyxtraction/termDocumentMatrix.py

+
+from numpy import *
+
+def nb_occurences(corpus):
+    res = zeros(shape = (corpus.getNbTerms(), corpus.getNbDocuments()))
+    for d in corpus:
+        for w in d:
+            res[w, corpus.getId(d)] += 1
+    return res
+
+
+def tf(corpus):
+    res = zeros(shape = (corpus.getNbTerms(), corpus.getNbDocuments()))
+    for d in corpus:
+        for w in d:
+            res[w, corpus.getId(d)] += 1
+        res[:, corpus.getId(d)] /= d.getNbTerms()
+    return res
+
+
+def tf_idf(corpus):
+    pass # TODO

File pyxtraction/wordAnalyzed.py

+
+class Token:
+    # Token of the Systran analyse
+    def __init__(self, systranLine):
+        self.word = systranLine[0]
+        self.tag = systranLine[1]
+        self.lemma = systranLine[2]
+
+    def getTag(self):
+        return self.tag
+
+    def getWord(self):
+        return self.word
+
+    def getLemma(self):
+        return self.lemma