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

Cooccurrences.groovy (revision 148)
1
/**
2
 * Main.
3
 *
4
 * @param args the args
5
 */
6
// Copyright © 2010-2013 ENS de Lyon.
7
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
8
// Lyon 2, University of Franche-Comté, University of Nice
9
// Sophia Antipolis, University of Paris 3.
10
// 
11
// The TXM platform is free software: you can redistribute it
12
// and/or modify it under the terms of the GNU General Public
13
// License as published by the Free Software Foundation,
14
// either version 2 of the License, or (at your option) any
15
// later version.
16
// 
17
// The TXM platform is distributed in the hope that it will be
18
// useful, but WITHOUT ANY WARRANTY; without even the implied
19
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20
// PURPOSE. See the GNU General Public License for more
21
// details.
22
// 
23
// You should have received a copy of the GNU General
24
// Public License along with the TXM platform. If not, see
25
// http://www.gnu.org/licenses.
26
// 
27
// 
28
// 
29
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
30
// $LastChangedRevision: 2386 $
31
// $LastChangedBy: mdecorde $ 
1
///**
2
// * Main.
3
// *
4
// * @param args the args
5
// */
6
//// Copyright © 2010-2013 ENS de Lyon.
7
//// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
8
//// Lyon 2, University of Franche-Comté, University of Nice
9
//// Sophia Antipolis, University of Paris 3.
10
//// 
11
//// The TXM platform is free software: you can redistribute it
12
//// and/or modify it under the terms of the GNU General Public
13
//// License as published by the Free Software Foundation,
14
//// either version 2 of the License, or (at your option) any
15
//// later version.
16
//// 
17
//// The TXM platform is distributed in the hope that it will be
18
//// useful, but WITHOUT ANY WARRANTY; without even the implied
19
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20
//// PURPOSE. See the GNU General Public License for more
21
//// details.
22
//// 
23
//// You should have received a copy of the GNU General
24
//// Public License along with the TXM platform. If not, see
25
//// http://www.gnu.org/licenses.
26
//// 
27
//// 
28
//// 
29
//// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
30
//// $LastChangedRevision: 2386 $
31
//// $LastChangedBy: mdecorde $ 
32
////
33
//package org.txm.test
32 34
//
33
package org.txm.test
34

  
35
// we import the packages containing the functions we are going to use
36
import org.txm.Toolbox
37
import org.txm.searchengine.cqp.corpus.*
38
import org.txm.searchengine.cqp.corpus.query.*
39
import org.txm.functions.cooccurrences.*
40

  
41
// TODO: Auto-generated Javadoc
42
/* (non-Javadoc)
43
 * @see groovy.lang.Script#run()
44
 */
45
def discours = CorpusManager.getCorpusManager().getCorpus("DISCOURS")
46

  
47
def word = discours.getProperty("word")
48
def pos = discours.getProperty("pos")
49

  
50
def limit = discours.getStructuralUnit("s")
51
def minleft = 1
52
def maxleft = 2
53
def minright = 1
54
def maxright = 2
55

  
56
def minf = 0
57
def mincof = 0
58
def minscore = 0
59

  
60
def query = new Query(Query.fixQuery("je"))
61

  
62
//long time = System.currentTimeMillis()
63

  
64
def cooccurrence = new Cooccurrence(discours, query, [word], limit, minleft, maxleft, minright, maxright, minf, mincof, minscore)
65
cooccurrence.process();
66
//cooccurrence.compute()
67

  
68
//println("Compute time : "+(System.currentTimeMillis()-time)+" ms")
69

  
70

  
71
def file = new File("cooc.txt")
72
cooccurrence.toTxt(file)
73

  
74
println "printed cooccurrents in "+file.getAbsolutePath()
75

  
35
//// we import the packages containing the functions we are going to use
36
//import org.txm.Toolbox
37
//import org.txm.searchengine.cqp.corpus.*
38
//import org.txm.searchengine.cqp.corpus.query.*
39
//import org.txm.functions.cooccurrences.*
40
//
41
//// TODO: Auto-generated Javadoc
42
///* (non-Javadoc)
43
// * @see groovy.lang.Script#run()
44
// */
45
//def discours = CorpusManager.getCorpusManager().getCorpus("DISCOURS")
46
//
47
//def word = discours.getProperty("word")
48
//def pos = discours.getProperty("pos")
49
//
50
//def limit = discours.getStructuralUnit("s")
51
//def minleft = 1
52
//def maxleft = 2
53
//def minright = 1
54
//def maxright = 2
55
//
56
//def minf = 0
57
//def mincof = 0
58
//def minscore = 0
59
//
60
//def query = new Query(Query.fixQuery("je"))
61
//
62
////long time = System.currentTimeMillis()
63
//
64
//def cooccurrence = new Cooccurrence(discours, query, [word], limit, minleft, maxleft, minright, maxright, minf, mincof, minscore)
65
//cooccurrence.process();
66
////cooccurrence.compute()
67
//
68
////println("Compute time : "+(System.currentTimeMillis()-time)+" ms")
69
//
70
//
71
//def file = new File("cooc.txt")
72
//cooccurrence.toTxt(file)
73
//
74
//println "printed cooccurrents in "+file.getAbsolutePath()
75
//

Also available in: Unified diff