Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/Frpos2CategorieMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/Frpos2CategorieMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/Frpos2CategorieMacro.groovy	(revision 1852)
@@ -1,252 +0,0 @@
-// @author Bruno Oberlé (2017-04-01 21:50)
-
-/*
-Définit la catégorie grammaticale du maillon d'après le champ `frpos'
-(tagset de TreeTagger).  Le script est adapté de
-http://svn.code.sf.net/p/txm/code/trunk/plugins/Analec/AnalecRCP/src/org/txm/macro/analec/Fropos2CategorieMacro.groovy.
-
-Voici la liste des catégories grammaticales retenues (manuel d'annotation de
-Democrat):
-- GN: Groupe Nominal (le petit chat, le chat, le même, ce chat etc.)
-- POSS: Possessif (mon, ton son, ma, ta, sa, mes, tes, ses, notre, votre,
-  leur, nos, vos, leurs)
-- PR: Pronom (moi, toi, lui, elle, nous, vous, eux, elles, le tien, le mien,
-  moi-même etc.)
-- PR_CL_O: Pronom Clitique Objet (me, te, le, la, les, lui, leur, y, en)
-- PR_CL_R: Pronom Clitique Réfléchi
-- PR_CL_S: Pronom Clitique Sujet (je, tu, il, elle, on, nous, vous, ils,
-  elles)
-- PR_REL: Pronom Relatif (qui, que, quoi, dont, où, lequel, quiconque etc.)
-- PR_WH: Pronom Interrogatif (qui, que, quoi, lequel etc.)
-
-Le script ne peut pas désambiguïser les pronoms clitiques de même forme
-(`nous' est-il un sujet, un objet ou un réfléchi?).  Dans ce cas, le script
-opte pour le sujet (ou pour l'objet si l'ambiguïté n'est que entre objet et
-réfléchi).
-
-Quand il n'y a aucune information disponible (erreurs de l'étiqueteur), la
-valeur est UNDEFINED.
-
-L'algorithme est décrit ici:
-https://groupes.renater.fr/wiki/democrat/prive/txm_annotation_exploitation
-
-*/
-
-package org.txm.macro.urs
-
-import org.apache.commons.lang.*
-import org.kohsuke.args4j.*
-import groovy.transform.*
-import org.txm.*
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.*
-import org.txm.searchengine.cqp.corpus.*
-import visuAnalec.Message.*
-import visuAnalec.donnees.*
-import visuAnalec.elements.*
-import visuAnalec.vue.*
-
-def testClitic(def position, def frpos) {
-
-   // je me sers de la forme, parce qu'il est difficile de savoir quel est le
-   // lemme de "elle" ("il"?), de "te" ("tu"?) ou encore de "leur"
-   def form = CQI.cpos2Str(word.getQualifiedName(), position)[0].toLowerCase()
-   if (     form == "je" || form == "j'"
-         || form == "tu" || form == "t'"
-         || form == "il"
-         || form == "elle"
-         || form == "on"
-         || form == "vous"
-         || form == "nous"
-         || form == "ils"
-         || form == "elles" ) {
-      return "PR_CL_S"
-   } else if (form == "me" || form == "m'"
-           || form == "te"
-           || form == "le" || form == "l'"
-           || form == "la"
-           || form == "lui"
-           || form == "leur"
-           || form == "les" ) {
-      return "PR_CL_O"
-   } else if (form == "se" || form == "s'") {
-      return "PR_CL_R"
-   }
-   return null
-
-}
-
-def testPhrase(def positions, def Mention) {
-
-   // on doit regarder ce qui apparaît en premier:
-   // - ce peut être un nom, comme dans `le petit chat que j'ai adopté'
-   // - ce peut être un pronom relatif, comme dans `(le livre) dans lequel
-   // j'ai lu cette histoire...'
-   // NOTE: dans Democrat, on n'annote pas, bizarrement, la relative dans le
-   // maillon, donc, dans un GN on n'a jamais de relatif inclus.  On aura donc
-   // toujours `[le petit chat] [que] [j']ai adopté'.  Mais tout le monde
-   // n'annote pas de la sorte...
-   for (def i=0; i<Mention.length; i++) {
-         def mention = Mention[i]
-         //def form = CQI.cpos2Str(word.getQualifiedName(), positions[i])[0]
-         if (mention == "NOM" || mention == "NAM") {
-            return "GN"
-         } else if (mention == "PRO:REL") {
-            return "PR_REL"
-         }
-    }
-
-    return null
-
-}
-
-def testWhPronoun(position, mention) {
-   def form = CQI.cpos2Str(word.getQualifiedName(), position)[0]
-   if (mention == "PRO" && (form == "qui" || form == "que" || form == "lequel")) {
-      return "PR_WH"
-   }
-   return null
-
-}
-
-def testRules(def positions, def Mention) {
-	def catégorie = null
-
-   // a possessive (mon, ma...)
-   if (Mention.length == 1 && Mention.contains("DET:POS"))
-      catégorie = "POSS"
-
-   // a clitic (subject: je, tu...; object: me, te; reflexive: se)
-   if (!catégorie && Mention.length == 1 && Mention.contains("PRO:PER"))
-      catégorie = testClitic(positions[0], Mention[0])
-
-   // an interrogative pronoun
-   if (!catégorie && Mention.length == 1)
-      catégorie = testWhPronoun(positions[0], Mention[0])
-
-   // a noun phrase or a relative pronoun
-   if (!catégorie)
-      catégorie = testPhrase(positions, Mention)
-
-   // some other kind of pronouns
-   if (!catégorie
-         && (   Mention.contains("PRO")
-             || Mention.contains("PRO:POSS")
-             || Mention.contains("PRO:IND")
-             || Mention.contains("PRO:DEM")
-             || Mention.contains("PRO:PER") )
-         && !Mention.contains("NOM")
-         && !Mention.contains("NAM") )
-      catégorie = "PRO"
-
-// Fin des règles, aucune n'a matchée. On stocke le pattern  qu'on affichera à la fin.
-   if (!catégorie) {
-      catégorie = "UNDEFINED" // clear the field
-		def forms = CQI.cpos2Str(word.getQualifiedName(), positions)
-		if (!errors.containsKey(Mention)) errors[Mention] = new HashSet()
-		errors[Mention] << forms
-	}
-	
-	return catégorie
-}
-
-//
-// FIN DE LA DÉFINITION DES RÈGLES
-//
-
-// CORPS DU SCRIPT
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return
-}
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="unit_type", usage="", widget="String", required=true, def="MENTION")
-def unit_type
-@Field @Option(name="pos_property_name", usage="", widget="String", required=true, def="pos")
-def pos_property_name
-@Field @Option(name="reset", usage="", widget="Boolean", required=true, def="true")
-def reset
-if (!ParametersDialog.open(this)) return
-
-corpus = corpusViewSelection
-CQI = CQPSearchEngine.getCqiClient()
-word = corpus.getWordProperty()
-posProperty = corpus.getProperty(pos_property_name)
-if (posProperty == null) {
-	println "Error: CQP corpus does not contains the word property with name=$pos_property_name"
-	return
-}
-analecCorpus = URSCorpora.getCorpus(corpus)
-vue = URSCorpora.getVue(corpus.getName())
-structure = analecCorpus.getStructure()
-if (!structure.getUnites().contains(unit_type)) { // check if the structure contains the unit_type units
-	println "Error: corpus structure does not contains unit with name=$unit_type"
-	return
-}
-
-CATEGORIE = "CATEGORIE"
-// Si la structure d'annotation ne contient pas CATEGORIE, on la crée avec ses valeurs
-if (!structure.getUniteProperties(unit_type).contains(CATEGORIE)) { 
-
-// FIXME: dans le script original (see also
-// http://forge.cbp.ens-lyon.fr/redmine/issues/2065), on utilise
-// analecCorpus.ajouterProp/Val, mais cela ne marche pas dans ma version de
-// TXM-Analec --> je retourne donc à structure.ajouterProp/Val
-
-// la propriété
-	structure.ajouterProp(Unite.class, unit_type, CATEGORIE)
-// les valeurs
-	structure.ajouterVal(Unite.class, unit_type, CATEGORIE, "GN")
-	structure.ajouterVal(Unite.class, unit_type, CATEGORIE, "POSS")
-	structure.ajouterVal(Unite.class, unit_type, CATEGORIE, "PRO")
-	structure.ajouterVal(Unite.class, unit_type, CATEGORIE, "PR_CL_O")
-	structure.ajouterVal(Unite.class, unit_type, CATEGORIE, "PR_CL_S")
-	structure.ajouterVal(Unite.class, unit_type, CATEGORIE, "PR_CL_R")
-	structure.ajouterVal(Unite.class, unit_type, CATEGORIE, "PR_REL")
-	structure.ajouterVal(Unite.class, unit_type, CATEGORIE, "PR_WH")
-//...
-}
-
-def nModified = 0
-def nIgnored = 0
-
-errors = new HashMap()
-def units = analecCorpus.getUnites(unit_type)
-units.sort() { a, b -> a.getDeb() <=> b.getDeb() ?: a.getFin() <=> b.getFin() }
-for (Unite unit : units) { // process all units
-	
-	def prop = unit.getProp(CATEGORIE)
-	if (!reset && prop != null && prop.length() > 0) continue // l'unité a déjà une CATEGORIE
-	
-	int[] positions = null
-	if (unit.getDeb() == unit.getFin()) positions = [unit.getDeb()]
-	else positions = (unit.getDeb()..unit.getFin())
-	
-	def Mention = CQI.cpos2Str(posProperty.getQualifiedName(), positions)
-	def cat = testRules(positions, Mention)
-
-	if (cat != null) {
-		// following line in the original script but doesn't work for me:
-      // vue.setValeurChamp(unit, CATEGORIE, cat)
-      unit.getProps().put(CATEGORIE, cat)
-		nModified++
-	} else {
-		nIgnored++
-	}
-}
-
-println "Result:"
-println "- $nModified units of type $unit_type have been modified."
-println "- $nIgnored units of type $unit_type have not been modified.\n"
-
-if (errors.size() > 0) {
-	println "Some rules should be added to this macro to process the following remaining 'FROPOS / words' values:"
-	errors.keySet().each { println "fropos="+it+"\twords="+errors[it].join(" | ") }
-}
-
-// udpate the view (also see also
-// http://forge.cbp.ens-lyon.fr/redmine/issues/2065)
-URSCorpora.getVue(analecCorpus).retablirVueParDefaut()
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/CreationChainesMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/CreationChainesMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/CreationChainesMacro.groovy	(revision 1852)
@@ -1,118 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-import visuAnalec.donnees.Structure;
-import visuAnalec.elements.Schema
-import visuAnalec.elements.Unite;
-import visuAnalec.vue.Vue
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="unit_type",usage="", widget="String", required=true, def="MENTION")
-String unit_type
-if (!ParametersDialog.open(this)) return;
-
-int nCreated = 0 // count the number of created CHAINE
-int nUpdated = 0 // count the number of updated CHAINE
-
-MainCorpus corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus); // analec corpus has the same name has the TXM corpus
-Structure structure = analecCorpus.getStructure()
-if (!structure.getUnites().contains(unit_type)) { // check if the structure contains the unit_type units
-	println "Error: corpus structure does not contains unit with name=$unit_type"
-	return
-}
-if (!structure.getSchemas().contains("CHAINE")) { // update the structure if needed
-	println "Creating the 'CHAINE' schema in the structure"
-	analecCorpus.ajouterType(Schema.class, "CHAINE")
-	analecCorpus.ajouterProp(Schema.class, "CHAINE", "REF")
-	analecCorpus.ajouterProp(Schema.class, "CHAINE", "GENRE")
-	analecCorpus.ajouterVal(Schema.class, "CHAINE", "GENRE", "INDETERMINABLE")
-	analecCorpus.ajouterVal(Schema.class, "CHAINE", "GENRE", "FEMININ")
-	analecCorpus.ajouterVal(Schema.class, "CHAINE", "GENRE", "MASCULIN")
-	analecCorpus.ajouterProp(Schema.class, "CHAINE", "NOMBRE")
-	analecCorpus.ajouterVal(Schema.class, "CHAINE", "NOMBRE", "GROUPE_FLOU")
-	analecCorpus.ajouterVal(Schema.class, "CHAINE", "NOMBRE", "GROUPE_STRICT")
-	analecCorpus.ajouterVal(Schema.class, "CHAINE", "NOMBRE", "SINGULIER")
-	analecCorpus.ajouterProp(Schema.class, "CHAINE", "NB MAILLONS")
-	analecCorpus.ajouterProp(Schema.class, "CHAINE", "TYPE REFERENT")
-	analecCorpus.ajouterVal(Schema.class, "CHAINE", "TYPE REFERENT", "UNKNOWN")
-	analecCorpus.ajouterVal(Schema.class, "CHAINE", "TYPE REFERENT", "CONCRET_OBJECT")
-	analecCorpus.ajouterVal(Schema.class, "CHAINE", "TYPE REFERENT", "ABSTRACT_OBJECT")
-	analecCorpus.ajouterVal(Schema.class, "CHAINE", "TYPE REFERENT", "TIME")
-	analecCorpus.ajouterVal(Schema.class, "CHAINE", "TYPE REFERENT", "PRODUCT")
-	analecCorpus.ajouterVal(Schema.class, "CHAINE", "TYPE REFERENT", "AMOUNT")
-	analecCorpus.ajouterVal(Schema.class, "CHAINE", "TYPE REFERENT", "EVENT")
-	analecCorpus.ajouterVal(Schema.class, "CHAINE", "TYPE REFERENT", "GPE")
-	analecCorpus.ajouterVal(Schema.class, "CHAINE", "TYPE REFERENT", "ORG")
-	analecCorpus.ajouterVal(Schema.class, "CHAINE", "TYPE REFERENT", "PERSON")
-	analecCorpus.ajouterVal(Schema.class, "CHAINE", "TYPE REFERENT", "LIEU")
-}
-
-def props = structure.getUniteProperties(unit_type)
-String REF = "REF"
-if (!props.contains(REF)) { // check the unit_type units have the REF property
-	println "Error: $unit_type units have no proprerty named 'REF'"
-	return
-}
-
-// parse the units to build CHAINES
-def chaines = [:]
-def units = analecCorpus.getUnites(unit_type)
-units.sort() { a, b -> a.getDeb() <=> b.getDeb() ?: a.getFin() <=> b.getFin() }
-for (Unite unit : units) {
-	def ref = unit.getProp(REF)
-	if (!chaines.containsKey(ref)) {
-		chaines[ref] = []
-	}
-	chaines[ref] << unit
-}
-
-// update the already existing CHAINES schemas
-for (Schema schema : analecCorpus.getSchemas("CHAINE")) {
-	String ref = schema.getProp(REF)
-	if (chaines.containsKey(ref)) { // the CHAINE exists 
-		// maj des unités de la chaine existante
-		int size_before = schema.getContenu().size()
-		for (def unit : chaines[ref]) schema.ajouter(unit) // insert the new units in the hashset
-		
-		// Update the CHAINE size
-		schema.props.put("NB MAILLONS", Integer.toString(schema.contenu.size())) 
-		
-		// remove the inserted CHAINE from 'chaines'
-		chaines.remove(ref)
-		if (size_before < schema.getContenu().size()) // if the size changed, then the CHAIEN have been updated
-			nUpdated++
-	}
-}
-
-// create the remaining CHAINES schemas
-for (def ref : chaines.keySet()) { // process the remaining CHAINE of 'chaines'
-	nCreated++;
-	Schema schema = new Schema()
-	schema.type = "CHAINE"
-	schema.props.put("REF", ref) 
-	schema.props.put("GENRE", "") // set default values
-	schema.props.put("NOMBRE", "") // set default values
-	schema.props.put("NB MAILLONS", Integer.toString(chaines[ref].size())) 
-	schema.props.put("TYPE REFERENT", "") // set default values
-	
-	for (def unit : chaines[ref]) schema.ajouter(unit) // insert the new units in the hashset
-	
-	analecCorpus.addSchemaLu(schema)  // add the new schema
-}
-
-println "nUpdated=$nUpdated"
-println "nCreated=$nCreated"
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/RelationsMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/RelationsMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/RelationsMacro.groovy	(revision 1852)
@@ -1,64 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// @author sheiden
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.tools.ant.types.resources.selectors.InstanceOf;
-import org.kohsuke.args4j.*
-
-import groovy.transform.Field
-
-import org.txm.Toolbox;
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.AbstractCqiClient;
-import org.txm.searchengine.cqp.corpus.*
-
-import visuAnalec.donnees.Structure;
-import visuAnalec.elements.Relation
-import visuAnalec.elements.Unite;
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="relation_type",usage="", widget="String", required=true, def="ANAPHORE")
-String relation_type
-
-if (!ParametersDialog.open(this)) return;
-
-MainCorpus corpus = corpusViewSelection
-AbstractCqiClient CQI = CQPSearchEngine.getCqiClient();
-def word = corpus.getWordProperty()
-def analecCorpus = URSCorpora.getCorpus(corpus);
-
-int n = 1;
-def relations = analecCorpus.getRelations(relation_type)
-for (Relation relation : relations) {
-	
-	def unit1 = relation.getElt1();
-	def unit2 = relation.getElt2();
-	def props = relation.getProps()
-	
-	if (unit1 instanceof Unite && unit2 instanceof Unite) {
-		int[] pos1 = null
-		if (unit1.getDeb() == unit1.getFin()) pos1 = [unit1.getDeb()]
-		else pos1 = (unit1.getDeb()..unit1.getFin())
-		def form1 = StringUtils.join(CQI.cpos2Str(word.getQualifiedName(), pos1), " ")
-		
-		int[] pos2 = null
-		if (unit2.getDeb() == unit2.getFin()) pos2 = [unit2.getDeb()]
-		else pos2 = (unit2.getDeb()..unit2.getFin())
-		def form2 = StringUtils.join(CQI.cpos2Str(word.getQualifiedName(), pos2), " ")
-		
-		println "$n - $props : $form1 -> $form2"
-	} else {
-		println "$n - $props"
-	}
-	n++
-}
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/ResetAnnotationsMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/ResetAnnotationsMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/ResetAnnotationsMacro.groovy	(revision 1852)
@@ -1,52 +0,0 @@
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-import visuAnalec.elements.*
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-@Field @Option(name="I_AM_SURE_IWANT_TO_RESET_THE_ANNOTATIONS", usage="an example boolean", widget="Boolean", required=false, def="false")
-def I_AM_SURE_IWANT_TO_RESET_THE_ANNOTATIONS
-
-// Open the parameters input dialog box
-if (!ParametersDialog.open(this)) return;
-
-MainCorpus corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus);
-def structure = analecCorpus.getStructure()
-
-Class[] classes = [Unite.class, Relation.class, Schema.class]
-println "Removing unites..."
-for (String type : structure.getTypes(Unite.class)) {
-	for (Unite unite : analecCorpus.getUnites(type).toArray(new Unite[0])) {
-		analecCorpus.supUnite(unite)
-	}
-//	fireMessage(new StructureEvent(analecCorpus, TypeModifStructure.SUPPR_TYPE, Unite.class, type));
-}
-
-println "Removing relations..."
-for (String type : structure.getTypes(Relation.class)) {
-	for (Relation relation : analecCorpus.getRelations(type).toArray(new Relation[0])) {
-		analecCorpus.supRelation(relation)
-	}
-//	fireMessage(new StructureEvent(analecCorpus, TypeModifStructure.SUPPR_TYPE, Relation.class, type));
-}
-
-println "Removing schemas..."
-for (String type : structure.getTypes(Schema.class)) {
-	for (Schema schema : analecCorpus.getSchemas(type).toArray(new Schema[0])) {
-		analecCorpus.supSchema(schema)
-	}
-//	fireMessage(new StructureEvent(analecCorpus, TypeModifStructure.SUPPR_TYPE, Schema.class, type));
-}
-
-println "Done. Save the corpus to finish the reset."
-
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/DensiteReferentielleMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/DensiteReferentielleMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/DensiteReferentielleMacro.groovy	(revision 1852)
@@ -1,74 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// @author sheiden
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-@Field @Option(name="unit_type",usage="", widget="String", required=false, def="Maillon")
-String unit_type
-
-@Field @Option(name="unit_property_name", usage="", widget="String", required=false, def="")
-String unit_property_name
-
-@Field @Option(name="unit_property_value", usage="", widget="String", required=false, def=".*")
-String unit_property_value
-
-if (!ParametersDialog.open(this)) return;
-// END OF PARAMETERS
-
-MainCorpus corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus);
-
-// check unit parameters
-if (!analecCorpus.getStructure().getUnites().contains(unit_type)) {
-	println "No unit with name=$unit_type"
-	return;
-} else {
-	if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
-		// test property existance
-		def props = analecCorpus.getStructure().getUniteProperties(unit_type);
-		if (!props.contains(unit_property_name)) {
-			println "Unit $unit_type has no property named $unit_property_name"
-			return;
-		}
-	}
-}
-
-int nMots = corpus.getSize();
-
-int nUnites = 0;
-	for (def unit : analecCorpus.getToutesUnites()) {
-		if (unit_type.length() > 0) {
-			if (!unit.getType().equals(unit_type)) {
-				continue
-			}
-		}
-		
-		if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
-			if (!unit.getProp(unit_property_name).matches(unit_property_value)) {
-				// ignoring this schema
-				continue
-			}
-		}
-	
-		nUnites++
-	}
-
-coef = (nUnites /nMots)
-println "densité référentielle : nUnites/nMots = $nUnites/$nMots = $coef = ${coef*100}%"
-if (nUnites >= nMots) {
-	println "WARNING: possible encoding error. Number of units ($nUnites) is greater than number of words ($nMots)"
-}
-return ["result":coef, "data":["nUnites":nUnites, "nMots":nMots]]
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/UnitsMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/UnitsMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/UnitsMacro.groovy	(revision 1852)
@@ -1,48 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// @author sheiden
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.apache.commons.lang.StringUtils;
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.Toolbox;
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.AbstractCqiClient;
-import org.txm.searchengine.cqp.CQPSearchEngine
-import org.txm.searchengine.cqp.corpus.*
-import visuAnalec.donnees.Structure;
-import visuAnalec.elements.Unite;
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="unit_type",usage="", widget="String", required=true, def="MENTION")
-String unit_type
-
-if (!ParametersDialog.open(this)) return;
-
-MainCorpus corpus = corpusViewSelection
-AbstractCqiClient CQI = CQPSearchEngine.getCqiClient();
-def word = corpus.getWordProperty()
-def analecCorpus = URSCorpora.getCorpus(corpus);
-
-int n = 1;
-def units = analecCorpus.getUnites(unit_type)
-units.sort() { a, b -> a.getDeb() <=> b.getDeb() ?: a.getFin() <=> b.getFin() }
-for (Unite unit : units) {
-	int[] pos = null
-	if (unit.getDeb() == unit.getFin()) pos = [unit.getDeb()]
-	else pos = (unit.getDeb()..unit.getFin())
-	def form = StringUtils.join(CQI.cpos2Str(word.getQualifiedName(), pos), " ")
-	
-	def props = unit.getProps().sort();
-	println "$n - ${unit.getDeb()} -> ${unit.getFin()} - $props : $form"
-	n++
-}
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/UnitTypesMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/UnitTypesMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/UnitTypesMacro.groovy	(revision 1852)
@@ -1,48 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// @author sheiden
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="schema_type",usage="", widget="String", required=true, def="Coréférence")
-String schema_type
-
-if (!ParametersDialog.open(this)) return;
-
-MainCorpus corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus);
-def map = new HashMap()
-def unitesInSchema = []
-def n = 0
-for (def schema : analecCorpus.getSchemas(schema_type)) {
-	def unites = schema.getUnitesSousjacentes()
-	unitesInSchema.addAll(unites)
-	n += unites.size()
-}
-
-def counts = unitesInSchema.countBy() { it };
-for (def c : counts.keySet()) {
-	if (counts[c] > 1) println "ERROR UNIT IN MULTIPLE SCHEMA["+c.getDeb()+", "+c.getFin()+"]="+c.getProps()+" in "+c.getSchemas().collect() {it.getProps()}
-}
-
-def set = new HashSet()
-set.addAll(unitesInSchema)
-for (def s : set.collect { it.getType() }) {
-	if (!map.containsKey(s)) map[s] = 0;
-	map[s] = map[s] +1
-}
-
-println "Unites types: "+map.sort() { it -> map[it]}
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/CategorieGrammaticaleMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/CategorieGrammaticaleMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/CategorieGrammaticaleMacro.groovy	(revision 1852)
@@ -1,169 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// @author sheiden
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.*
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-import org.apache.commons.lang.StringUtils;
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="schema_type",usage="", widget="String", required=true, def="Coréférence")
-String schema_type
-
-@Field @Option(name="minimum_schema_size", usage="", widget="Integer", required=true, def="3")
-int minimum_schema_size
-
-@Field @Option(name="schema_property_name",usage="", widget="String", required=false, def="")
-String schema_property_name
-
-@Field @Option(name="schema_property_value",usage="", widget="String", required=false, def=".*")
-String schema_property_value
-
-@Field @Option(name="schema_display_property_name",usage="", widget="String", required=false, def="Nom du référent")
-String schema_display_property_name
-
-@Field @Option(name="unit_type",usage="", widget="String", required=false, def="Maillon")
-String unit_type
-
-@Field @Option(name="unit_property_name", usage="", widget="String", required=false, def="")
-String unit_property_name
-
-@Field @Option(name="unit_property_value", usage="", widget="String", required=false, def=".*")
-String unit_property_value
-
-@Field @Option(name="word_property", usage="", widget="StringArray", metaVar="Catégorie	CATEGORIE	pos	fropos	frpos	word	lemma	frlemma	frolemma	#forme#", required=false, def="Catégorie")
-
-String word_property
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-// Open the parameters input dialog box
-if (!ParametersDialog.open(this)) return;
-// END OF PARAMETERS
-
-MainCorpus corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus)
-
-if (!analecCorpus.getStructure().getSchemas().contains(schema_type)) {
-	println "No schema with name=$schema_type"
-	return;
-} else {
-	if (schema_property_name.length() > 0 && schema_property_value.length() > 0) {
-		// test property existance
-		def props = analecCorpus.getStructure().getSchemaProperties(schema_type);
-		if (!props.contains(schema_property_name)) {
-			println "Schema $schema_type has no property named $schema_property_name"
-			return;
-		}
-	}
-}
-
-if (!analecCorpus.getStructure().getUnites().contains(unit_type)) {
-	println "No unit with name=$unit_type"
-	return;
-} else {
-	if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
-		// test property existance
-		def props = analecCorpus.getStructure().getUniteProperties(unit_type);
-		if (!props.contains(unit_property_name)) {
-			println "Unit $unit_type has no property named $unit_property_name"
-			return;
-		}
-	}
-}
-
-def CQI = CQPSearchEngine.getCqiClient()
-
-def prop = corpus.getProperty(word_property)
-if (prop == null) {
-	analecCorpus.getStructure()
-}
-def schemas = analecCorpus.getSchemas(schema_type)
-def allFreqs = [:]
-def n = 0
-for (def schema : schemas) {
-	n++
-	
-	def freqs = [:]
-	
-	if (schema_property_name.length() > 0 && schema_property_value.length() > 0) {
-		if (!schema.getProp(schema_property_name).matches(schema_property_value)) {
-			// ignoring this schema
-			continue
-		}
-	}
-	
-	def allUnites = schema.getUnitesSousjacentesNonTriees()
-	int nUnites = allUnites.size()
-	if (nUnites < minimum_schema_size) continue;
-
-	def units = []
-	for (def unit : allUnites) { // no need to sort units
-	
-		if (unit_type.length() > 0) {
-			if (!unit.getType().equals(unit_type)) {
-				continue
-			}
-		}
-		
-		if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
-			if (!unit.getProp(unit_property_name).matches(unit_property_value)) {
-				// ignoring this schema
-				continue
-			}
-		}
-		
-		String forme =  null;
-		if (prop == null) { // word_property is the analec unit property to use
-			forme = unit.getProp(word_property)
-		} else {
-			int[] pos = null;
-			if (unit.getDeb() == unit.getFin()) pos = [unit.getDeb()]
-			else pos = unit.getDeb()..unit.getFin()
-				
-			forme = StringUtils.join(CQI.cpos2Str(prop.getQualifiedName(), pos), " ") // ids is enough
-		}
-		
-		if (!freqs.containsKey(forme)) freqs[forme] = 0;
-		freqs[forme] = freqs[forme] + 1;
-		
-		if (!allFreqs.containsKey(forme)) allFreqs[forme] = 0;
-		allFreqs[forme] = allFreqs[forme] + 1;
-	}
-	
-	if (schema_display_property_name != null) {
-		println "index des natures de $unit_type de '"+schema.getProp(schema_display_property_name)+"' : "
-	} else {
-		println "index des natures de $schema_type - $n : "
-	}
-	
-	int max = 0;
-	def result = "";
-	for (def forme : freqs.sort() { a, b -> -a.value <=> -b.value ?: a.key <=> b.key }) {
-		println forme.key+"\t"+forme.value
-	}
-}
-
-int max = 0;
-def result = "";
-
-println "index des natures de $schema_type : "
-for (def forme : allFreqs.sort() { a, b -> -a.value <=> -b.value ?: a.key <=> b.key }) {
-	println forme.key+"\t"+forme.value
-	if (max < forme.value) {
-		max = forme.value
-		result = "$forme: "+forme.value
-	}
-}
-
-return ["result":result, "data":allFreqs]
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/CheckAnnotationStructureValuesMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/CheckAnnotationStructureValuesMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/CheckAnnotationStructureValuesMacro.groovy	(revision 1852)
@@ -1,69 +0,0 @@
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-import visuAnalec.elements.*
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-@Field @Option(name="unit_type",usage="", widget="String", required=false, def="Maillon")
-String unit_type
-
-@Field @Option(name="unit_property_name", usage="", widget="String", required=false, def="REF")
-String unit_property_name
-
-@Field @Option(name="pruneUnusedValues", usage="", widget="Boolean", required=false, def="false")
-boolean pruneUnusedValues
-
-// Open the parameters input dialog box
-if (!ParametersDialog.open(this)) return;
-
-// END OF PARAMETERS
-
-MainCorpus corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus);
-def structure = analecCorpus.getStructure()
-
-def unit_types = structure.getTypes(Unite.class);
-if (!unit_types.contains(unit_type)) {
-	println "Missing unit type: $unit_type"
-	return
-}
-
-def props = analecCorpus.getStructure().getUniteProperties(unit_type);
-if (!props.contains(unit_property_name)) {
-	println "No properties '$unit_property_name' in '$unit_type' unit."
-	return
-}
-
-def prop  = unit_property_name
-	
-def tmpvalues = new HashSet()
-tmpvalues.addAll(structure.getValeursProp(Unite.class, unit_type, prop));
-println "Values stored in the structure: $tmpvalues"
-	
-def used_values = new HashSet();
-def unites = analecCorpus.getUnites(unit_type);
-for (Unite unite : unites) {
-	used_values.add(unite.getProp(prop))
-}
-	
-tmpvalues.removeAll(used_values);
-if (tmpvalues.size() > 0) {
-	println "The following "+tmpvalues.size()+" value(s) are not used: $tmpvalues"
-	if (pruneUnusedValues) {
-		println "Pruning the values..."
-		for (String val : tmpvalues) {
-			structure.supprimerVal(Unite.class, unit_type, unit_property_name, val);
-		}
-	} 
-} else {
-	println "All the values are used."
-}
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/ChainesMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/ChainesMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/ChainesMacro.groovy	(revision 1852)
@@ -1,182 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// @author sheiden
-
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-import org.txm.Toolbox
-import org.txm.rcp.commands.*
-import org.apache.commons.lang.StringUtils
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="schema_type",usage="", widget="String", required=true, def="Coréférence")
-String schema_type
-
-@Field @Option(name="minimum_schema_size",usage="", widget="Integer", required=true, def="3")
-int minimum_schema_size
-
-@Field @Option(name="schema_property_name",usage="", widget="String", required=false, def="")
-String schema_property_name
-
-@Field @Option(name="schema_property_value",usage="", widget="String", required=false, def=".*")
-String schema_property_value
-
-@Field @Option(name="unit_type",usage="", widget="String", required=false, def="Maillon")
-String unit_type
-
-@Field @Option(name="unit_property_name", usage="", widget="String", required=false, def="")
-String unit_property_name
-
-@Field @Option(name="unit_property_value", usage="", widget="String", required=false, def=".*")
-String unit_property_value
-
-@Field @Option(name="word_property", usage="", widget="StringArray", metaVar="word	lemma	frlemma	frolemma	#forme#	id", required=false, def="word")
-String word_property
-
-@Field @Option(name="separator", usage="", widget="String", required=true, def=", ")
-String separator
-
-@Field @Option(name="buildCQL", usage="générer la requête des unités", widget="Boolean", required=true, def='false')
-def buildCQL
-
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpus view selection is not a Corpus"
-	return;
-}
-
-if (!ParametersDialog.open(this)) return;
-// END OF PARAMETERS
-
-MainCorpus corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus)
-
-// check Schema parameters
-if (!analecCorpus.getStructure().getSchemas().contains(schema_type)) {
-	println "No schema with name=$schema_type"
-	return;
-} else {
-	if (schema_property_name.length() > 0 && schema_property_value.length() > 0) {
-		// test property existance
-		def props = analecCorpus.getStructure().getSchemaProperties(schema_type);
-		if (!props.contains(schema_property_name)) {
-			println "Schema $schema_type has no property named $schema_property_name"
-			return;
-		}
-	}
-}
-
-// check unit parameters
-if (!analecCorpus.getStructure().getUnites().contains(unit_type)) {
-	println "No unit with name=$unit_type"
-	return;
-} else {
-	if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
-		// test property existance
-		def props = analecCorpus.getStructure().getUniteProperties(unit_type);
-		if (!props.contains(unit_property_name)) {
-			println "Unit $unit_type has no property named $unit_property_name"
-			return;
-		}
-	}
-}
-
-def CQI = CQPSearchEngine.getCqiClient()
-
-if (buildCQL) {
-	word_prop = corpus.getProperty("id")
-} else {
-	word_prop = corpus.getProperty(word_property)
-}
-
-def schemas = analecCorpus.getSchemas(schema_type)
-schemas.sort() {it.getProps()}
-def nSchemas = 0
-
-def lens = [:]
-for (def schema : schemas) {
-
-	if (schema_property_name.length() > 0 && schema_property_value.length() > 0) {
-		if (!schema.getProp(schema_property_name).matches(schema_property_value)) {
-			// ignoring this schema
-			continue
-		}
-	}
-	
-	def nUnites = 0
-	for (def unit : schema.getUnitesSousjacentes()) {
-		if (unit_type.length() > 0) {
-			if (!unit.getType().equals(unit_type)) {
-				continue
-			}
-		}
-		
-		if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
-			if (!unit.getProp(unit_property_name).matches(unit_property_value)) {
-				// ignoring this schema
-				continue
-			}
-		}
-
-		nUnites++
-	}
-
-	if (nUnites < minimum_schema_size) continue
-
-	print schema.getProps().toString()+ ": "
-	def first = true
-	for (def unit : schema.getUnitesSousjacentes()) {
-		if (unit_type.length() > 0) {
-			if (!unit.getType().equals(unit_type)) {
-				continue
-			}
-		}
-		
-		if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
-			if (!unit.getProp(unit_property_name).matches(unit_property_value)) {
-				// ignoring this schema
-				continue
-			}
-		}
-
-		String forme =  null;
-
-		if (buildCQL) {
-			int[] pos = null
-			if (unit.getDeb() == unit.getFin()) pos = [unit.getDeb()]
-			else pos = (unit.getDeb()..unit.getFin())
-			def first2= true
-			q = ""
-			pos.each {
-				if (first2) { first2 = false } else { q = q+" " }
-				int[] pos2 = [it]
-				q = q+"["+word_prop+"=\""+CQI.cpos2Str(word_prop.getQualifiedName(), pos2)[0]+"\"]"
-			}
-			if (first) { first = false } else { print "|" }
-			print "("+q+")"
-		} else {
-			if (word_prop == null) { // word_property is the analec unit property to use
-			forme = unit.getProp(word_property)
-			} else {
-			int[] pos = null
-			if (unit.getDeb() == unit.getFin()) pos = [unit.getDeb()]
-			else pos = (unit.getDeb()..unit.getFin())
-				
-			forme = StringUtils.join(CQI.cpos2Str(word_prop.getQualifiedName(), pos), " ") // ids is enough
-			}
-
-			if (first) { first = false } else { print separator }
-			print forme
-		}
-	}
-	println ""
-
-	nSchemas++
-}
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/CompUnitPropertiesMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/CompUnitPropertiesMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/CompUnitPropertiesMacro.groovy	(revision 1852)
@@ -1,62 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// @author sheiden
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.apache.commons.lang.StringUtils;
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.Toolbox;
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.AbstractCqiClient;
-import org.txm.searchengine.cqp.corpus.*
-import visuAnalec.donnees.Structure;
-import visuAnalec.elements.Unite;
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="unit_type",usage="", widget="String", required=true, def="MENTION")
-String unit_type
-
-@Field @Option(name="unit_property_name1", usage="", widget="String", required=false, def="CATEGORIE")
-String unit_property_name1
-
-@Field @Option(name="unit_property_name2", usage="", widget="String", required=false, def="CATEGORIE_ORIG")
-String unit_property_name2
-
-if (!ParametersDialog.open(this)) return;
-
-int n = 1;
-int nDiff = 0;
-MainCorpus corpus = corpusViewSelection
-AbstractCqiClient CQI = CQPSearchEngine.getCqiClient();
-def word = corpus.getWordProperty()
-def analecCorpus = URSCorpora.getCorpus(corpus);
-
-def units = analecCorpus.getUnites(unit_type)
-units.sort() { a, b -> a.getDeb() <=> b.getDeb() ?: a.getFin() <=> b.getFin() }
-for (Unite unit : units) {
-	int[] pos = null
-	if (unit.getDeb() == unit.getFin()) pos = [unit.getDeb()]
-	else pos = (unit.getDeb()..unit.getFin())
-	def form = StringUtils.join(CQI.cpos2Str(word.getQualifiedName(), pos), " ")
-	def props = unit.getProps()
-	def v1 = props.get(unit_property_name1);
-	def v2 = props.get(unit_property_name2);
-	
-	if (v1 != v2) {
-		println "$n - ${unit.getDeb()} -> ${unit.getFin()} - $props : $form"
-		nDiff++
-	}
-	n++
-}
-
-if (nDiff == 0) println "$unit_property_name1 and $unit_property_name2 have the same values."
-else println "$unit_property_name1 and $unit_property_name2 have $nDiff/$n different values."
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/UnitTypesInSchemaMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/UnitTypesInSchemaMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/UnitTypesInSchemaMacro.groovy	(revision 1852)
@@ -1,48 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// @author sheiden
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="schema_type",usage="", widget="String", required=true, def="Coréférence")
-String schema_type
-
-if (!ParametersDialog.open(this)) return;
-
-MainCorpus corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus);
-def map = new HashMap()
-def unitesInSchema = []
-def n = 0
-for (def schema : analecCorpus.getSchemas(schema_type)) {
-	def unites = schema.getUnitesSousjacentes()
-	unitesInSchema.addAll(unites)
-	n += unites.size()
-}
-
-def counts = unitesInSchema.countBy() { it };
-for (def c : counts.keySet()) {
-	if (counts[c] > 1) println "ERROR UNIT IN MULTIPLE SCHEMA["+c.getDeb()+", "+c.getFin()+"]="+c.getProps()+" in "+c.getSchemas().collect() {it.getProps()}
-}
-
-def set = new HashSet()
-set.addAll(unitesInSchema)
-for (def s : set.collect { it.getType() }) {
-	if (!map.containsKey(s)) map[s] = 0;
-	map[s] = map[s] +1
-}
-
-println "Unites types: "+map.sort() { it -> map[it]}
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/AllMesuresMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/AllMesuresMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/AllMesuresMacro.groovy	(revision 1852)
@@ -1,158 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// @author sheiden
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.*
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-import org.apache.commons.lang.StringUtils;
-
-// BEGINNING OF PARAMETERS
-
-@Field @Option(name="tsvFile",usage="", widget="FileSave", required=true, def="result.tsv")
-File tsvFile
-@Field @Option(name="default_schema_type",usage="", widget="String", required=true, def="Coréférence")
-String default_schema_type
-@Field @Option(name="default_minimum_schema_size", usage="", widget="Integer", required=true, def="3")
-int default_minimum_schema_size
-@Field @Option(name="default_schema_property_name",usage="", widget="String", required=false, def="")
-String default_schema_property_name
-@Field @Option(name="default_schema_property_value",usage="", widget="String", required=false, def=".*")
-String default_schema_property_value
-@Field @Option(name="schema_display_property_name",usage="", widget="String", required=false, def="Nom du référent")
-String schema_display_property_name
-@Field @Option(name="default_unit_type",usage="", widget="String", required=false, def="Maillon")
-String default_unit_type
-@Field @Option(name="default_unit_property_name", usage="", widget="String", required=false, def="")
-String default_unit_property_name
-@Field @Option(name="default_unit_property_value", usage="", widget="String", required=false, def=".*")
-String default_unit_property_value
-@Field @Option(name="default_word_property", usage="", widget="StringArray", metaVar="word	lemma	frlemma	frolemma #forme#", required=false, def="word")
-String default_word_property
-@Field @Option(name="default_pos_property", usage="", widget="StringArray", metaVar="Catégorie	pos	fropos	frpos", required=false, def="Catégorie")
-String default_pos_property
-
-if (!ParametersDialog.open(this)) return;
-// END OF PARAMETERS
-
-println "Corpora selections: "+corpusViewSelections
-
-table = [] // contains all table lines
-mesures = []
-
-for (def corpus : corpusViewSelections) { // for each corpus selected in the corpora view
-	if (!(corpus instanceof MainCorpus)) continue; // check if the corpus is a maincorpus
-	def line = [] ; table << line // create and add a new table line
-	line << corpus.getName() // add the corpus name in the first column
-	
-	println "*** Computing mesures for $corpus" // each macro return a "result" and a "data"
-
-	params = [
-		"unit_type":default_unit_type,
-		"unit_property_name":"",
-		"unit_property_value":"",
-	]
-	returnedValue = execMesure(DensiteReferentielleMacro, line, corpus, params)
-	line << returnedValue["result"]
-	
-	params = [
-		"schema_type":default_schema_type,
-		"minimum_schema_size":default_minimum_schema_size,
-		"schema_property_name":"",
-		"schema_property_value":"",
-		"unit_type":default_unit_type,
-		"unit_property_name":"",
-		"unit_property_value":"",
-	]
-	returnedValue = execMesure(LongueurMoyenneMacro, line, corpus, params)
-	line << returnedValue["result"]
-	
-	params = [
-		"schema_type":default_schema_type,
-		"minimum_schema_size":default_minimum_schema_size,
-		"schema_property_name":"",
-		"schema_property_value":"",
-		"unit_type":default_unit_type,
-		"unit_property_name":"",
-		"unit_property_value":"",
-	]
-	returnedValue = execMesure(NombreDeChainesMacro, line, corpus, params)
-	line << returnedValue["result"]
-	
-	params = [
-		"schema_type":default_schema_type,
-		"minimum_schema_size":default_minimum_schema_size,
-		"schema_property_name":"",
-		"schema_property_value":"",
-		"schema_display_property_name":schema_display_property_name,
-		"unit_type":default_unit_type,
-		"unit_property_name":"Catégorie",
-		"unit_property_value":"GN Défini|GN Démonstratif|Nom Propre",
-		"word_property":default_word_property,
-	]
-	returnedValue = execMesure(CoefficientStabiliteMacro, line, corpus, params)
-	line << returnedValue["result"]
-	
-	params = [
-		"schema_type":default_schema_type,
-		"minimum_schema_size":default_minimum_schema_size,
-		"schema_property_name":"",
-		"schema_property_value":"",
-		"unit_type":default_unit_type,
-		"unit_property_name":"",
-		"unit_property_value":"",
-	]
-	returnedValue = execMesure(DistanceInterMaillonnaireMacro, line, corpus, params)
-	line << returnedValue["result"]
-
-	params = [
-		"schema_type":default_schema_type,
-		"minimum_schema_size":default_minimum_schema_size,
-		"schema_property_name":"",
-		"schema_property_value":"",
-		"unit_type":default_unit_type,
-		"unit_property_name":"",
-		"unit_property_value":"",
-		"word_property":default_pos_property,
-	]
-	returnedValue = execMesure(NatureDuPremierMaillonMacro, line, corpus, params)
-	line << returnedValue["data"]
-	
-	params = [
-		"schema_type":default_schema_type,
-		"minimum_schema_size":default_minimum_schema_size,
-		"schema_property_name":"",
-		"schema_property_value":"",
-		"schema_display_property_name":schema_display_property_name,
-		"unit_type":default_unit_type,
-		"unit_property_name":"",
-		"unit_property_value":"",
-		"word_property":default_pos_property,
-	]
-	returnedValue = execMesure(CategorieGrammaticaleMacro, line, corpus, params)
-	line << returnedValue["data"]
-}
-
-// WRITE RESULTS IN THE TSV FILE
-tsvFile.withWriter("UTF-8") { writer ->
-	writer.println "\t"+mesures.join("\t")
-	table.each { line -> writer.println line.join("\t")	}
-}
-
-println "Done. Results are saved in ${tsvFile.getAbsolutePath()} file."
-
-// UTILITY FUNCTIONS
-def execMesure(def mesure, def line, def corpus, def params) {
-	def m = mesure.getSimpleName().substring(0, mesure.getSimpleName().indexOf("Macro"))
-	mesures << m
-	println "***** ${mesures.size()}- $m with parameters: $params"
-	def r = gse.run(mesure, ["args":params, "corpusViewSelection":corpus, "monitor":monitor])
-	if (r == null) throw new Exception("Null result");
-	return r;
-}
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/Fropos2CategorieMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/Fropos2CategorieMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/Fropos2CategorieMacro.groovy	(revision 1852)
@@ -1,145 +0,0 @@
-package org.txm.macro.urs
-
-import org.apache.commons.lang.*
-import org.kohsuke.args4j.*
-import groovy.transform.*
-import org.txm.*
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.*
-import org.txm.searchengine.cqp.corpus.*
-import visuAnalec.Message.*
-import visuAnalec.donnees.*
-import visuAnalec.elements.*
-import visuAnalec.vue.*
-
-def testRules(def positions, def Mention) {
-	def catégorie = null
-
-// DÉFINITION DES RÈGLES
-// elles sont testées les unes après les autres. 
-// Dès qu'une règle est appliquée les suivantes sont ignorées.
-
-// Règles de type CONTIENT
-
-	     if (Mention.contains("NOMpro")) catégorie = "Nom Propre"
-	else if (Mention.contains("DETpos")) catégorie = "Dét Possessif"
-//  ...
-
-// Règles de type COMMENCE ET NE CONTIENT PAS	
-
-	else if (Mention.first() == "DETpos" && !Mention.contains("NOMpro")) catégorie = "GN Possessif"
-	else if (Mention.first() == "DETdem" && !Mention.contains("NOMpro")) catégorie = "GN Démonstratif"
-//  ...
-
-// Règles de type CONTIENT PLUSIEURS	
-
-	else if (Mention.contains("PROadv") || Mention.contains("ADVgen.PROadv")) catégorie = "Pronom Adverbial"
-//  ...
-
-// Règles de type CONTIENT ET NE CONTIENT PAS
-
-	else if (
-			 ( Mention.contains("DETdef") || Mention.contains("PRE.DETdef") )
-			  &&
-			  !Mention.contains("PROpos") && !Mention.contains("NOMpro") && !Mention.contains("PROcar")
-			) catégorie = "GN Défini"
-//  ...	
-
-// Fin des règles, aucune n'a matchée. On stocke le pattern  qu'on affichera à la fin.
-	else {
-		def forms = CQI.cpos2Str(word.getQualifiedName(), positions)
-		if (!errors.containsKey(Mention)) errors[Mention] = new HashSet()
-		errors[Mention] << forms
-	}
-	
-	return catégorie
-}
-
-//
-// FIN DE LA DÉFINITION DES RÈGLES
-//
-
-// CORPS DU SCRIPT
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return
-}
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="unit_type", usage="", widget="String", required=true, def="MENTION")
-def unit_type
-@Field @Option(name="pos_property_name", usage="", widget="String", required=true, def="pos")
-def pos_property_name
-@Field @Option(name="reset", usage="", widget="Boolean", required=true, def="true")
-def reset
-if (!ParametersDialog.open(this)) return
-
-corpus = corpusViewSelection
-CQI = CQPSearchEngine.getCqiClient()
-word = corpus.getWordProperty()
-posProperty = corpus.getProperty(pos_property_name)
-if (posProperty == null) {
-	println "Error: CQP corpus does not contains the word property with name=$pos_property_name"
-	return
-}
-analecCorpus = URSCorpora.getCorpus(corpus)
-vue = URSCorpora.getVue(corpus.getName())
-structure = analecCorpus.getStructure()
-if (!structure.getUnites().contains(unit_type)) { // check if the structure contains the unit_type units
-	println "Error: corpus structure does not contains unit with name=$unit_type"
-	return
-}
-
-CATEGORIE = "CATEGORIE"
-// Si la structure d'annotation ne contient pas CATEGORIE, on la crée avec ses valeurs
-if (!structure.getUniteProperties(unit_type).contains(CATEGORIE)) { 
-// la propriété
-	analecCorpus.ajouterProp(Unite.class, unit_type, CATEGORIE)
-// les valeurs
-	analecCorpus.ajouterVal(Unite.class, unit_type, CATEGORIE, "Nom Propre")
-	analecCorpus.ajouterVal(Unite.class, unit_type, CATEGORIE, "Pronom Impersonnel")
-	analecCorpus.ajouterVal(Unite.class, unit_type, CATEGORIE, "Pronom Interrogatif")
-	analecCorpus.ajouterVal(Unite.class, unit_type, CATEGORIE, "Pronom Pronom cardinal")
-	analecCorpus.ajouterVal(Unite.class, unit_type, CATEGORIE, "Pronom Démonstratif")
-	analecCorpus.ajouterVal(Unite.class, unit_type, CATEGORIE, "Pronom Indéfini")
-	analecCorpus.ajouterVal(Unite.class, unit_type, CATEGORIE, "Pronom ordinal")
-	analecCorpus.ajouterVal(Unite.class, unit_type, CATEGORIE, "Pronom Relatif")
-//...
-}
-
-def nModified = 0
-def nIgnored = 0
-
-errors = new HashMap()
-def units = analecCorpus.getUnites(unit_type)
-units.sort() { a, b -> a.getDeb() <=> b.getDeb() ?: a.getFin() <=> b.getFin() }
-for (Unite unit : units) { // process all units
-	
-	def prop = unit.getProp(CATEGORIE)
-	if (!reset && prop != null && prop.length() > 0) continue // l'unité a déjà une CATEGORIE
-	
-	int[] positions = null
-	if (unit.getDeb() == unit.getFin()) positions = [unit.getDeb()]
-	else positions = (unit.getDeb()..unit.getFin())
-	
-	def Mention = CQI.cpos2Str(posProperty.getQualifiedName(), positions)
-	def cat = testRules(positions, Mention)
-	
-	if (cat != null) {
-		vue.setValeurChamp(unit, CATEGORIE, cat)
-		nModified++
-	} else {
-		nIgnored++
-	}
-}
-
-println "Result:"
-println "- $nModified units of type $unit_type have been modified."
-println "- $nIgnored units of type $unit_type have not been modified.\n"
-
-if (errors.size() > 0) {
-	println "Some rules should be added to this macro to process the following remaining 'FROPOS / words' values:"
-	errors.keySet().each { println "fropos="+it+"\twords="+errors[it].join(" | ") }
-}
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/PremierMaillonMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/PremierMaillonMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/PremierMaillonMacro.groovy	(revision 1852)
@@ -1,84 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// @author sheiden
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-
-import groovy.transform.Field
-
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-
-import visuAnalec.donnees.Structure;
-import visuAnalec.elements.Unite;
-import visuAnalec.vue.Vue
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="unit_type",usage="", widget="String", required=true, def="Maillon")
-String unit_type
-@Field @Option(name="reset",usage="", widget="Boolean", required=true, def="true")
-boolean reset
-
-if (!ParametersDialog.open(this)) return;
-
-MainCorpus corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus);
-Structure structure = analecCorpus.getStructure()
-if (!structure.getUnites().contains(unit_type)) { // check if the structure contains the unit_type units
-	println "Error: corpus structure does not contains unit with name=$unit_type"
-	return
-}
-def props = structure.getUniteProperties(unit_type)
-
-String NEW = "NEW"
-String REF = "REF"
-String YES = "YES"
-String NO = "NO"
-if (!props.contains(NEW)) { // update the structure if needed
-	analecCorpus.ajouterProp(Unite.class, unit_type, NEW);
-	analecCorpus.ajouterVal(Unite.class, unit_type, NEW, "YES");
-	analecCorpus.ajouterVal(Unite.class, unit_type, NEW, "NO");
-}
-
-if (!props.contains(REF)) { // check the unit_type units have the REF property
-	println "Error: $unit_type units have no proprerty named 'REF'"
-	return
-}
-
-int nIgnored = 0; // number of units ignored
-int nYes = 0 // number of "YES" unit set
-int nNo = 0 // number of "NO" unit set
-
-def allRefs = new HashSet<String>() // store the references already seen, allow to set the 'NEW' property to 'YES' or 'NO'
-def units = analecCorpus.getUnites(unit_type)
-units.sort() { a, b -> a.getDeb() <=> b.getDeb() ?: a.getFin() <=> b.getFin() }
-for (Unite unit : units) {
-	def prop = unit.getProp(NEW);
-	def ref = unit.getProp(REF);
-	if (reset || prop == null || prop.length() == 0) {
-		if (allRefs.contains(ref)) {
-			unit.getProps().put(NEW, NO)
-			nNo++
-		} else { // this is the first MENTION of the CHAINE
-			allRefs << ref
-			unit.getProps().put(NEW, YES)
-			nYes++
-		}
-	} else {
-		// nothing to do "NEW" already exists
-		nIgnored++
-	}
-}
-
-println "nIgnored=$nIgnored"
-println "nYes=$nYes"
-println "nNo=$nNo"
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/CoefficientStabiliteMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/CoefficientStabiliteMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/CoefficientStabiliteMacro.groovy	(revision 1852)
@@ -1,159 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// @author sheiden
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.*
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-import org.apache.commons.lang.StringUtils;
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="schema_type",usage="", widget="String", required=true, def="Coréférence")
-String schema_type
-
-@Field @Option(name="minimum_schema_size", usage="", widget="Integer", required=true, def="3")
-int minimum_schema_size
-
-@Field @Option(name="schema_property_name",usage="", widget="String", required=false, def="")
-String schema_property_name
-
-@Field @Option(name="schema_display_property_name",usage="", widget="String", required=false, def="Nom du référent")
-String schema_display_property_name
-
-@Field @Option(name="schema_property_value",usage="", widget="String", required=false, def=".*")
-String schema_property_value
-
-@Field @Option(name="unit_type",usage="", widget="String", required=false, def="Maillon")
-String unit_type
-
-@Field @Option(name="unit_property_name", usage="", widget="String", required=false, def="Catégorie")
-String unit_property_name
-
-@Field @Option(name="unit_property_value", usage="", widget="String", required=false, def="GN Défini|GN Démonstratif|Nom Propre")
-String unit_property_value
-
-@Field @Option(name="word_property", usage="", widget="StringArray", metaVar="word	lemma	frlemma	frolemma	#forme#", required=false, def="word")
-String word_property
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-// Open the parameters input dialog box
-if (!ParametersDialog.open(this)) return;
-// END OF PARAMETERS
-
-MainCorpus corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus)
-
-// check Schema parameters
-if (!analecCorpus.getStructure().getSchemas().contains(schema_type)) {
-	println "No schema with name=$schema_type"
-	return;
-} else {
-	if (schema_property_name.length() > 0 && schema_property_value.length() > 0) {
-		// test property existance
-		def props = analecCorpus.getStructure().getSchemaProperties(schema_type);
-		if (!props.contains(schema_property_name)) {
-			println "Schema $schema_type has no property named $schema_property_name"
-			return;
-		}
-	}
-}
-
-// check unit parameters
-if (!analecCorpus.getStructure().getUnites().contains(unit_type)) {
-	println "No unit with name=$unit_type"
-	return;
-} else {
-	if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
-		// test property existance
-		def props = analecCorpus.getStructure().getUniteProperties(unit_type);
-		if (!props.contains(unit_property_name)) {
-			println "Unit $unit_type has no property named $unit_property_name"
-			return;
-		}
-	}
-}
-
-def CQI = CQPSearchEngine.getCqiClient()
-
-def prop = corpus.getProperty(word_property)
-
-def schemas = analecCorpus.getSchemas(schema_type)
-allFormesSet = new HashSet();
-nUnitesGrandTotal = 0;
-def coefs = []
-int n = 1
-for (def schema : schemas) {
-	def formesSet = new HashSet(); // contient toutes les formes du CR courant
-	nUnitesTotal = 0;
-	if (schema_property_name.length() > 0 && schema_property_value.length() > 0) {
-		if (!schema.getProp(schema_property_name).matches(schema_property_value)) {
-			// ignoring this schema
-			continue
-		}
-	}
-	
-	def units = schema.getUnitesSousjacentesNonTriees()
-	def nUnites = units.size();
-	
-	if (nUnites < minimum_schema_size) continue;
-
-	for (def unit : units) {
-	
-		if (unit_type.length() > 0) {
-			if (!unit.getType().equals(unit_type)) {
-				continue
-			}
-		}
-		
-		if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
-			if (!unit.getProp(unit_property_name).matches(unit_property_value)) {
-				// ignoring this schema
-				continue
-			}
-		}
-		
-		String forme =  null;
-		if (prop == null) { // word_property is the analec unit property to use
-			forme = unit.getProp(word_property)
-		} else {
-			int[] pos = null;
-			if (unit.getDeb() == unit.getFin()) pos = [unit.getDeb()]
-			else pos = unit.getDeb()..unit.getFin()
-				
-			forme = StringUtils.join(CQI.cpos2Str(prop.getQualifiedName(), pos), " ") // ids is enough
-		}
-		
-		formesSet.add(forme)
-		
-		nUnitesTotal++
-	}
-	if (formesSet.size() == 0) {
-		coef = -1
-	} else {
-		coef = (nUnitesTotal/formesSet.size())
-	}
-	coefs << coef
-	nUnitesGrandTotal += nUnitesTotal;
-	allFormesSet.addAll(formesSet)
-	
-	if (schema_display_property_name != null) {
-		print schema.getProp(schema_display_property_name)
-	} else {
-		print schema_type+"-"+n+" : "
-	}
-	
-	println " ($nUnites units) : $nUnitesTotal selected units / ${formesSet.size()} forms = $coef"
-	n++
-}
-
-return ["result":coefs, "data":["nUnitesTotal":nUnitesGrandTotal, "allFormesSet":allFormesSet], "coef":(nUnitesGrandTotal/allFormesSet.size())]
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/ConcordanceToUnitMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/ConcordanceToUnitMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/ConcordanceToUnitMacro.groovy	(revision 1852)
@@ -1,92 +0,0 @@
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-
-import groovy.transform.Field
-
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.concordance.core.functions.*
-import org.txm.concordance.rcp.editors.ConcordanceEditor;
-
-// BEGINNING OF PARAMETERS
-
-@Field @Option(name="unit_type", usage="The unit type to create", widget="String", required=true, def="MENTION")
-def unit_type
-
-@Field @Option(name="create_only_if_new", usage="Create the unit if not already annotated", widget="Boolean", required=true, def="true")
-def create_only_if_new
-
-@Field @Option(name="type", usage="type", widget="String", required=true, def="true")
-def type
-
-@Field @Option(name="value", usage="default value", widget="String", required=true, def="true")
-def value
-
-// END OF PARAMETERS
-
-// get a Concordance from 1) current Concordance editor or 2) CorporaView selection
-Concordance concordance
-if (editor instanceof ConcordanceEditor) {
-	concordance = editor.getConcordance()
-} else if (corpusViewSelection instanceof Concordance) {
-	concordance = corpusViewSelection
-} else {
-	println "You must select a concordance or open a concordance result to run this macro."
-	return false
-}
-
-if (concordance == null) {
-	println "You must compute a concordance before."
-	return
-}
-
-// check the analec corpus is ready
-def corpus = concordance.getCorpus();
-String name = corpus.getMainCorpus().getName()
-if (!URSCorpora.isAnnotationStructureReady(name)) {
-	println "Annotation structure is not ready."
-	return
-}
-
-// Open the parameters input dialog box
-if (!ParametersDialog.open(this)) return
-
-// check the corpus structure has the unit_type provided
-def analecCorpus = URSCorpora.getCorpus(name)
-if (!analecCorpus.getStructure().getUnites().contains(unit_type)) {
-	println "The corpus structure does not contains unit with type=$unit_type"
-	return;
-}
-
-// browse lines and check 
-def units = analecCorpus.getUnites(unit_type)
-def lines = concordance.getLines()
-int iUnit = 0
-int n = 0
-for (int iLine = 0 ; iLine < lines.size() ; iLine++) { 
-	def line = lines[iLine]
-	def m = line.getMatch()
-	if (create_only_if_new && iUnit < units.size()) { // test only if create_only_if_new == true
-		def unit = null
-		while (iUnit < units.size() && units[iUnit].getDeb() < m.getStart()) {
-			
-		
-		if (iUnit < units.size()) {
-			unit = units[iUnit++]
-			if (unit.getDeb() == m.getStart() && unit.getFin() == m.getEnd()) { // skip and print the line
-				println "skiping line: "+line.getViewRef().toString()+" "+line.keywordToString()
-				// line.getViewRef().toString()
-				// line.leftContextToString()
-				// line.keywordToString()
-				// line.rightContextToString()
-				continue
-			}
-		}
-		}
-	}
-	n++
-	analecCorpus.addUniteSaisie(unit_type, m.getStart(), m.getEnd(), [type:value])
-}
-println "$n $unit_type created."
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/AjoutDefinitudeMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/AjoutDefinitudeMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/AjoutDefinitudeMacro.groovy	(revision 1852)
@@ -1,110 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// @author sheiden
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.apache.commons.lang.StringUtils;
-import org.kohsuke.args4j.*
-
-import groovy.transform.Field
-
-import org.txm.Toolbox;
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.AbstractCqiClient;
-import org.txm.searchengine.cqp.corpus.*
-
-import visuAnalec.Message.StructureEvent;
-import visuAnalec.Message.TypeModifStructure;
-import visuAnalec.donnees.Structure;
-import visuAnalec.elements.Unite;
-import visuAnalec.vue.Vue
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="unit_type",usage="", widget="String", required=true, def="Maillon")
-String unit_type
-@Field @Option(name="reset",usage="", widget="Boolean", required=true, def="true")
-boolean reset
-
-if (!ParametersDialog.open(this)) return;
-
-MainCorpus corpus = corpusViewSelection
-AbstractCqiClient CQI = CQPSearchEngine.getCqiClient();
-def word = corpus.getWordProperty()
-def analecCorpus = URSCorpora.getCorpus(corpus);
-Structure structure = analecCorpus.getStructure()
-if (!structure.getUnites().contains(unit_type)) { // check if the structure contains the unit_type units
-	println "Error: corpus structure does not contains unit with name=$unit_type"
-	return
-}
-def props = structure.getUniteProperties(unit_type)
-
-String DEFINITUDE = "DEFINITUDE"
-if (!props.contains(DEFINITUDE)) { // update the structure if needed
-	analecCorpus.ajouterProp(Unite.class, unit_type, DEFINITUDE);
-	analecCorpus.ajouterVal(Unite.class, unit_type, DEFINITUDE, "DEFINI");
-	analecCorpus.ajouterVal(Unite.class, unit_type, DEFINITUDE, "INDEFINI");
-	analecCorpus.ajouterVal(Unite.class, unit_type, DEFINITUDE, "DEMONSTRATIF");
-	analecCorpus.ajouterVal(Unite.class, unit_type, DEFINITUDE, "AMBIGU");
-	analecCorpus.ajouterVal(Unite.class, unit_type, DEFINITUDE, "NONE");
-}
-
-int nIgnored = 0 // number of ignored units
-int nModified = 0 // number of modified units
-int nDefini = 0 // number of "DEFINI" units
-int nIndefini = 0 // number of "InDEFINI" units
-int nDemonstratif = 0 // number of "DEMONSTRATIF" units
-int nAmbigu = 0 // number of "AMBIGU" units
-int nNone = 0 // number of "NONE" units
-
-def units = analecCorpus.getUnites(unit_type)
-units.sort() { a, b -> a.getDeb() <=> b.getDeb() ?: a.getFin() <=> b.getFin() }
-for (Unite unit : units) { // process all units
-	
-	def prop = unit.getProp(DEFINITUDE);
-	
-	int[] pos = null
-	if (unit.getDeb() == unit.getFin()) pos = [unit.getDeb()]
-	else pos = (unit.getDeb()..unit.getFin())
-	def form = StringUtils.join(CQI.cpos2Str(word.getQualifiedName(), pos), " ")
-	
-	if (reset || prop == null || prop.length() == 0 || prop.equals("NONE")) {
-		// petits ajouts à faire ? : |(ses\s.+)|(Ses\s.+)|(son\s.+)|(Son\s.+)|(sa\s.+)|(Sa\s.+)|(leurs?\s.+)|(Leurs?\s.+)|(tous\s.+)|(Tous\s.+)|(toutes\s.+)|(Toutes\s.+)
-		if (form =~ /^(le\s.+)|(Les\s.+)|(Le\s.+)|(la\s.+)|(La\s.+)|(l'.+)|(L'.+)|(les\s.+)|(au\s.+)|(Au\s.+)|(aux\s.+)|(Aux\s.+)|(du\s.+)|(Du\s.+)/) {
-			unit.getProps().put(DEFINITUDE, "DEFINI")
-			nDefini++
-		} else if (form =~ /^(un\s.+)|(une\s.+)|(Un\s.+)|(Une\s.+)|(Chaque\s.+)|(chaque\s.+)|(Certains\s.+)|(Certaines\s.+)|(certains\s.+)|(certaines\s.+)|(aucun\s.+)|(aucune\s.+)|(Aucun\s.+)|(Aucunes\s.+)|(Autre\s.+)|(Autre\s.+)|(autres\s.+)|(autre\s.+)|(quelque\s.+)|(quelques\s.+)|(Quelque\s.+)|(Quelques\s.+)/) {
-			unit.getProps().put(DEFINITUDE, "INDEFINI")
-			nIndefini++
-		} else if (form =~ /^(ce\s.+)|(cette\s.+)|(Cette\s.+)|(cet\s.+)|(ces\s.+)|(Ce\s.+)|(Cet\s.+)|(Ces\s.+)/) {
-			unit.getProps().put(DEFINITUDE, "DEMONSTRATIF")
-			nDemonstratif++
-		} else if (form =~ /^(des\s.+)|(de\s.+)|(Des\s.+)|(De\s.+)/) {
-			unit.getProps().put(DEFINITUDE, "AMBIGU")
-			nAmbigu++
-		} else {
-			unit.getProps().put(DEFINITUDE, "NONE")
-			nNone++;
-		}
-		nModified++
-		
-	} else {
-		// nothing to do
-		nIgnored++
-	}
-}
-
-println "nIgnored=$nIgnored"
-println "nModified=$nModified"
-println " nDefini=$nDefini"
-println " nIndefini=$nIndefini"
-println " nDemonstratif=$nDemonstratif"
-println " nAmbigu=$nAmbigu"
-println " nNone=$nNone"
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/CreationRelationsMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/CreationRelationsMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/CreationRelationsMacro.groovy	(revision 1852)
@@ -1,74 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-
-import groovy.transform.Field
-
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-
-import visuAnalec.donnees.Structure;
-import visuAnalec.elements.Relation;
-import visuAnalec.elements.Schema
-import visuAnalec.elements.Unite;
-import visuAnalec.vue.Vue
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="unit_type",usage="", widget="String", required=true, def="MENTION")
-		String unit_type
-@Field @Option(name="schema_type",usage="", widget="String", required=true, def="CHAINE")
-		String schema_type
-if (!ParametersDialog.open(this)) return;
-
-int nCreated = 0 // count the number of created RELATION
-
-MainCorpus corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus); // analec corpus has the same name has the TXM corpus
-Structure structure = analecCorpus.getStructure()
-if (!structure.getUnites().contains(unit_type)) { // check if the structure contains the unit_type units
-	println "Error: corpus structure does not contains unit with name=$unit_type"
-	return
-}
-if (!structure.getSchemas().contains(schema_type)) { // check if the structure contains the unit_type units
-	println "Error: corpus structure does not contains schema with name=$schema_type"
-	return
-}
-if (!structure.getRelations().contains("ANAPHORE")) { // update the structure if needed
-	println "Creating the 'ANAPHORE' relation in the structure"
-	structure.ajouterType(Relation.class, "ANAPHORE")
-	analecCorpus.ajouterProp(Relation.class, "ANAPHORE", "TYPE")
-	analecCorpus.ajouterVal(Relation.class, "ANAPHORE", "TYPE", "COREFERENTE")
-	analecCorpus.ajouterVal(Relation.class, "ANAPHORE", "TYPE", "ASSOCIATIVE")
-}
-if (analecCorpus.getRelations("ANAPHORE").size() > 0) {
-	println "Error: This macro can't update existing Relations"
-	return
-}
-
-for (Schema schema : analecCorpus.getSchemas(schema_type)) { // parse all CHAINE
-	def units = []
-	for (Unite unit : schema.getUnitesSousjacentes()) { // keep only the 'unit_type' units
-		if (unit.type.equals(unit_type)) units << unit
-	}
-	units.sort() { a, b -> a.getDeb() <=> b.getDeb() ?: a.getFin() <=> b.getFin() } // sort them
-	
-	for (int i = 0 ; i < units.size() - 1 ; i++) { // build RELATIONS and don't process the last unit
-		println "creating "+units[i+1]+", "+units[i]
-		Relation relation = new Relation("ANAPHORE", units[i+1], units[i])
-		relation.getProps().put("TYPE", "COREFERENTE")
-		analecCorpus.addRelationLue(relation)  // add the new relation
-		nCreated++;
-	}
-}
-
-println "nCreated=$nCreated"
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/SchemaTypesMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/SchemaTypesMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/SchemaTypesMacro.groovy	(revision 1852)
@@ -1,28 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// @author sheiden
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-MainCorpus corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus);
-
-def schemas = analecCorpus.getTousSchemas()
-def set = new HashMap()
-for (def s : schemas.collect { it.getType() }) {
-	if (!set.containsKey(s)) set[s] = 0;
-	set[s] = set[s] +1
-}
-println "Schemas types: "+set.sort() { it -> set[it]}
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/NombreDeChainesMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/NombreDeChainesMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/NombreDeChainesMacro.groovy	(revision 1852)
@@ -1,116 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// @author sheiden
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="schema_type",usage="", widget="String", required=true, def="Coréférence")
-String schema_type
-
-@Field @Option(name="minimum_schema_size",usage="", widget="Integer", required=true, def="3")
-int minimum_schema_size
-
-@Field @Option(name="schema_property_name",usage="", widget="String", required=false, def="")
-String schema_property_name
-
-@Field @Option(name="schema_property_value",usage="", widget="String", required=false, def=".*")
-String schema_property_value
-
-@Field @Option(name="unit_type",usage="", widget="String", required=false, def="Maillon")
-String unit_type
-
-@Field @Option(name="unit_property_name", usage="", widget="String", required=false, def="")
-String unit_property_name
-
-@Field @Option(name="unit_property_value", usage="", widget="String", required=false, def=".*")
-String unit_property_value
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-// Open the parameters input dialog box
-if (!ParametersDialog.open(this)) return;
-// END OF PARAMETERS
-
-MainCorpus corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus)
-
-// check Schema parameters
-if (!analecCorpus.getStructure().getSchemas().contains(schema_type)) {
-	println "No schema with name=$schema_type"
-	return;
-} else {
-	if (schema_property_name.length() > 0 && schema_property_value.length() > 0) {
-		// test property existance
-		def props = analecCorpus.getStructure().getSchemaProperties(schema_type);
-		if (!props.contains(schema_property_name)) {
-			println "Schema $schema_type has no property named $schema_property_name"
-			return;
-		}
-	}
-}
-
-// check unit parameters
-if (!analecCorpus.getStructure().getUnites().contains(unit_type)) {
-	println "No unit with name=$unit_type"
-	return;
-} else {
-	if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
-		// test property existance
-		def props = analecCorpus.getStructure().getUniteProperties(unit_type);
-		if (!props.contains(unit_property_name)) {
-			println "Unit $unit_type has no property named $unit_property_name"
-			return;
-		}
-	}
-}
-
-def schemas = analecCorpus.getSchemas(schema_type)
-
-int nSchemas = 0;
-for (def schema : schemas) {
-
-	if (schema_property_name.length() > 0 && schema_property_value.length() > 0) {
-		if (!schema.getProp(schema_property_name).matches(schema_property_value)) {
-			// ignoring this schema
-			continue
-		}
-	}
-	
-	int nUnites = 0;
-	for (def unit : schema.getUnitesSousjacentesNonTriees()) {
-	if (unit_type.length() > 0) {
-			if (!unit.getType().equals(unit_type)) {
-				continue
-			}
-		}
-		
-		if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
-			if (!unit.getProp(unit_property_name).matches(unit_property_value)) {
-				// ignoring this schema
-				continue
-			}
-		}
-	
-		nUnites++
-	}
-	
-	if (nUnites < minimum_schema_size) continue;
-
-	nSchemas++;
-}
-
-println "nombre de chaînes de référence d'un texte : $nSchemas"
-
-["result":nSchemas, "data":schemas]
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/DistanceInterMaillonnaireMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/DistanceInterMaillonnaireMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/DistanceInterMaillonnaireMacro.groovy	(revision 1852)
@@ -1,124 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// @author sheiden
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.*
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-import org.apache.commons.lang.StringUtils;
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="schema_type",usage="", widget="String", required=true, def="Coréférence")
-String schema_type
-
-@Field @Option(name="minimum_schema_size", usage="", widget="Integer", required=true, def="3")
-int minimum_schema_size
-
-@Field @Option(name="schema_property_name",usage="", widget="String", required=false, def="")
-String schema_property_name
-
-@Field @Option(name="schema_property_value",usage="", widget="String", required=false, def=".*")
-String schema_property_value
-
-@Field @Option(name="unit_type",usage="", widget="String", required=false, def="Maillon")
-String unit_type
-
-@Field @Option(name="unit_property_name", usage="", widget="String", required=false, def="")
-String unit_property_name
-
-@Field @Option(name="unit_property_value", usage="", widget="String", required=false, def=".*")
-String unit_property_value
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-if (!ParametersDialog.open(this)) return;
-
-MainCorpus corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus)
-
-// check Schema parameters
-if (!analecCorpus.getStructure().getSchemas().contains(schema_type)) {
-	println "No schema with name=$schema_type"
-	return;
-} else {
-	if (schema_property_name.length() > 0 && schema_property_value.length() > 0) {
-		// test property existance
-		def props = analecCorpus.getStructure().getSchemaProperties(schema_type);
-		if (!props.contains(schema_property_name)) {
-			println "Schema $schema_type has no property named $schema_property_name"
-			return;
-		}
-	}
-}
-
-// check unit parameters
-if (!analecCorpus.getStructure().getUnites().contains(unit_type)) {
-	println "No unit with name=$unit_type"
-	return;
-} else {
-	if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
-		// test property existance
-		def props = analecCorpus.getStructure().getUniteProperties(unit_type);
-		if (!props.contains(unit_property_name)) {
-			println "Unit $unit_type has no property named $unit_property_name"
-			return;
-		}
-	}
-}
-
-def schemas = analecCorpus.getSchemas(schema_type)
-def distances = 0;
-def nDistances = 0
-for (def schema : schemas) {
-
-	if (schema_property_name.length() > 0 && schema_property_value.length() > 0) {
-		if (!schema.getProp(schema_property_name).matches(schema_property_value)) {
-			// ignoring this schema
-			continue
-		}
-	}
-	
-	def allUnites = schema.getUnitesSousjacentesNonTriees()
-	int nUnites = allUnites.size()
-	if (nUnites < minimum_schema_size) continue;
-
-	def units = []
-	for (def unit : allUnites) {
-	
-		if (unit_type.length() > 0) {
-			if (!unit.getType().equals(unit_type)) {
-				continue
-			}
-		}
-		
-		if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
-			if (!unit.getProp(unit_property_name).matches(unit_property_value)) {
-				// ignoring this schema
-				continue
-			}
-		}
-		
-		units << unit
-	}
-	
-	units.sort() { u1, u2 -> u1.getDeb() <=> u2.getDeb()}
-		
-	for (int i = 0 ; i < units.size() -1 ; i++) {
-		distances +=  units[i+1].getDeb() - units[i].getFin() 
-		nDistances++
-	}
-}
-
-coef = (distances / nDistances)
-println "distance moyenne inter-mayonnaise : $distances / $nDistances = $coef"
-
-return ["result":coef, "data":["distances":distances, "nDistances":nDistances]]
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/NatureDuPremierMaillonMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/NatureDuPremierMaillonMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/NatureDuPremierMaillonMacro.groovy	(revision 1852)
@@ -1,156 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// @author sheiden
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.*
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-import org.apache.commons.lang.StringUtils;
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="schema_type",usage="", widget="String", required=true, def="Coréférence")
-String schema_type
-
-@Field @Option(name="minimum_schema_size", usage="", widget="Integer", required=true, def="3")
-int minimum_schema_size
-
-@Field @Option(name="schema_property_name",usage="", widget="String", required=false, def="")
-String schema_property_name
-
-@Field @Option(name="schema_property_value",usage="", widget="String", required=false, def=".*")
-String schema_property_value
-
-@Field @Option(name="unit_type",usage="", widget="String", required=false, def="Maillon")
-String unit_type
-
-@Field @Option(name="unit_property_name", usage="", widget="String", required=false, def="")
-String unit_property_name
-
-@Field @Option(name="unit_property_value", usage="", widget="String", required=false, def=".*")
-String unit_property_value
-
-@Field @Option(name="word_property", usage="", widget="StringArray", metaVar="Catégorie	pos	fropos	frpos", required=false, def="Catégorie")
-String word_property
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-// Open the parameters input dialog box
-if (!ParametersDialog.open(this)) return;
-// END OF PARAMETERS
-
-MainCorpus corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus)
-
-if (!analecCorpus.getStructure().getSchemas().contains(schema_type)) {
-	println "No schema with name=$schema_type"
-	return;
-} else {
-	if (schema_property_name.length() > 0 && schema_property_value.length() > 0) {
-		// test property existance
-		def props = analecCorpus.getStructure().getSchemaProperties(schema_type);
-		if (!props.contains(schema_property_name)) {
-			println "Schema $schema_type has no property named $schema_property_name"
-			return;
-		}
-	}
-}
-
-if (!analecCorpus.getStructure().getUnites().contains(unit_type)) {
-	println "No unit with name=$unit_type"
-	return;
-} else {
-	if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
-		// test property existance
-		def props = analecCorpus.getStructure().getUniteProperties(unit_type);
-		if (!props.contains(unit_property_name)) {
-			println "Unit $unit_type has no property named $unit_property_name"
-			return;
-		}
-	}
-}
-
-def CQI = CQPSearchEngine.getCqiClient()
-
-def prop = corpus.getProperty(word_property)
-
-def schemas = analecCorpus.getSchemas(schema_type)
-def freqs = [:]
-
-def distances = 0;
-def nDistances = 0
-for (def schema : schemas) {
-
-	if (schema_property_name.length() > 0 && schema_property_value.length() > 0) {
-		if (!schema.getProp(schema_property_name).matches(schema_property_value)) {
-			// ignoring this schema
-			continue
-		}
-	}
-	
-	def allUnites = schema.getUnitesSousjacentesNonTriees()
-	int nUnites = allUnites.size()
-	if (nUnites < minimum_schema_size) continue;
-
-	def units = []
-	for (def unit : allUnites) {
-	
-		if (unit_type.length() > 0) {
-			if (!unit.getType().equals(unit_type)) {
-				continue
-			}
-		}
-		
-		if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
-			if (!unit.getProp(unit_property_name).matches(unit_property_value)) {
-				// ignoring this schema
-				continue
-			}
-		}
-		
-		units << unit
-	}
-	
-	units.sort() { u1, u2 ->
-		return u1.getDeb() - u2.getDeb()
-	}
-	if (units.size() == 0) continue;
-	
-	def unit = units[0]
-	
-	String forme =  null;
-	if (prop == null) { // word_property is the analec unit property to use
-		forme = unit.getProp(word_property)
-	} else {
-		int[] pos = null;
-		if (unit.getDeb() == unit.getFin()) pos = [unit.getDeb()]
-		else pos = unit.getDeb()..unit.getFin()
-			
-		forme = StringUtils.join(CQI.cpos2Str(prop.getQualifiedName(), pos), " ") // ids is enough
-	}
-	
-	if (!freqs.containsKey(forme)) freqs[forme] = 0;
-	
-	freqs[forme] = freqs[forme] + 1;
-}
-
-println "index des natures de premier maillon :"
-int max = 0;
-def result = "";
-for (def forme : freqs.keySet().sort() {it -> -freqs[it]}) {
-	println "$forme\t"+freqs[forme]
-	if (max < freqs[forme]) {
-		max = freqs[forme]
-		result = "$forme: "+freqs[forme]
-	}
-}
-
-["result": result, "data": freqs]
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/LongueurMoyenneMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/LongueurMoyenneMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/LongueurMoyenneMacro.groovy	(revision 1852)
@@ -1,173 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// @author sheiden
-
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-
-import groovy.transform.Field
-
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-import org.txm.statsengine.r.core.RWorkspace;
-import org.txm.Toolbox
-import org.txm.rcp.commands.*
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="schema_type",usage="", widget="String", required=true, def="Coréférence")
-String schema_type
-
-@Field @Option(name="minimum_schema_size",usage="", widget="Integer", required=true, def="3")
-int minimum_schema_size
-
-@Field @Option(name="schema_property_name",usage="", widget="String", required=false, def="")
-String schema_property_name
-
-@Field @Option(name="schema_property_value",usage="", widget="String", required=false, def=".*")
-String schema_property_value
-
-@Field @Option(name="unit_type",usage="", widget="String", required=false, def="Maillon")
-String unit_type
-
-@Field @Option(name="unit_property_name", usage="", widget="String", required=false, def="")
-String unit_property_name
-
-@Field @Option(name="unit_property_value", usage="", widget="String", required=false, def=".*")
-String unit_property_value
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-if (!ParametersDialog.open(this)) return;
-// END OF PARAMETERS
-
-MainCorpus corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus)
-
-// check Schema parameters
-if (!analecCorpus.getStructure().getSchemas().contains(schema_type)) {
-	println "No schema with name=$schema_type"
-	return;
-} else {
-	if (schema_property_name.length() > 0 && schema_property_value.length() > 0) {
-		// test property existance
-		def props = analecCorpus.getStructure().getSchemaProperties(schema_type);
-		if (!props.contains(schema_property_name)) {
-			println "Schema $schema_type has no property named $schema_property_name"
-			return;
-		}
-	}
-}
-
-// check unit parameters
-if (!analecCorpus.getStructure().getUnites().contains(unit_type)) {
-	println "No unit with name=$unit_type"
-	return;
-} else {
-	if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
-		// test property existance
-		def props = analecCorpus.getStructure().getUniteProperties(unit_type);
-		if (!props.contains(unit_property_name)) {
-			println "Unit $unit_type has no property named $unit_property_name"
-			return;
-		}
-	}
-}
-
-def schemas = analecCorpus.getSchemas(schema_type)
-
-int nSchemas = 0;
-
-def lens = [:]
-for (def schema : schemas) {
-
-	if (schema_property_name.length() > 0 && schema_property_value.length() > 0) {
-		if (!schema.getProp(schema_property_name).matches(schema_property_value)) {
-			// ignoring this schema
-			continue
-		}
-	}
-	
-	int nUnites = 0;
-	for (def unit : schema.getUnitesSousjacentesNonTriees()) {
-		if (unit_type.length() > 0) {
-			if (!unit.getType().equals(unit_type)) {
-				continue
-			}
-		}
-		
-		if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
-			if (!unit.getProp(unit_property_name).matches(unit_property_value)) {
-				// ignoring this schema
-				continue
-			}
-		}
-	
-		nUnites++
-	}
-	
-	if (nUnites < minimum_schema_size) continue;
-	
-	if (!lens.containsKey(nUnites)) lens[nUnites] = 0;
-	
-	lens[nUnites] = lens[nUnites] + 1;
-	nSchemas++;
-}
-
-//println "nSchemas=$nSchemas"
-def freqs = lens.keySet();
-freqs.sort();
-int t = 0;
-int n = 0;
-//println "Fréquences ("+freqs.size()+")"
-for (def f : freqs) {
-	t += f * lens[f]
-	n += lens[f]
-}
-
-coef = (t/n)
-def slens = lens.sort { a, b -> -a.value <=> -b.value ?: -a.key <=> -b.key }
-def flens = []
-slens.each { key, value -> value.times { flens << key } }
-def nbins = flens.size()*2
-
-def cfreq = 0
-println "longueur moyenne des chaînes de référence : $t/$n = "+coef
-println "index hiérarchique des longueurs de chaînes :\nlen\tfreq\tcfreq"
-slens.each { println it.key+"	"+it.value+"	"+(cfreq+=it.value) }
-
-def slens2 = slens.sort { a, b -> -a.key <=> -b.key }
-
-def r = RWorkspace.getRWorkspaceInstance()
-
-r.addVectorToWorkspace("len", slens2.keySet() as int[])
-r.addVectorToWorkspace("freq", slens2.values() as int[])
-r.addVectorToWorkspace("flen", flens as int[])
-
-def corpusName = corpus.getName()
-
-def file = File.createTempFile("txm", ".svg", new File(Toolbox.getTxmHomePath(), "results"))
-println "SVG file: "+file.getAbsolutePath()
-/// BEGINNING OF R SCRIPT
-def script ="""
-hist(flen, xaxt='n', col="gray", xlab="Length", breaks=$nbins, main="$corpusName Longueur des chaînes ($nbins bins)")
-axis(side=1, at=len)
-"""
-/// END OF R SCRIPT
-
-// execute R script
-r.plot(file, script)
-
-//display the SVG results graphic
-monitor.syncExec(new Runnable() {
-	@Override
-	public void run() { OpenSVGGraph.OpenSVGFile(file.getAbsolutePath(), corpusName+" Longueur des chaînes") }
-})
-
-return ["result":coef, "data":lens]
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/UnitTypesNotInSchemaMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/UnitTypesNotInSchemaMacro.groovy	(revision 1851)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/UnitTypesNotInSchemaMacro.groovy	(revision 1852)
@@ -1,42 +0,0 @@
-// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
-// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
-// @author mdecorde
-// @author sheiden
-// STANDARD DECLARATIONS
-package org.txm.macro.urs
-
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="schema_type",usage="", widget="String", required=true, def="Coréférence")
-String schema_type
-if (!ParametersDialog.open(this)) return;
-
-MainCorpus corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus);
-
-def unitesInSchema = new HashSet()
-for (def schema : analecCorpus.getSchemas(schema_type)) {
-	unitesInSchema.addAll(schema.getUnitesSousjacentes())
-}
-println "unites: "+analecCorpus.getToutesUnites().size()
-println "unites in schema: "+unitesInSchema.size()
-
-def set = new HashMap()
-for (def u : analecCorpus.getToutesUnites()) {
-	if (unitesInSchema.contains(u)) continue;
-	
-	if (!set.containsKey(u.getType())) set[u.getType()] = 0;
-	set[u.getType()] = set[u.getType()] +1
-}
-
-println "unites not in schema: "+set.sort() { it -> set[it]}
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/mesures1/ChainesMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/mesures1/ChainesMacro.groovy	(revision 0)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/mesures1/ChainesMacro.groovy	(revision 1852)
@@ -0,0 +1,182 @@
+// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
+// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
+// @author mdecorde
+// @author sheiden
+
+// STANDARD DECLARATIONS
+package org.txm.macro.urs.exploit.mesures1
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcp.swt.widget.parameters.*
+import org.txm.annotation.urs.*
+import org.txm.searchengine.cqp.corpus.*
+import org.txm.Toolbox
+import org.txm.rcp.commands.*
+import org.apache.commons.lang.StringUtils
+
+// BEGINNING OF PARAMETERS
+@Field @Option(name="schema_type",usage="", widget="String", required=true, def="Coréférence")
+String schema_type
+
+@Field @Option(name="minimum_schema_size",usage="", widget="Integer", required=true, def="3")
+int minimum_schema_size
+
+@Field @Option(name="schema_property_name",usage="", widget="String", required=false, def="")
+String schema_property_name
+
+@Field @Option(name="schema_property_value",usage="", widget="String", required=false, def=".*")
+String schema_property_value
+
+@Field @Option(name="unit_type",usage="", widget="String", required=false, def="Maillon")
+String unit_type
+
+@Field @Option(name="unit_property_name", usage="", widget="String", required=false, def="")
+String unit_property_name
+
+@Field @Option(name="unit_property_value", usage="", widget="String", required=false, def=".*")
+String unit_property_value
+
+@Field @Option(name="word_property", usage="", widget="StringArray", metaVar="word	lemma	frlemma	frolemma	#forme#	id", required=false, def="word")
+String word_property
+
+@Field @Option(name="separator", usage="", widget="String", required=true, def=", ")
+String separator
+
+@Field @Option(name="buildCQL", usage="générer la requête des unités", widget="Boolean", required=true, def='false')
+def buildCQL
+
+
+if (!(corpusViewSelection instanceof MainCorpus)) {
+	println "Corpus view selection is not a Corpus"
+	return;
+}
+
+if (!ParametersDialog.open(this)) return;
+// END OF PARAMETERS
+
+MainCorpus corpus = corpusViewSelection
+def analecCorpus = URSCorpora.getCorpus(corpus)
+
+// check Schema parameters
+if (!analecCorpus.getStructure().getSchemas().contains(schema_type)) {
+	println "No schema with name=$schema_type"
+	return;
+} else {
+	if (schema_property_name.length() > 0 && schema_property_value.length() > 0) {
+		// test property existance
+		def props = analecCorpus.getStructure().getSchemaProperties(schema_type);
+		if (!props.contains(schema_property_name)) {
+			println "Schema $schema_type has no property named $schema_property_name"
+			return;
+		}
+	}
+}
+
+// check unit parameters
+if (!analecCorpus.getStructure().getUnites().contains(unit_type)) {
+	println "No unit with name=$unit_type"
+	return;
+} else {
+	if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
+		// test property existance
+		def props = analecCorpus.getStructure().getUniteProperties(unit_type);
+		if (!props.contains(unit_property_name)) {
+			println "Unit $unit_type has no property named $unit_property_name"
+			return;
+		}
+	}
+}
+
+def CQI = CQPSearchEngine.getCqiClient()
+
+if (buildCQL) {
+	word_prop = corpus.getProperty("id")
+} else {
+	word_prop = corpus.getProperty(word_property)
+}
+
+def schemas = analecCorpus.getSchemas(schema_type)
+schemas.sort() {it.getProps()}
+def nSchemas = 0
+
+def lens = [:]
+for (def schema : schemas) {
+
+	if (schema_property_name.length() > 0 && schema_property_value.length() > 0) {
+		if (!schema.getProp(schema_property_name).matches(schema_property_value)) {
+			// ignoring this schema
+			continue
+		}
+	}
+	
+	def nUnites = 0
+	for (def unit : schema.getUnitesSousjacentes()) {
+		if (unit_type.length() > 0) {
+			if (!unit.getType().equals(unit_type)) {
+				continue
+			}
+		}
+		
+		if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
+			if (!unit.getProp(unit_property_name).matches(unit_property_value)) {
+				// ignoring this schema
+				continue
+			}
+		}
+
+		nUnites++
+	}
+
+	if (nUnites < minimum_schema_size) continue
+
+	print schema.getProps().toString()+ ": "
+	def first = true
+	for (def unit : schema.getUnitesSousjacentes()) {
+		if (unit_type.length() > 0) {
+			if (!unit.getType().equals(unit_type)) {
+				continue
+			}
+		}
+		
+		if (unit_property_name.length() > 0 && unit_property_value.length() > 0) {
+			if (!unit.getProp(unit_property_name).matches(unit_property_value)) {
+				// ignoring this schema
+				continue
+			}
+		}
+
+		String forme =  null;
+
+		if (buildCQL) {
+			int[] pos = null
+			if (unit.getDeb() == unit.getFin()) pos = [unit.getDeb()]
+			else pos = (unit.getDeb()..unit.getFin())
+			def first2= true
+			q = ""
+			pos.each {
+				if (first2) { first2 = false } else { q = q+" " }
+				int[] pos2 = [it]
+				q = q+"["+word_prop+"=\""+CQI.cpos2Str(word_prop.getQualifiedName(), pos2)[0]+"\"]"
+			}
+			if (first) { first = false } else { print "|" }
+			print "("+q+")"
+		} else {
+			if (word_prop == null) { // word_property is the analec unit property to use
+			forme = unit.getProp(word_property)
+			} else {
+			int[] pos = null
+			if (unit.getDeb() == unit.getFin()) pos = [unit.getDeb()]
+			else pos = (unit.getDeb()..unit.getFin())
+				
+			forme = StringUtils.join(CQI.cpos2Str(word_prop.getQualifiedName(), pos), " ") // ids is enough
+			}
+
+			if (first) { first = false } else { print separator }
+			print forme
+		}
+	}
+	println ""
+
+	nSchemas++
+}
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/mesures1/PremierMaillonMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/mesures1/PremierMaillonMacro.groovy	(revision 0)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/mesures1/PremierMaillonMacro.groovy	(revision 1852)
@@ -0,0 +1,84 @@
+// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
+// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
+// @author mdecorde
+// @author sheiden
+// STANDARD DECLARATIONS
+package org.txm.macro.urs.exploit.mesures1
+
+import org.kohsuke.args4j.*
+
+import groovy.transform.Field
+
+import org.txm.rcp.swt.widget.parameters.*
+import org.txm.annotation.urs.*
+import org.txm.searchengine.cqp.corpus.*
+
+import visuAnalec.donnees.Structure;
+import visuAnalec.elements.Unite;
+import visuAnalec.vue.Vue
+
+if (!(corpusViewSelection instanceof MainCorpus)) {
+	println "Corpora selection is not a Corpus"
+	return;
+}
+
+// BEGINNING OF PARAMETERS
+@Field @Option(name="unit_type",usage="", widget="String", required=true, def="Maillon")
+String unit_type
+@Field @Option(name="reset",usage="", widget="Boolean", required=true, def="true")
+boolean reset
+
+if (!ParametersDialog.open(this)) return;
+
+MainCorpus corpus = corpusViewSelection
+def analecCorpus = URSCorpora.getCorpus(corpus);
+Structure structure = analecCorpus.getStructure()
+if (!structure.getUnites().contains(unit_type)) { // check if the structure contains the unit_type units
+	println "Error: corpus structure does not contains unit with name=$unit_type"
+	return
+}
+def props = structure.getUniteProperties(unit_type)
+
+String NEW = "NEW"
+String REF = "REF"
+String YES = "YES"
+String NO = "NO"
+if (!props.contains(NEW)) { // update the structure if needed
+	analecCorpus.ajouterProp(Unite.class, unit_type, NEW);
+	analecCorpus.ajouterVal(Unite.class, unit_type, NEW, "YES");
+	analecCorpus.ajouterVal(Unite.class, unit_type, NEW, "NO");
+}
+
+if (!props.contains(REF)) { // check the unit_type units have the REF property
+	println "Error: $unit_type units have no proprerty named 'REF'"
+	return
+}
+
+int nIgnored = 0; // number of units ignored
+int nYes = 0 // number of "YES" unit set
+int nNo = 0 // number of "NO" unit set
+
+def allRefs = new HashSet<String>() // store the references already seen, allow to set the 'NEW' property to 'YES' or 'NO'
+def units = analecCorpus.getUnites(unit_type)
+units.sort() { a, b -> a.getDeb() <=> b.getDeb() ?: a.getFin() <=> b.getFin() }
+for (Unite unit : units) {
+	def prop = unit.getProp(NEW);
+	def ref = unit.getProp(REF);
+	if (reset || prop == null || prop.length() == 0) {
+		if (allRefs.contains(ref)) {
+			unit.getProps().put(NEW, NO)
+			nNo++
+		} else { // this is the first MENTION of the CHAINE
+			allRefs << ref
+			unit.getProps().put(NEW, YES)
+			nYes++
+		}
+	} else {
+		// nothing to do "NEW" already exists
+		nIgnored++
+	}
+}
+
+println "nIgnored=$nIgnored"
+println "nYes=$nYes"
+println "nNo=$nNo"
\ No newline at end of file
