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

ProgressionSample.groovy (revision 479)
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 java.util.List;
3

  
4
import org.txm.progression.core.functions.Progression
5
import org.txm.searchengine.cqp.corpus.Corpus;
6
import org.txm.searchengine.cqp.corpus.StructuralUnit;
7
import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
8
import org.txm.searchengine.cqp.corpus.query.Query;
9
import org.txm.Toolbox
10
import org.txm.searchengine.cqp.corpus.*
11
import org.txm.searchengine.cqp.corpus.query.*
12
import org.txm.functions.progression.*
13
import org.txm.stat.engine.r.*;
14

  
15
def discours = CorpusManager.getCorpusManager().getCorpus("DISCOURS");
16

  
17
def q1 = new Query(Query.fixQuery("je|j'"))
18
def q2 = new Query(Query.fixQuery("tu"))
19
def q3 = new Query(Query.fixQuery("il"))
20
def q4 = new Query(Query.fixQuery("elle"))
21
def q5 = new Query(Query.fixQuery("on"))
22
def q6 = new Query(Query.fixQuery("nous"))
23
def q7 = new Query(Query.fixQuery("vous"))
24
def q8 = new Query(Query.fixQuery("ils"))
25
def q9 = new Query(Query.fixQuery("elles"))
26
def q10 = new Query(Query.fixQuery("eux"))
27
def q11 = new Query(Query.fixQuery("ceux"))
28
def q12 = new Query(Query.fixQuery("autre|autres"))
29
def q13 = new Query(Query.fixQuery("monde"))
30
def q14 = new Query(Query.fixQuery("France"))
31
def q15 = new Query(Query.fixQuery("Algérie"))
32
def q16 = new Query(Query.fixQuery("Europe"))
33

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

  
54
File outputdir = new File("/home/mdecorde/Bureau")
55
File svgFile5 = new File(outputdir, "progression5");
56
File svgFile10 = new File(outputdir, "progression10");
57
File svgFile16 = new File(outputdir, "progression16");
58

  
59
progression5.toSvg(svgFile5, RDevice.SVG);
60
progression10.toSvg(svgFile10, RDevice.SVG);
61
progression16.toSvg(svgFile16, RDevice.SVG);
62

  
63
OpenSVGGraph.OpenSVGFile(svgFile5.getAbsolutePath(), "progression5")
64
OpenSVGGraph.OpenSVGFile(svgFile10.getAbsolutePath(), "progression10")
65
OpenSVGGraph.OpenSVGFile(svgFile16.getAbsolutePath(), "progression16")

Also available in: Unified diff