Statistics
| Revision:

root / tmp / org.txm.groovy.core / src / groovy / org / txm / test / ProgressionSample.groovy @ 479

History | View | Annotate | Download (2.6 kB)

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")