Statistics
| Revision:

root / tmp / org.txm.groovy.core / src / groovy / org / txm / scripts / export / exportCA.groovy @ 1000

History | View | Annotate | Download (875 Bytes)

1
package org.txm.scripts.export
2
import org.txm.Toolbox
3
import org.txm.searchengine.cqp.corpus.*
4
import org.txm.searchengine.cqp.corpus.query.*
5
import org.txm.ca.core.functions.CA
6
import org.txm.functions.ca.*
7

    
8
String moncorpus = "VOEUX"
9
String mapartition = "texts"
10

    
11

    
12
def corpus = CorpusManager.getCorpusManager().getCorpus(moncorpus) // mettre le nom du corpus en Majuscules ici
13
def partition = corpus.getPartition(mapartition);
14

    
15
for(Object o : partition.getResults())
16
{
17
        if(o instanceof CA)
18
        {
19
                CA ca = ((CA)o);
20
                File colinfosfile = new File(ca.getName()+"_colinfosfile.txt");
21
                File rowinfosfile = new File(ca.getName()+"_rowinfosfile.txt");
22
        
23
                
24
                ca.exportColInfos(colinfosfile, "UTF-8", "\t", "")
25
                ca.exportRowInfos(rowinfosfile, "UTF-8", "\t", "")
26
                
27
                println CA.getName()+" exported in : "+rowinfosfile.getAbsolutePath()+" and "+colinfosfile.getAbsolutePath()
28
        }
29
}