Statistics
| Revision:

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

History | View | Annotate | Download (1.6 kB)

1
package org.txm.test
2

    
3
import org.txm.functions.mesures.*;
4
import org.txm.searchengine.cqp.corpus.Corpus;
5
import org.txm.Toolbox
6
import org.txm.searchengine.cqp.corpus.*
7
import org.txm.searchengine.cqp.corpus.query.*
8
//import org.txm.rcpapplication.commands.*;
9

    
10
def corpus1 = CorpusManager.getCorpusManager().getCorpus("ALCESTE")
11
def corpus2 = CorpusManager.getCorpusManager().getCorpus("DISCOURS")
12
def corpus3 = CorpusManager.getCorpusManager().getCorpus("RENOUEE")
13
Mesures mesures = new Mesures([corpus1, corpus2, corpus3]);
14
mesures.add(new Magnitude('"je"%c expand to text', "word", false, Synthese.COUNTMATCHES));
15
mesures.add(new Magnitude('"je"%c expand to text', "word", false, Synthese.SUM));
16
mesures.add(new Magnitude('"je"%c expand to text', "word", true, Synthese.MEAN));
17
mesures.add(new Magnitude('"je"%c expand to text', "word", true, Synthese.QUARTILE));
18
mesures.add(new Proportion('"j.*"%c expand to text', "word", true, Synthese.COUNTMATCHES, '"j.*" expand to text', ['"j.....*"%c expand to text', '"j........*"%c expand to text']));
19
mesures.add(new Proportion('"j.*"%c expand to text', "word", true, Synthese.SUM, '"j.*" expand to text', ['"j.....*"%c expand to text', '"j........*"%c expand to text']));
20
mesures.add(new PresenceRate('"j.*" expand to text', "word", true, Synthese.SUM, '"je"'));
21
mesures.add(new PresenceRate('"j.*" expand to text', "word", true, Synthese.MIN, '"je"'));
22

    
23
File csvFile = new File("mesures.txt");
24
mesures.export(csvFile, "UTF-8", "\t", "");
25

    
26
monitor.syncExec(new Runnable() {
27
        public void run() {
28
        //        EditFile.openfile(csvFile);
29
        }
30
})
31

    
32
mesures.prettyPrint();