Revision 148 tmp/org.txm.core/src/groovy/org/txm/test/ProgressionSample.groovy

ProgressionSample.groovy (revision 148)
1
package org.txm.test;
2
import org.txm.functions.progression.*
3
import org.txm.searchengine.cqp.corpus.*
4
import org.txm.searchengine.cqp.corpus.query.*
5
import org.txm.stat.engine.r.*
6

  
7
def discours = CorpusManager.getCorpusManager().getCorpus("DISCOURS");
8

  
9
def q1 = new Query(Query.fixQuery("je|j'"))
10
def q2 = new Query(Query.fixQuery("tu"))
11
def q3 = new Query(Query.fixQuery("il"))
12
def q4 = new Query(Query.fixQuery("elle"))
13
def q5 = new Query(Query.fixQuery("on"))
14
def q6 = new Query(Query.fixQuery("nous"))
15
def q7 = new Query(Query.fixQuery("vous"))
16
def q8 = new Query(Query.fixQuery("ils"))
17
def q9 = new Query(Query.fixQuery("elles"))
18
def q10 = new Query(Query.fixQuery("eux"))
19
def q11 = new Query(Query.fixQuery("ceux"))
20
def q12 = new Query(Query.fixQuery("autre|autres"))
21
def q13 = new Query(Query.fixQuery("monde"))
22
def q14 = new Query(Query.fixQuery("France"))
23
def q15 = new Query(Query.fixQuery("Algérie"))
24
def q16 = new Query(Query.fixQuery("Europe"))
25

  
26
//Progression(Corpus corpus, List<Query> queries,
27
//			StructuralUnit structure, StructuralUnitProperty property, String propertyregex,
28
//			boolean doCumulative, boolean monochrome, boolean monostyle, 
29
//			int linewidth, boolean repeat, float bandemultiplier) {
30
		
31
int linewidth = 2;
32
float bandewidth = 1.0f
33
___Progression progression5 = new Progression(discours, [q1, q2, q3, q4, q5],
34
	null, null,	"", 
35
	true, false, false, 
36
	linewidth, false, bandewidth);
37
___Progression progression10 = new Progression(discours, [q1, q2, q3, q4, q5, q6, q7, q8, q9, q10],
38
	null, null,	"", 
39
	true, false, false, 
40
	linewidth, false, bandewidth);
41
___Progression progression16 = new Progression(discours, [q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14, q15, q16],
42
	null, null,	"", 
43
	true, false, false, 
44
	linewidth, false, bandewidth);
45

  
46
File outputdir = new File("/home/mdecorde/Bureau")
47
File svgFile5 = new File(outputdir, "progression5");
48
File svgFile10 = new File(outputdir, "progression10");
49
File svgFile16 = new File(outputdir, "progression16");
50

  
51
progression5.toSvg(svgFile5, __RDevice.SVG);
52
progression10.toSvg(svgFile10, __RDevice.SVG);
53
progression16.toSvg(svgFile16, __RDevice.SVG);
54

  
55
OpenSVGGraph.OpenSVGFile(svgFile5.getAbsolutePath(), "progression5")
56
OpenSVGGraph.OpenSVGFile(svgFile10.getAbsolutePath(), "progression10")
57
OpenSVGGraph.OpenSVGFile(svgFile16.getAbsolutePath(), "progression16")
1
//package org.txm.test;
2
//import org.txm.functions.progression.*
3
//import org.txm.searchengine.cqp.corpus.*
4
//import org.txm.searchengine.cqp.corpus.query.*
5
//import org.txm.stat.engine.r.*
6
//
7
//def discours = CorpusManager.getCorpusManager().getCorpus("DISCOURS");
8
//
9
//def q1 = new Query(Query.fixQuery("je|j'"))
10
//def q2 = new Query(Query.fixQuery("tu"))
11
//def q3 = new Query(Query.fixQuery("il"))
12
//def q4 = new Query(Query.fixQuery("elle"))
13
//def q5 = new Query(Query.fixQuery("on"))
14
//def q6 = new Query(Query.fixQuery("nous"))
15
//def q7 = new Query(Query.fixQuery("vous"))
16
//def q8 = new Query(Query.fixQuery("ils"))
17
//def q9 = new Query(Query.fixQuery("elles"))
18
//def q10 = new Query(Query.fixQuery("eux"))
19
//def q11 = new Query(Query.fixQuery("ceux"))
20
//def q12 = new Query(Query.fixQuery("autre|autres"))
21
//def q13 = new Query(Query.fixQuery("monde"))
22
//def q14 = new Query(Query.fixQuery("France"))
23
//def q15 = new Query(Query.fixQuery("Algérie"))
24
//def q16 = new Query(Query.fixQuery("Europe"))
25
//
26
////Progression(Corpus corpus, List<Query> queries,
27
////			StructuralUnit structure, StructuralUnitProperty property, String propertyregex,
28
////			boolean doCumulative, boolean monochrome, boolean monostyle, 
29
////			int linewidth, boolean repeat, float bandemultiplier) {
30
//		
31
//int linewidth = 2;
32
//float bandewidth = 1.0f
33
//Progression progression5 = new Progression(discours, [q1, q2, q3, q4, q5],
34
//	null, null,	"", 
35
//	true, false, false, 
36
//	linewidth, false, bandewidth);
37
//___Progression progression10 = new Progression(discours, [q1, q2, q3, q4, q5, q6, q7, q8, q9, q10],
38
//	null, null,	"", 
39
//	true, false, false, 
40
//	linewidth, false, bandewidth);
41
//___Progression progression16 = new Progression(discours, [q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14, q15, q16],
42
//	null, null,	"", 
43
//	true, false, false, 
44
//	linewidth, false, bandewidth);
45
//
46
//File outputdir = new File("/home/mdecorde/Bureau")
47
//File svgFile5 = new File(outputdir, "progression5");
48
//File svgFile10 = new File(outputdir, "progression10");
49
//File svgFile16 = new File(outputdir, "progression16");
50
//
51
//progression5.toSvg(svgFile5, __RDevice.SVG);
52
//progression10.toSvg(svgFile10, __RDevice.SVG);
53
//progression16.toSvg(svgFile16, __RDevice.SVG);
54
//
55
//OpenSVGGraph.OpenSVGFile(svgFile5.getAbsolutePath(), "progression5")
56
//OpenSVGGraph.OpenSVGFile(svgFile10.getAbsolutePath(), "progression10")
57
//OpenSVGGraph.OpenSVGFile(svgFile16.getAbsolutePath(), "progression16")

Also available in: Unified diff