Statistics
| Revision:

root / tmp / org.txm.analec.rcp / src / org / txm / macro / urs / SchemaTypesMacro.groovy @ 1217

History | View | Annotate | Download (856 Bytes)

1
// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
2
// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
3
// @author mdecorde
4
// @author sheiden
5
// STANDARD DECLARATIONS
6
package org.txm.macro.urs
7

    
8
import org.kohsuke.args4j.*
9
import groovy.transform.Field
10
import org.txm.rcp.swt.widget.parameters.*
11
import org.txm.annotation.urs.*
12
import org.txm.searchengine.cqp.corpus.*
13

    
14
if (!(corpusViewSelection instanceof MainCorpus)) {
15
        println "Corpora selection is not a Corpus"
16
        return;
17
}
18

    
19
MainCorpus corpus = corpusViewSelection
20
def analecCorpus = URSCorpora.getCorpus(corpus);
21

    
22
def schemas = analecCorpus.getTousSchemas()
23
def set = new HashMap()
24
for (def s : schemas.collect { it.getType() }) {
25
        if (!set.containsKey(s)) set[s] = 0;
26
        set[s] = set[s] +1
27
}
28
println "Schemas types: "+set.sort() { it -> set[it]}