Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/SeparatorField.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/SeparatorField.java	(revision 0)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/SeparatorField.java	(revision 2099)
@@ -0,0 +1,58 @@
+package org.txm.rcp.swt.widget.parameters;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.kohsuke.args4j.NamedOptionDef;
+
+/**
+ * Check button + Label
+ * @author mdecorde
+ *
+ */
+public class SeparatorField extends ParameterField {
+
+	public SeparatorField(Composite parent, int style, NamedOptionDef parameter) {
+		super(parent, style, parameter);
+		this.setLayout(new GridLayout(2, false));
+		this.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
+
+		String str = getWidgetDefault();
+		
+		if (str == null || str.length() == 0) {
+			Label l = new Label(this, SWT.SEPARATOR | SWT.HORIZONTAL);
+			GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
+			l.setLayoutData(gd);
+			l.setText(str);
+			l.setToolTipText(getWidgetUsage());
+		} else {
+			Label l = new Label(this, SWT.NONE);
+			l.setAlignment(SWT.RIGHT);
+			GridData gd = new GridData(SWT.FILL, SWT.FILL, false, false);
+			l.setLayoutData(gd);
+			l.setText(str);
+			l.setToolTipText(getWidgetUsage());
+			
+			Label dt = new Label(this, SWT.SEPARATOR | SWT.HORIZONTAL);
+			dt.setLayoutData(new GridData(SWT.FILL, SWT.END, true, false));
+			dt.setToolTipText(getWidgetUsage());
+		}
+	}
+
+	public Object getWidgetValue() {
+		return null;
+	}
+
+	@Override
+	public void setDefault(String value) {
+
+	}
+
+	@Override
+	public void resetToDefault() {
+		// TODO Auto-generated method stub
+	}
+}

Property changes on: tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/SeparatorField.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/PasswordField.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/PasswordField.java	(revision 0)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/PasswordField.java	(revision 2099)
@@ -0,0 +1,31 @@
+package org.txm.rcp.swt.widget.parameters;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.kohsuke.args4j.NamedOptionDef;
+
+public class PasswordField extends LabelField {
+	Text dt;
+	public PasswordField(Composite parent, int style, NamedOptionDef parameter) {
+		super(parent, style, parameter);
+
+		dt = new Text(this, SWT.PASSWORD | SWT.BORDER);
+		dt.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, false));
+		resetToDefault();
+	}
+
+	public String getWidgetValue() {
+		return dt.getText();
+	}
+
+	public void setDefault(String text) {
+		dt.setText(text);
+	}
+
+	@Override
+	public void resetToDefault() {
+		dt.setText(getWidgetDefault());
+	}
+}

Property changes on: tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/PasswordField.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/ParametersDialog.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/ParametersDialog.java	(revision 2098)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/ParametersDialog.java	(revision 2099)
@@ -20,6 +20,7 @@
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
@@ -139,10 +140,14 @@
 							Log.severe("Wrong default date format: "+stringValue+". Waiting for: "+DateField.STRINGFORMAT+". Error = "+e + ".");
 							value = new Date();
 						}
-					}  else if ("Time".equals(widgetName)) { //$NON-NLS-1$
+					} else if ("Time".equals(widgetName)) { //$NON-NLS-1$
 						value = Integer.parseInt(stringValue);
 					} else if ("String".equals(widgetName)) { //$NON-NLS-1$
 						value = stringValue;
+					} else if ("Separator".equals(widgetName)) { //$NON-NLS-1$
+						value = stringValue;
+					} else if ("Password".equals(widgetName)) { //$NON-NLS-1$
+							value = stringValue;
 					} else if ("StringArray".equals(widgetName)) { //$NON-NLS-1$
 						value = stringValue;
 					} else if ("StringArrayMultiple".equals(widgetName)) { //$NON-NLS-1$
@@ -236,6 +241,11 @@
 		//this.parent = composite;
 		super.createDialogArea(composite);
 
+		System.out.println("Parent: "+composite.getParent());
+		System.out.println("Parent layout: "+composite.getParent().getLayout());
+		
+		composite.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, true));
+		
 		GridLayout layout = new GridLayout(1, true);
 		composite.setLayout(layout);
 
@@ -271,8 +281,12 @@
 				widget = new DateField(composite, SWT.NONE, option);
 			}  else if ("Time".equals(widgetName)) { //$NON-NLS-1$
 				widget = new TimeField(composite, SWT.NONE, option);
+			} else if ("Separator".equals(widgetName)) { //$NON-NLS-1$
+				widget = new SeparatorField(composite, SWT.NONE, option);	
 			} else if ("String".equals(widgetName)) { //$NON-NLS-1$
-				widget = new StringField(composite, SWT.NONE, option);
+				widget = new StringField(composite, SWT.NONE, option);	
+			} else if ("Password".equals(widgetName)) { //$NON-NLS-1$
+					widget = new PasswordField(composite, SWT.NONE, option);
 			} else if ("StringArray".equals(widgetName)) { //$NON-NLS-1$
 				widget = new StringArrayField(composite, SWT.NONE, option);
 			} else if ("StringArrayMultiple".equals(widgetName)) { //$NON-NLS-1$
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/CreateMacro.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/CreateMacro.java	(revision 2098)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/CreateMacro.java	(revision 2099)
@@ -180,6 +180,9 @@
 					writer.println("//@Field @Option(name=\"longString\", usage=\"an example longString\", widget=\"Text\", required=false, def=\"hello world!\")"); //$NON-NLS-1$
 					writer.println("//def longString"); //$NON-NLS-1$
 					writer.println(""); //$NON-NLS-1$
+					writer.println("//@Field @Option(name=\"password\", usage=\"an example password\", widget=\"Password\", required=false, def=\"hello world!\")"); //$NON-NLS-1$
+					writer.println("//def password"); //$NON-NLS-1$
+					writer.println(""); //$NON-NLS-1$
 					writer.println("//@Field @Option(name=\"bool\", usage=\"an example boolean\", widget=\"Boolean\", required=false, def=\"true\")"); //$NON-NLS-1$
 					writer.println("//def bool"); //$NON-NLS-1$
 					writer.println(""); //$NON-NLS-1$
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/AllMesuresMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/AllMesuresMacro.groovy	(revision 2098)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/AllMesuresMacro.groovy	(revision 2099)
@@ -1,135 +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.exploit
-
-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.macroprototypes.urs.exploit.GrammaticalCategoryMacro
-import org.txm.macroprototypes.urs.exploit.NatureOfTheFirstUnitMacro
-import org.txm.macroprototypes.urs.exploit.NumberOfSchemaMacro
-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_ursql", usage="TYPE@PROP=REGEX", widget="String", required=true, def="CHAINE")
-String default_schema_ursql
-
-@Field @Option(name="default_minimum_schema_size", usage="", widget="Integer", required=true, def="3")
-int default_minimum_schema_size
-
-
-@Field @Option(name="schema_property_display_name",usage="", widget="String", required=false, def="REF")
-String schema_property_display_name
-
-@Field @Option(name="default_unit_ursql", usage="TYPE@PROP=REGEX", widget="String", required=false, def="MENTION")
-String default_unit_ursql
-
-@Field @Option(name="default_word_property", usage="", widget="String", required=false, def="word")
-String default_word_property
-@Field @Option(name="default_pos_property", usage="", widget="String", required=false, def="CATEGORIE")
-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.getID() // add the corpus name in the first column
-	
-	println "*** Computing mesures for $corpus" // each macro return a "result" and a "data"
-
-	params = [
-		"unit_ursql":default_unit_ursql,
-	]
-	returnedValue = execMesure(UnitsReferentialDensityMacro, line, corpus, params)
-	line << returnedValue["result"]
-	
-	params = [
-		"schema_ursql":default_schema_ursql,
-		"minimum_schema_size":default_minimum_schema_size,
-		"unit_ursql":default_unit_ursql,
-	]
-	returnedValue = execMesure(SchemaLengthsMacro, line, corpus, params)
-	line << returnedValue["result"]
-	
-	params = [
-		"schema_ursql":default_schema_ursql,
-		"minimum_schema_size":default_minimum_schema_size,
-		"unit_ursql":default_unit_ursql,
-	]
-	returnedValue = execMesure(NumberOfSchemaMacro, line, corpus, params)
-	line << returnedValue["result"]
-	
-	params = [
-		"schema_ursql":default_schema_ursql,
-		"minimum_schema_size":default_minimum_schema_size,
-		"schema_property_display_name":schema_property_display_name,
-		"unit_ursql":default_unit_ursql+"@CATEGORIE=GN Défini|GN Démonstratif|Nom Propre",
-		"word_property":default_word_property,
-	]
-	returnedValue = execMesure(UnitsStabilityScoreMacro, line, corpus, params)
-	line << returnedValue["result"]
-	
-	params = [
-		"schema_ursql":default_schema_ursql,
-		"minimum_schema_size":default_minimum_schema_size,
-		"unit_ursql":default_unit_ursql,
-	]
-	returnedValue = execMesure(UnitsInterDistanceMacro, line, corpus, params)
-	line << returnedValue["result"]
-
-	params = [
-		"schema_ursql":default_schema_ursql,
-		"minimum_schema_size":default_minimum_schema_size,
-		"unit_ursql":default_unit_ursql,
-		"word_property":default_pos_property,
-	]
-	returnedValue = execMesure(NatureOfTheFirstUnitMacro, line, corpus, params)
-	line << returnedValue["data"]
-	
-	params = [
-		"schema_ursql":default_schema_ursql,
-		"minimum_schema_size":default_minimum_schema_size,
-		"schema_property_display_name":schema_property_display_name,
-		"unit_ursql":default_unit_ursql,
-		"word_property":default_pos_property,
-	]
-	returnedValue = execMesure(GrammaticalCategoryMacro, 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/exploit/UnitsInterDistanceMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsInterDistanceMacro.groovy	(revision 2098)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsInterDistanceMacro.groovy	(revision 2099)
@@ -1,105 +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.exploit
-
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.*
-import org.txm.macro.urs.AnalecUtils
-import visuAnalec.elements.*
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.annotation.urs.*
-import org.txm.searchengine.cqp.corpus.*
-import org.apache.commons.lang.StringUtils;
-
-if (!(corpusViewSelection instanceof CQPCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="schema_ursql", usage="TYPE@PROP=REGEX", widget="String", required=true, def="CHAINE")
-String schema_ursql
-
-@Field @Option(name="minimum_schema_size", usage="minimal schema size", widget="Integer", required=true, def="3")
-int minimum_schema_size
-
-@Field @Option(name="schema_display_property_name",usage="", widget="String", required=false, def="REF")
-String schema_display_property_name
-
-@Field @Option(name="unit_ursql", usage="TYPE@PROP=REGEX", widget="String", required=false, def="MENTION")
-String unit_ursql
-
-@Field @Option(name="debug", usage="Show internal variable content", widget="StringArray", metaVar="OFF	ON	ALL	REALLY ALL", required=true, def="OFF")
-debug
-
-if (!ParametersDialog.open(this)) return;
-if (debug == "OFF") debug = 0; else if (debug == "ON") debug = 1; else if (debug == "ALL") debug = 2 else if (debug == "REALLY ALL") debug = 3
-
-CQPCorpus corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus)
-
-def errors = AnalecUtils.isPropertyDefined(Schema.class, analecCorpus, schema_ursql)
-if (errors.size() > 0) {
-	println "** The $schema_ursql schema URSQL cannot be computed in the corpus with types: $errors."
-	return;
-}
-
-errors=AnalecUtils.isPropertyDefined(Unite.class, analecCorpus, unit_ursql)
-if (errors.size() > 0) {
-	println "** $unit_ursql unit URSQL cannot be computed in the corpus with types: $errors."
-	return;
-}
-
-def schemas = AnalecUtils.selectSchemasInCorpus(debug, analecCorpus, corpus, schema_ursql, minimum_schema_size, 999999);
-def distances = [];
-def nDistances = 0
-def cadences = [];
-for (def schema : schemas) {
-	
-	def allUnites = schema.getUnitesSousjacentesNonTriees()
-
-	def units = AnalecUtils.filterElements(debug, allUnites, unit_ursql)
-	
-	Collections.sort(units)
-		
-	for (int i = 0 ; i < units.size() ; i++) {
-		int d1 = 0;
-		int d2 = 0;
-		if (i < units.size()-1) d1 = units[i+1].getDeb() - units[i].getFin();
-		if (d1 < 0) {
-			//println "D1 "+units[i+1].getDeb()+" - "+units[i].getFin()+" = "+d1
-			d1 = 0; // the first unit pass the next one ?
-		}
-		if (i > 0) d2 = units[i].getDeb() - units[i-1].getFin();
-		if (d2 < 0) {
-			//println "D2 "+units[i].getDeb()+" - "+units[i-1].getFin()+" = "+d2
-			d2 = 0; // the first unit pass the next one ?
-		}
-		distances << d1
-		
-		if (d1 < d2) cadences << d1 else cadences << d2
-		
-		nDistances++
-	}
-}
-distances = distances.sort()
-cadences = cadences.sort()
-
-int distances_total = distances.sum()
-int cadences_total = cadences.sum()
-coef = (distances_total / nDistances)
-cadence = (cadences_total / nDistances)
-println "distances $distances"
-println "distance moyenne inter-mayonnaise : $distances_total / $nDistances = $coef"
-println "distance medianne inter-mayonnaise : "+distances[(int)(distances.size() / 2)]
-println "distance quartils : "+distances[0]+" "+distances[(int)(distances.size() / 4)] + " "+distances[(int)(distances.size() / 2)]+" "+distances[(int)(3*distances.size() / 4)]+" "+distances[(int)(distances.size() -1)]
-println "cadences $cadences"
-println "cadence moyenne : $cadences_total / $nDistances = $cadence"
-println "cadence medianne : "+cadences[(int)(cadences.size() / 2)]
-println "cadence quartils : "+cadences[0]+" "+cadences[(int)(cadences.size() / 4)] + " "+cadences[(int)(cadences.size() / 2)]+" "+cadences[(int)(3*cadences.size() / 4)]+" "+cadences[(int)(cadences.size() -1)]
-
-return ["result":coef, "result2":cadence, "data":["distances":distances, "nDistances":nDistances, "cadences":cadences]]
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsStabilityScoreMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsStabilityScoreMacro.groovy	(revision 2098)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsStabilityScoreMacro.groovy	(revision 2099)
@@ -1,133 +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.exploit
-
-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;
-import org.txm.macro.urs.AnalecUtils
-import visuAnalec.elements.*
-import org.txm.searchengine.cqp.CQPSearchEngine
-
-if (!(corpusViewSelection instanceof CQPCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return;
-}
-
-@Field @Option(name="schema_ursql", usage="TYPE@PROP=REGEX", widget="String", required=true, def="CHAINE")
-String schema_ursql
-
-@Field @Option(name="minimum_schema_size", usage="minimal schema size", widget="Integer", required=true, def="3")
-int minimum_schema_size
-
-@Field @Option(name="schema_display_property_name",usage="", widget="String", required=false, def="REF")
-String schema_display_property_name
-
-@Field @Option(name="unit_ursql", usage="TYPE@PROP=REGEX", widget="String", required=false, def="MENTION")
-String unit_ursql
-
-@Field @Option(name="word_property", usage="", widget="String", required=false, def="word")
-String word_property
-
-@Field @Option(name="show_values", usage="", widget="Boolean", required=false, def="false")
-boolean show_values
-
-@Field @Option(name="debug", usage="Show internal variable content", widget="StringArray", metaVar="OFF	ON	ALL	REALLY ALL", required=true, def="OFF")
-debug
-
-if (!ParametersDialog.open(this)) return;
-if (debug == "OFF") debug = 0; else if (debug == "ON") debug = 1; else if (debug == "ALL") debug = 2 else if (debug == "REALLY ALL") debug = 3
-
-
-def corpus = corpusViewSelection
-def analecCorpus = URSCorpora.getCorpus(corpus)
-
-def errors = AnalecUtils.isPropertyDefined(Schema.class, analecCorpus, schema_ursql)
-if (errors.size() > 0) {
-	println "** The $schema_ursql schema URSQL cannot be computed in the corpus with types: $errors."
-	return;
-}
-
-errors=AnalecUtils.isPropertyDefined(Unite.class, analecCorpus, unit_ursql)
-if (errors.size() > 0) {
-	println "** $unit_ursql unit URSQL cannot be computed in the corpus with types: $errors."
-	return;
-}
-def CQI = CQPSearchEngine.getCqiClient()
-
-def prop = corpus.getProperty(word_property)
-if (prop == null) { // no CQP property called $word_property
-	errors=AnalecUtils.isPropertyDefined(Unite.class, analecCorpus, AnalecUtils.getFilterParameters(unit_ursql)[0], word_property)
-	if (errors.size() > 0) {
-		println "** $word_property unit property cannot be computed in the corpus with types: $errors."
-		return;
-	}
-}
-def schemas = AnalecUtils.selectSchemasInCorpus(debug, analecCorpus, corpus, schema_ursql, minimum_schema_size, 999999);
-allFormesSet = new HashSet();
-def coefs = []
-int n = 1
-
-int nUnitesAllSchemas = 0
-int nUnitesTotalSchemas = 0
-
-for (def schema : schemas) {
-	def formesSet = new HashSet(); // contient toutes les formes du CR courant
-	nUnitesTotal = 0;
-	
-	def allUnites = schema.getUnitesSousjacentesNonTriees()
-
-	def units = AnalecUtils.filterElements(debug, allUnites, unit_ursql)
-	def nUnites = schema.getUnitesSousjacentes().size()
-	def nUnitesTotal = units.size()
-	for (def unit : units) {
-	
-		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)
-	}
-	
-	if (formesSet.size() == 0 || nUnitesTotal == 0) {
-		coef = "NA"
-	} else {
-		coef = (nUnitesTotal/formesSet.size())
-	}
-	coefs << coef
-	allFormesSet.addAll(formesSet)
-	
-	if (schema_display_property_name != null && schema_display_property_name.length() > 0) {
-		print schema.getProp(schema_display_property_name)
-	} else {
-		print schema_ursql+"-"+n+" : "
-	}
-	
-	println " ($nUnites units) : $nUnitesTotal selected units / ${formesSet.size()} ${word_property}s = $coef"
-	if (show_values) {
-		println "\t${word_property}s="+formesSet
-	}
-	n++
-	
-	nUnitesAllSchemas += nUnites
-	nUnitesTotalSchemas += nUnitesTotal
-}
-
-coef = nUnitesTotalSchemas/allFormesSet.size()
-//println "ALL : ($nUnitesAllSchemas units) : $nUnitesTotalSchemas selected units / ${allFormesSet.size()} ${word_property}s = $coef"
-
-return ["result":coefs, "data":["nUnitesTotal":nUnitesTotalSchemas, "allFormesSet":allFormesSet], "coef":(coef)]
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsSummaryMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsSummaryMacro.groovy	(revision 2098)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsSummaryMacro.groovy	(revision 2099)
@@ -49,8 +49,8 @@
 		cql_limit
 @Field @Option(name="strict_inclusion", usage="Units must be strictly included into corpus matches", widget="Boolean", required=false, def="true")
 		boolean strict_inclusion
-@Field @Option(name="position", usage="Unit distance to structure limit (0 = no selection, 1 = first after limit, -1 = last before limit, etc.)", widget="Integer", required=true, def="0")
-		int position
+@Field @Option(name="position_in_matches", usage="Unit distance to structure limit (0 = no selection, 1 = first after limit, -1 = last before limit, etc.)", widget="Integer", required=true, def="0")
+		int position_in_matches
 @Field @Option(name="debug", usage="Show internal variable content", widget="StringArray", metaVar="OFF	ON	ALL	REALLY ALL", required=true, def="OFF")
 		debug
 if (!ParametersDialog.open(this)) return
@@ -70,7 +70,7 @@
 		props.addAll(analecCorpus.getStructure().getUniteProperties(type));
 
 	def selectedUnits = AnalecUtils.selectUnitsInSchema(debug, analecCorpus, corpus, schema_ursql, minimum_schema_size, maximum_schema_size, 
-	unit_ursql, position_in_schema, cql_limit, strict_inclusion, position);
+	unit_ursql, position_in_schema, cql_limit, strict_inclusion, position_in_matches);
 
 	allresults[corpus] = selectedUnits;
 }
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsReferentialDensityMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsReferentialDensityMacro.groovy	(revision 2098)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsReferentialDensityMacro.groovy	(revision 2099)
@@ -18,14 +18,22 @@
 	return;
 }
 
+@Field @Option(name="schema_ursql", usage="TYPE@PROP=VALUE", widget="String", required=true, def="CHAINE")
+String schema_ursql
+@Field @Option(name="minimum_schema_size", usage="Minimum size needed to consider a schema", widget="Integer", required=true, def="3")
+int minimum_schema_size
+@Field @Option(name="maximum_schema_size", usage="Maximum size needed to consider a schema", widget="Integer", required=true, def="9999999")
+int maximum_schema_size
 @Field @Option(name="unit_ursql", usage="TYPE@PROP=VALUE", widget="String", required=false, def="MENTION")
 String unit_ursql
+@Field @Option(name="position_in_schema", usage="Unit distance in schema (0 = no selection, 1 = first after limit, -1 = last before limit, etc.)", widget="Integer", required=true, def="0")
+int position_in_schema
 @Field @Option(name="cql_limit", usage="CQL to build structure limits", widget="Query", required=true, def="<div> [] expand to div")
 cql_limit
 @Field @Option(name="strict_inclusion", usage="Units must be strictly included into corpus matches", widget="Boolean", required=true, def="true")
 strict_inclusion
-@Field @Option(name="position", usage="Unit distance to structure limit (0 = no selection, 1 = first after limit, -1 = last before limit, etc.)", widget="Integer", required=true, def="0")
-position
+@Field @Option(name="position_in_matches", usage="Unit distance to structure limit (0 = no selection, 1 = first after limit, -1 = last before limit, etc.)", widget="Integer", required=true, def="0")
+position_in_matches
 
 @Field @Option(name="debug", usage="Show internal variable content", widget="StringArray", metaVar="OFF	ON	ALL	REALLY ALL", required=true, def="OFF")
 debug
@@ -39,8 +47,8 @@
 
 int nMots = corpus.getSize();
 
-def units = AnalecUtils.selectUnitsInSchema(debug, analecCorpus, corpus, "", 0, 0,
-	unit_ursql, 0, cql_limit, strict_inclusion, position);
+def units = AnalecUtils.selectUnitsInSchema(debug, analecCorpus, corpus, schema_ursql, minimum_schema_size, maximum_schema_size,
+	unit_ursql, position_in_schema, cql_limit, strict_inclusion, position_in_matches);
 
 int nUnites = units.size();
 
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/SchemaLengthsMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/SchemaLengthsMacro.groovy	(revision 2098)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/SchemaLengthsMacro.groovy	(revision 2099)
@@ -27,7 +27,8 @@
 
 @Field @Option(name="minimum_schema_size", usage="minimal schema size", widget="Integer", required=true, def="3")
 int minimum_schema_size
-
+@Field @Option(name="maximum_schema_size", usage="Maximum size needed to consider a schema", widget="Integer", required=true, def="9999999")
+int maximum_schema_size
 @Field @Option(name="schema_property_display", usage="schema property to show", widget="String", required=true, def="REF")
 String schema_property_display
 
@@ -55,7 +56,7 @@
 	return;
 }
 
-def schemas = AnalecUtils.selectSchemasInCorpus(debug, analecCorpus, corpus, schema_ursql, minimum_schema_size, 999999);
+def schemas = AnalecUtils.selectSchemasInCorpus(debug, analecCorpus, corpus, schema_ursql, minimum_schema_size, maximum_schema_size);
 
 int nSchemas = 0;
 
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsReferentialStabilityMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsReferentialStabilityMacro.groovy	(revision 0)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsReferentialStabilityMacro.groovy	(revision 2099)
@@ -0,0 +1,134 @@
+// 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
+
+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;
+import org.txm.macro.urs.AnalecUtils
+import visuAnalec.elements.*
+import org.txm.searchengine.cqp.CQPSearchEngine
+
+if (!(corpusViewSelection instanceof CQPCorpus)) {
+	println "Corpora selection is not a Corpus"
+	return;
+}
+
+@Field @Option(name="schema_ursql", usage="TYPE@PROP=REGEX", widget="String", required=true, def="CHAINE")
+String schema_ursql
+
+@Field @Option(name="minimum_schema_size", usage="minimal schema size", widget="Integer", required=true, def="3")
+int minimum_schema_size
+@Field @Option(name="maximum_schema_size", usage="Maximum size needed to consider a schema", widget="Integer", required=true, def="9999999")
+int maximum_schema_size
+@Field @Option(name="schema_display_property_name",usage="", widget="String", required=false, def="REF")
+String schema_display_property_name
+
+@Field @Option(name="unit_ursql", usage="TYPE@PROP=REGEX", widget="String", required=false, def="MENTION")
+String unit_ursql
+
+@Field @Option(name="word_property", usage="", widget="String", required=false, def="word")
+String word_property
+
+@Field @Option(name="show_values", usage="", widget="Boolean", required=false, def="false")
+boolean show_values
+
+@Field @Option(name="debug", usage="Show internal variable content", widget="StringArray", metaVar="OFF	ON	ALL	REALLY ALL", required=true, def="OFF")
+debug
+
+if (!ParametersDialog.open(this)) return;
+if (debug == "OFF") debug = 0; else if (debug == "ON") debug = 1; else if (debug == "ALL") debug = 2 else if (debug == "REALLY ALL") debug = 3
+
+
+def corpus = corpusViewSelection
+def analecCorpus = URSCorpora.getCorpus(corpus)
+
+def errors = AnalecUtils.isPropertyDefined(Schema.class, analecCorpus, schema_ursql)
+if (errors.size() > 0) {
+	println "** The $schema_ursql schema URSQL cannot be computed in the corpus with types: $errors."
+	return;
+}
+
+errors=AnalecUtils.isPropertyDefined(Unite.class, analecCorpus, unit_ursql)
+if (errors.size() > 0) {
+	println "** $unit_ursql unit URSQL cannot be computed in the corpus with types: $errors."
+	return;
+}
+def CQI = CQPSearchEngine.getCqiClient()
+
+def prop = corpus.getProperty(word_property)
+if (prop == null) { // no CQP property called $word_property
+	errors=AnalecUtils.isPropertyDefined(Unite.class, analecCorpus, AnalecUtils.getFilterParameters(unit_ursql)[0], word_property)
+	if (errors.size() > 0) {
+		println "** $word_property unit property cannot be computed in the corpus with types: $errors."
+		return;
+	}
+}
+def schemas = AnalecUtils.selectSchemasInCorpus(debug, analecCorpus, corpus, schema_ursql, minimum_schema_size, maximum_schema_size);
+allFormesSet = new HashSet();
+def coefs = []
+int n = 1
+
+int nUnitesAllSchemas = 0
+int nUnitesTotalSchemas = 0
+
+for (def schema : schemas) {
+	def formesSet = new HashSet(); // contient toutes les formes du CR courant
+	nUnitesTotal = 0;
+	
+	def allUnites = schema.getUnitesSousjacentesNonTriees()
+
+	def units = AnalecUtils.filterElements(debug, allUnites, unit_ursql)
+	def nUnites = schema.getUnitesSousjacentes().size()
+	def nUnitesTotal = units.size()
+	for (def unit : units) {
+	
+		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)
+	}
+	
+	if (formesSet.size() == 0 || nUnitesTotal == 0) {
+		coef = "NA"
+	} else {
+		coef = (nUnitesTotal/formesSet.size())
+	}
+	coefs << coef
+	allFormesSet.addAll(formesSet)
+	
+	if (schema_display_property_name != null && schema_display_property_name.length() > 0) {
+		print schema.getProp(schema_display_property_name)
+	} else {
+		print schema_ursql+"-"+n+" : "
+	}
+	
+	println " ($nUnites units) : $nUnitesTotal selected units / ${formesSet.size()} ${word_property}s = $coef"
+	if (show_values) {
+		println "\t${word_property}s="+formesSet
+	}
+	n++
+	
+	nUnitesAllSchemas += nUnites
+	nUnitesTotalSchemas += nUnitesTotal
+}
+
+coef = nUnitesTotalSchemas/allFormesSet.size()
+//println "ALL : ($nUnitesAllSchemas units) : $nUnitesTotalSchemas selected units / ${allFormesSet.size()} ${word_property}s = $coef"
+
+return ["result":coefs, "data":["nUnitesTotal":nUnitesTotalSchemas, "allFormesSet":allFormesSet], "coef":(coef)]
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsIndexMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsIndexMacro.groovy	(revision 2098)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsIndexMacro.groovy	(revision 2099)
@@ -49,16 +49,16 @@
 		String unit_ursql
 @Field @Option(name="unit_property_display", usage="Unit property to count", widget="String", required=true, def="CATEGORIE")
 		String unit_property_display
-@Field @Option(name="cqp_property_display", usage="Word property to display instead of the unit property", widget="String", required=false, def="")
-		String cqp_property_display
+@Field @Option(name="word_property_display", usage="Word property to display instead of the unit property", widget="String", required=false, def="")
+		String word_property_display
 @Field @Option(name="position_in_schema", usage="Unit distance in schema (0 = no selection, 1 = first after limit, -1 = last before limit, etc.)", widget="Integer", required=true, def="0")
 		int position_in_schema
 @Field @Option(name="cql_limit", usage="CQL to build structure limits", widget="Query", required=true, def="<div> [] expand to div")
 		cql_limit
 @Field @Option(name="strict_inclusion", usage="Units must be strictly included into corpus matches", widget="Boolean", required=true, def="true")
 		strict_inclusion
-@Field @Option(name="position", usage="Unit distance to structure limit (0 = no selection, 1 = first after limit, -1 = last before limit, etc.)", widget="Integer", required=true, def="0")
-		position
+@Field @Option(name="position_in_matches", usage="Unit distance to structure limit (0 = no selection, 1 = first after limit, -1 = last before limit, etc.)", widget="Integer", required=true, def="0")
+		position_in_matches
 //@Field @Option(name="output_2D", usage="output barplot or 3D plot", widget="Boolean", required=true, def="true")
 		output_2D = true
 @Field @Option(name="output_showlegend", usage="output barplot or 3D plot", widget="Boolean", required=true, def="true")
@@ -75,12 +75,12 @@
 if (debug == "OFF") debug = 0; else if (debug == "ON") debug = 1; else if (debug == "ALL") debug = 2 else if (debug == "REALLY ALL") debug = 3
 
 
-if (cqp_property_display != null && cqp_property_display.length() > 0 && unit_property_display != null && unit_property_display.length() > 0) {
-	println "Warning: both unit_property_display=$unit_property_display and cqp_property_display=$cqp_property_display are set. The index will be computed with the $cqp_property_display CQP property."
+if (word_property_display != null && word_property_display.length() > 0 && unit_property_display != null && unit_property_display.length() > 0) {
+	println "Warning: both unit_property_display=$unit_property_display and word_property_display=$word_property_display are set. The index will be computed with the $word_property_display CQP property."
 }
 
-if (cqp_property_display.length() == 0 && unit_property_display.length() == 0) {
-	println "Error: no analysis property specified in unit_property_display or cqp_property_display. Aborting."
+if (word_property_display.length() == 0 && unit_property_display.length() == 0) {
+	println "Error: no analysis property specified in unit_property_display or word_property_display. Aborting."
 	return
 }
 
@@ -115,11 +115,11 @@
 	}
 
 	def selectedUnits = AnalecUtils.selectUnitsInSchema(debug, analecCorpus, corpus, schema_ursql, minimum_schema_size, maximum_schema_size,
-			unit_ursql, position_in_schema, cql_limit, strict_inclusion, position);
+			unit_ursql, position_in_schema, cql_limit, strict_inclusion, position_in_matches);
 	selectedUnits = new HashSet(selectedUnits)
 	def counts = null
-	if (cqp_property_display != null && cqp_property_display.length() > 0) {
-		Property p = corpus.getProperty(cqp_property_display)
+	if (word_property_display != null && word_property_display.length() > 0) {
+		Property p = corpus.getProperty(word_property_display)
 		int[] pos = null
 		counts = [:]
 		for (def unit : selectedUnits) {
@@ -163,13 +163,13 @@
 else { corpus = corpusViewSelection }
 
 def title = "${corpus.getMainCorpus()}.${corpusViewSelection}\n${unit_ursql}"
-title += "[${position}]."
-if (cqp_property_display.length() > 0) title += "${cqp_property_display} frequencies"
+title += "[${position_in_matches}]."
+if (word_property_display.length() > 0) title += "${word_property_display} frequencies"
 else if (unit_property_display.length() > 0) title += "${unit_property_display} frequencies"
 if (cql_limit != null && !cql_limit.getQueryString().equals("\"\"")) title += "\n(${cql_limit} limits)"
 
-if (cqp_property_display.length() > 0) println "Index de la propriété $cqp_property_display des mots des unités $unit_ursql[$position] de ${corpus.getMainCorpus()}.${corpusViewSelection}"
-else println "Index de la propriété $unit_property_display des unités $unit_ursql[$position] de ${corpus.getMainCorpus()}.${corpusViewSelection}"
+if (word_property_display.length() > 0) println "Index de la propriété $word_property_display des mots des unités $unit_ursql[$position_in_matches] de ${corpus.getMainCorpus()}.${corpusViewSelection}"
+else println "Index de la propriété $unit_property_display des unités $unit_ursql[$position_in_matches] de ${corpus.getMainCorpus()}.${corpusViewSelection}"
 println "$unit_property_display\t"+selection.join("\t")
 
 keys.eachWithIndex { prop_val, i ->
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/SchemasProgressionMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/SchemasProgressionMacro.groovy	(revision 2098)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/SchemasProgressionMacro.groovy	(revision 2099)
@@ -36,6 +36,8 @@
 parent = corpusViewSelection
 
 // BEGINNING OF PARAMETERS
+@Field @Option(name="sep", usage="Schemas and units selection part", widget="Separator", required=true, def="Selection")
+String sep
 @Field @Option(name="schema_ursql", usage="TYPE@PROP=VALUE", widget="String", required=true, def="CHAINE")
 		String schema_ursql
 @Field @Option(name="minimum_schema_size", usage="Minimum size needed to consider a schema", widget="Integer", required=true, def="3")
@@ -52,8 +54,10 @@
 		cql_limit
 @Field @Option(name="strict_inclusion", usage="Units must be strictly included into corpus matches", widget="Boolean", required=true, def="true")
 		boolean strict_inclusion
-@Field @Option(name="position", usage="Unit distance to structure limit (0 = no selection, 1 = first after limit, -1 = last before limit, etc.)", widget="Integer", required=true, def="0")
-		int position
+@Field @Option(name="position_in_matches", usage="Unit distance to structure limit (0 = no selection, 1 = first after limit, -1 = last before limit, etc.)", widget="Integer", required=true, def="0")
+		int position_in_matches
+@Field @Option(name="sep2", usage="Progression command parameters", widget="Separator", required=true, def="Progression")
+		String sep2
 @Field @Option(name="struct_name", usage="Structure to display", widget="String", required=true, def="div")
 		String struct_name
 @Field @Option(name="struct_prop", usage="Structure property to display", widget="String", required=true, def="n")
@@ -153,7 +157,7 @@
 		if (cql_limit_matches != null) {
 			if (debug) println "corpus matches: "+parent.getMatches()
 			if (debug) println "filter cql_limit_matches=${cql_limit_matches} with "+selectedAndHighlightedUnits.size()+" units."
-			selectedAndHighlightedUnits = AnalecUtils.filterUniteByInclusion(debug, selectedAndHighlightedUnits, cql_limit_matches, strict_inclusion, position)
+			selectedAndHighlightedUnits = AnalecUtils.filterUniteByInclusion(debug, selectedAndHighlightedUnits, cql_limit_matches, strict_inclusion, position_in_matches)
 			if (debug) println "selectedAndHighlightedUnits=${selectedAndHighlightedUnits.size()}"
 		}
 
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsListMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsListMacro.groovy	(revision 2098)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsListMacro.groovy	(revision 2099)
@@ -54,9 +54,9 @@
 		cql_limit
 @Field @Option(name="strict_inclusion", usage="Units must be strictly included into corpus matches", widget="Boolean", required=true, def="true")
 		boolean strict_inclusion
-@Field @Option(name="position", usage="Unit distance to structure limit (0 = no selection, 1 = first after limit, -1 = last before limit, etc.)", widget="Integer", required=true, def="0")
-		int position
-@Field @Option(name="output_mode", usage="If selected units properties and words are shown", widget="StringArray", metaVar="COUNT	TABULATED	FORMATED	CONCORDANCE	CQL", required=true, def="FORMATED")
+@Field @Option(name="position_in_matches", usage="Unit distance to structure limit (0 = no selection, 1 = first after limit, -1 = last before limit, etc.)", widget="Integer", required=true, def="0")
+		int position_in_matches
+@Field @Option(name="output_mode", usage="If selected units properties and words are shown", widget="StringArray", metaVar="FORMATED	TABULATED	COUNT	CQL	CONCORDANCE", required=true, def="FORMATED")
 		output_mode
 @Field @Option(name="debug", usage="Show internal variable content", widget="StringArray", metaVar="OFF	ON	ALL	REALLY ALL", required=true, def="OFF")
 		debug
@@ -76,7 +76,7 @@
 	def analecCorpus = URSCorpora.getCorpus(mainCorpus)
 
 	def selectedUnits = AnalecUtils.selectUnitsInSchema(debug, analecCorpus, corpus, schema_ursql, minimum_schema_size, maximum_schema_size,
-			unit_ursql, position_in_schema, cql_limit, strict_inclusion, position);
+			unit_ursql, position_in_schema, cql_limit, strict_inclusion, position_in_matches);
 
 	def n = 1
 
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/SchemasListMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/SchemasListMacro.groovy	(revision 2098)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/SchemasListMacro.groovy	(revision 2099)
@@ -29,7 +29,8 @@
 
 @Field @Option(name="minimum_schema_size", usage="minimal schema size", widget="Integer", required=true, def="3")
 int minimum_schema_size
-
+@Field @Option(name="maximum_schema_size", usage="Maximum size needed to consider a schema", widget="Integer", required=true, def="9999999")
+int maximum_schema_size
 @Field @Option(name="unit_ursql", usage="TYPE@PROP=VALUE", widget="String", required=false, def="MENTION")
 String unit_ursql
 
@@ -72,7 +73,7 @@
 	word_prop = corpus.getProperty(word_property)
 }
 
-def schemas = AnalecUtils.selectSchemasInCorpus(debug, analecCorpus, corpus, schema_ursql, minimum_schema_size, 999999);
+def schemas = AnalecUtils.selectSchemasInCorpus(debug, analecCorpus, corpus, schema_ursql, minimum_schema_size, maximum_schema_size);
 schemas.sort() {it.getProps()}
 def nSchemas = 0
 
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsInterdistanceMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsInterdistanceMacro.groovy	(revision 0)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/UnitsInterdistanceMacro.groovy	(revision 2099)
@@ -0,0 +1,106 @@
+// 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
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.*
+import org.txm.macro.urs.AnalecUtils
+import visuAnalec.elements.*
+import org.txm.rcp.swt.widget.parameters.*
+import org.txm.annotation.urs.*
+import org.txm.searchengine.cqp.corpus.*
+import org.apache.commons.lang.StringUtils;
+
+if (!(corpusViewSelection instanceof CQPCorpus)) {
+	println "Corpora selection is not a Corpus"
+	return;
+}
+
+// BEGINNING OF PARAMETERS
+@Field @Option(name="schema_ursql", usage="TYPE@PROP=REGEX", widget="String", required=true, def="CHAINE")
+String schema_ursql
+
+@Field @Option(name="minimum_schema_size", usage="minimal schema size", widget="Integer", required=true, def="3")
+int minimum_schema_size
+@Field @Option(name="maximum_schema_size", usage="Maximum size needed to consider a schema", widget="Integer", required=true, def="9999999")
+int maximum_schema_size
+@Field @Option(name="schema_display_property_name",usage="", widget="String", required=false, def="REF")
+String schema_display_property_name
+
+@Field @Option(name="unit_ursql", usage="TYPE@PROP=REGEX", widget="String", required=false, def="MENTION")
+String unit_ursql
+
+@Field @Option(name="debug", usage="Show internal variable content", widget="StringArray", metaVar="OFF	ON	ALL	REALLY ALL", required=true, def="OFF")
+debug
+
+if (!ParametersDialog.open(this)) return;
+if (debug == "OFF") debug = 0; else if (debug == "ON") debug = 1; else if (debug == "ALL") debug = 2 else if (debug == "REALLY ALL") debug = 3
+
+CQPCorpus corpus = corpusViewSelection
+def analecCorpus = URSCorpora.getCorpus(corpus)
+
+def errors = AnalecUtils.isPropertyDefined(Schema.class, analecCorpus, schema_ursql)
+if (errors.size() > 0) {
+	println "** The $schema_ursql schema URSQL cannot be computed in the corpus with types: $errors."
+	return;
+}
+
+errors=AnalecUtils.isPropertyDefined(Unite.class, analecCorpus, unit_ursql)
+if (errors.size() > 0) {
+	println "** $unit_ursql unit URSQL cannot be computed in the corpus with types: $errors."
+	return;
+}
+
+def schemas = AnalecUtils.selectSchemasInCorpus(debug, analecCorpus, corpus, schema_ursql, minimum_schema_size, maximum_schema_size);
+def distances = [];
+def nDistances = 0
+def cadences = [];
+for (def schema : schemas) {
+	
+	def allUnites = schema.getUnitesSousjacentesNonTriees()
+
+	def units = AnalecUtils.filterElements(debug, allUnites, unit_ursql)
+	
+	Collections.sort(units)
+		
+	for (int i = 0 ; i < units.size() ; i++) {
+		int d1 = 0;
+		int d2 = 0;
+		if (i < units.size()-1) d1 = units[i+1].getDeb() - units[i].getFin();
+		if (d1 < 0) {
+			//println "D1 "+units[i+1].getDeb()+" - "+units[i].getFin()+" = "+d1
+			d1 = 0; // the first unit pass the next one ?
+		}
+		if (i > 0) d2 = units[i].getDeb() - units[i-1].getFin();
+		if (d2 < 0) {
+			//println "D2 "+units[i].getDeb()+" - "+units[i-1].getFin()+" = "+d2
+			d2 = 0; // the first unit pass the next one ?
+		}
+		distances << d1
+		
+		if (d1 < d2) cadences << d1 else cadences << d2
+		
+		nDistances++
+	}
+}
+distances = distances.sort()
+cadences = cadences.sort()
+
+int distances_total = distances.sum()
+int cadences_total = cadences.sum()
+coef = (distances_total / nDistances)
+cadence = (cadences_total / nDistances)
+println "distances $distances"
+println "distance moyenne inter-mayonnaise : $distances_total / $nDistances = $coef"
+println "distance medianne inter-mayonnaise : "+distances[(int)(distances.size() / 2)]
+println "distance quartils : "+distances[0]+" "+distances[(int)(distances.size() / 4)] + " "+distances[(int)(distances.size() / 2)]+" "+distances[(int)(3*distances.size() / 4)]+" "+distances[(int)(distances.size() -1)]
+println "cadences $cadences"
+println "cadence moyenne : $cadences_total / $nDistances = $cadence"
+println "cadence medianne : "+cadences[(int)(cadences.size() / 2)]
+println "cadence quartils : "+cadences[0]+" "+cadences[(int)(cadences.size() / 4)] + " "+cadences[(int)(cadences.size() / 2)]+" "+cadences[(int)(3*cadences.size() / 4)]+" "+cadences[(int)(cadences.size() -1)]
+
+return ["result":coef, "result2":cadence, "data":["distances":distances, "nDistances":nDistances, "cadences":cadences]]
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/edit/Si2SingletonMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/edit/Si2SingletonMacro.groovy	(revision 2098)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/edit/Si2SingletonMacro.groovy	(revision 2099)
@@ -1,89 +0,0 @@
-// @author Bruno Oberlé
-// v1.0.0 20170711
-
-// Cette macro individualise tous les noms de référents "SI" en leur attribuant un numéro unique (SI_1, SI_2, etc.).
-
-package org.txm.macro.urs.edit
-
-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.*
-
-// CORPS DU SCRIPT
-
-if (!(corpusViewSelection instanceof MainCorpus)) {
-	println "Corpora selection is not a Corpus"
-	return
-}
-
-// BEGINNING OF PARAMETERS
-@Field @Option(name="unitType", usage="", widget="String", required=true, def="MENTION")
-def unitType
-@Field @Option(name="refPropertyName", usage="", widget="String", required=true, def="REF")
-def refPropertyName
-if (!ParametersDialog.open(this)) return
-
-corpus = corpusViewSelection
-CQI = CQPSearchEngine.getCqiClient()
-word = corpus.getWordProperty()
-analecCorpus = URSCorpora.getCorpus(corpus)
-vue = URSCorpora.getVue(corpus)
-structure = analecCorpus.getStructure()
-if (!structure.getUnites().contains(unitType)) { // check if the structure contains the unitType units
-	println "Error: corpus structure does not contains unit with name=$unitType"
-	return
-}
-
-if (!structure.getUniteProperties(unitType).contains(refPropertyName)) {
-	println "Error: corpus structure does not contains property name=$unitType"
-	return
-} 
-
-def nModified = 0
-def nIgnored = 0
-
-def units = analecCorpus.getUnites(unitType)
-//units.sort() { a, b -> a.getDeb() <=> b.getDeb() ?: a.getFin() <=> b.getFin() }
-
-def refSet = new HashSet()
-for (Unite unit : units) { // process all units
-	def prop = unit.getProp(refPropertyName)
-	refSet.add(prop)
-}
-
-def counter = 1
-for (Unite unit : units) { // process all units
-	
-	def prop = unit.getProp(refPropertyName)
-	if (prop && prop == "SI") {
-		def name = "SI_" + counter
-		while (refSet.contains(name)) {
-			counter++
-			name = "SI_" + counter
-		}
-		counter++
-		//println "old prop"+ prop
-		unit.getProps().put(refPropertyName, name)
-		//println "new prop"+ name
-		nModified++
-	} else {
-		nIgnored++
-	}
-}
-
-println "Result:"
-println "- $nModified units of type $unitType have been modified."
-println "- $nIgnored units of type $unitType have not been modified.\n"
-
-// 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/edit/ConcordanceToUnitsMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/edit/ConcordanceToUnitsMacro.groovy	(revision 2098)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/edit/ConcordanceToUnitsMacro.groovy	(revision 2099)
@@ -22,10 +22,10 @@
 def create_only_if_new
 
 @Field @Option(name="prop", usage="prop", widget="String", required=true, def="REF")
-def prop
+def property_name
 
 @Field @Option(name="value", usage="default value", widget="String", required=true, def="NAME")
-def value
+def property_value
 
 // END OF PARAMETERS
 
@@ -64,16 +64,16 @@
 	analecCorpus.getStructure().ajouterType(Unite.class, unit_type);
 }
 
-if (!analecCorpus.getStructure().getNomsProps(Unite.class, unit_type).contains(prop)) {
+if (!analecCorpus.getStructure().getNomsProps(Unite.class, unit_type).contains(property_name)) {
 	//println "The corpus structure does not contains unit with type=$unit_type"
 	//return;
-	analecCorpus.getStructure().ajouterProp(Unite.class, unit_type, prop)
+	analecCorpus.getStructure().ajouterProp(Unite.class, unit_type, property_name)
 }
 
-if (!analecCorpus.getStructure().getValeursProp(Unite.class, unit_type, prop).contains(value)) {
+if (!analecCorpus.getStructure().getValeursProp(Unite.class, unit_type, property_name).contains(property_value)) {
 	//println "The corpus structure does not contains unit with type=$unit_type"
 	//return;
-	analecCorpus.getStructure().ajouterVal(Unite.class, unit_type, prop, value)
+	analecCorpus.getStructure().ajouterVal(Unite.class, unit_type, property_name, value)
 }
 
 // browse lines and check
@@ -103,10 +103,15 @@
 	if (do_create) {
 		n++
 		def props = [:]
-		props[prop] = value
+		props[property_name] = property_value
 		Unite u = analecCorpus.addUniteSaisie(unit_type, m.getStart(), m.getEnd(), props)
 		//	println "$props -> "+u.getProps()
 	}
 }
-println "$n $unit_type created."
+if (property_name != null) {
+	println "$n $unit_type created with $property_name='$property_value'."
+} else {
+	println "$n $unit_type created."
+}
+
 if (n > 0) corpus.setIsModified(true);
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/edit/UnitsDeleteMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/edit/UnitsDeleteMacro.groovy	(revision 2098)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/edit/UnitsDeleteMacro.groovy	(revision 2099)
@@ -41,6 +41,8 @@
 		String schema_ursql
 @Field @Option(name="minimum_schema_size", usage="Minimum size needed to consider a schema", widget="Integer", required=true, def="3")
 		int minimum_schema_size
+@Field @Option(name="maximum_schema_size", usage="Maximum size needed to consider a schema", widget="Integer", required=true, def="9999999")
+		int maximum_schema_size
 @Field @Option(name="unit_ursql", usage="TYPE@PROP=VALUE", widget="String", required=false, def="MENTION")
 		String unit_ursql
 @Field @Option(name="position_in_schema", usage="Unit distance in schema (0 = no selection, 1 = first after limit, -1 = last before limit, etc.)", widget="Integer", required=true, def="0")
@@ -49,8 +51,8 @@
 		cql_limit
 @Field @Option(name="strict_inclusion", usage="Units must be strictly included into corpus matches", widget="Boolean", required=true, def="true")
 		boolean strict_inclusion
-@Field @Option(name="position", usage="Unit distance to structure limit (0 = no selection, 1 = first after limit, -1 = last before limit, etc.)", widget="Integer", required=true, def="0")
-		int position
+@Field @Option(name="position_in_matches", usage="Unit distance to structure limit (0 = no selection, 1 = first after limit, -1 = last before limit, etc.)", widget="Integer", required=true, def="0")
+		int position_in_matches
 
 @Field @Option(name="debug", usage="Show internal variable content", widget="StringArray", metaVar="OFF	ON	ALL	REALLY ALL", required=true, def="OFF")
 		debug
@@ -68,8 +70,8 @@
 	Vue analecView = URSCorpora.getVue(corpus)
 	Structure structure = analecCorpus.getStructure()
 
-	def selectedUnits = AnalecUtils.selectUnitsInSchema(debug, analecCorpus, corpus, schema_ursql, minimum_schema_size, Integer.MAX_VALUE,
-			unit_ursql, position_in_schema, cql_limit, strict_inclusion, position);
+	def selectedUnits = AnalecUtils.selectUnitsInSchema(debug, analecCorpus, corpus, schema_ursql, minimum_schema_size, maximum_schema_size,
+			unit_ursql, position_in_schema, cql_limit, strict_inclusion, position_in_matches);
 		
 	def n = 0
 	def nerrors = 0
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/edit/ResetAllAnnotationsMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/edit/ResetAllAnnotationsMacro.groovy	(revision 2098)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/edit/ResetAllAnnotationsMacro.groovy	(revision 2099)
@@ -13,8 +13,8 @@
 	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
+@Field @Option(name="CONFIRMATION", usage="select to confirm the annotations reset", widget="Boolean", required=false, def="false")
+def CONFIRMATION
 
 // Open the parameters input dialog box
 if (!ParametersDialog.open(this)) return;
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/edit/UnitsAnnotateMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/edit/UnitsAnnotateMacro.groovy	(revision 2098)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/edit/UnitsAnnotateMacro.groovy	(revision 2099)
@@ -41,6 +41,8 @@
 		String schema_ursql
 @Field @Option(name="minimum_schema_size", usage="Minimum size needed to consider a schema", widget="Integer", required=true, def="3")
 		int minimum_schema_size
+@Field @Option(name="maximum_schema_size", usage="Maximum size needed to consider a schema", widget="Integer", required=true, def="9999999")
+		int maximum_schema_size
 @Field @Option(name="unit_ursql", usage="TYPE@PROP=VALUE", widget="String", required=false, def="MENTION")
 		String unit_ursql
 @Field @Option(name="position_in_schema", usage="Unit distance in schema (0 = no selection, 1 = first after limit, -1 = last before limit, etc.)", widget="Integer", required=true, def="0")
@@ -49,20 +51,19 @@
 		cql_limit
 @Field @Option(name="strict_inclusion", usage="Units must be strictly included into corpus matches", widget="Boolean", required=true, def="true")
 		boolean strict_inclusion
-@Field @Option(name="position", usage="Unit distance to structure limit (0 = no selection, 1 = first after limit, -1 = last before limit, etc.)", widget="Integer", required=true, def="0")
-		int position
-
-@Field @Option(name="unit_property_to_set", usage="PROP", widget="String", required=false, def="TESTPROP")
-		String unit_property_to_set
-@Field @Option(name="unit_property_value_to_set", usage="VALUE", widget="String", required=false, def="TESTVALUE")
-		String unit_property_value_to_set
+@Field @Option(name="position_in_matches", usage="Unit distance to structure limit (0 = no selection, 1 = first after limit, -1 = last before limit, etc.)", widget="Integer", required=true, def="0")
+		int position_in_matches
+@Field @Option(name="property_name", usage="PROP", widget="String", required=false, def="TESTPROP")
+		String property_name
+@Field @Option(name="property_value", usage="VALUE", widget="String", required=false, def="TESTVALUE")
+		String property_value
 @Field @Option(name="debug", usage="Show internal variable content", widget="StringArray", metaVar="OFF	ON	ALL	REALLY ALL", required=true, def="OFF")
 		debug
 if (!ParametersDialog.open(this)) return
 	if (debug == "OFF") debug = 0; else if (debug == "ON") debug = 1; else if (debug == "ALL") debug = 2 else if (debug == "REALLY ALL") debug = 3
 
-if (unit_property_to_set.length() == 0) {
-	println "unit_property_to_set not set: aborting."
+if (property_name.length() == 0) {
+	println "property_name not set: aborting."
 }
 
 //corpus = corpusViewSelection
@@ -76,18 +77,18 @@
 	Vue analecView = URSCorpora.getVue(corpus)
 	Structure structure = analecCorpus.getStructure()
 
-	AnalecUtils.defineProperty(Unite.class, analecCorpus, unit_ursql, unit_property_to_set)
+	AnalecUtils.defineProperty(Unite.class, analecCorpus, unit_ursql, property_name)
 	analecView.initVueParDefaut()
 
-	def selectedUnits = AnalecUtils.selectUnitsInSchema(debug, analecCorpus, corpus, schema_ursql, minimum_schema_size, Integer.MAX_VALUE,
-			unit_ursql, position_in_schema, cql_limit, strict_inclusion, position);
+	def selectedUnits = AnalecUtils.selectUnitsInSchema(debug, analecCorpus, corpus, schema_ursql, minimum_schema_size, maximum_schema_size,
+			unit_ursql, position_in_schema, cql_limit, strict_inclusion, position_in_matches);
 		
 	println " "+selectedUnits.size()+" units to annotate..."
 	def n = 0
 	def nerrors = 0
 	for (Unite unit : selectedUnits) {
 		
-		if (!analecView.setValeurChamp(unit, unit_property_to_set, unit_property_value_to_set)) {
+		if (!analecView.setValeurChamp(unit, property_name, property_value)) {
 			errors << ""+unit.getDeb()+"->"+unit.getFin()
 			nerrors++
 		} else {
@@ -101,7 +102,7 @@
 	println " $nerrors erreurs lors de l'annotation de $corpus"
 }
 if (errors.size() > 0) {
-	println " Errors while annotating $unit_property_to_set=$unit_property_value_to_set"
+	println " Errors while annotating $property_name=$property_value"
 	println errors.join("\n")
 }
 return allResults
\ No newline at end of file
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/check/CheckAnnotationStructureValuesMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/check/CheckAnnotationStructureValuesMacro.groovy	(revision 2098)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/check/CheckAnnotationStructureValuesMacro.groovy	(revision 2099)
@@ -16,8 +16,8 @@
 @Field @Option(name="unit_type",usage="", widget="String", required=false, def="MENTION")
 String unit_type
 
-@Field @Option(name="unit_property_name", usage="", widget="String", required=false, def="REF")
-String unit_property_name
+@Field @Option(name="unit_property", usage="", widget="String", required=false, def="REF")
+String unit_property
 
 @Field @Option(name="pruneUnusedValues", usage="", widget="Boolean", required=false, def="false")
 boolean pruneUnusedValues
@@ -38,12 +38,12 @@
 }
 
 def props = analecCorpus.getStructure().getUniteProperties(unit_type);
-if (!props.contains(unit_property_name)) {
-	println "No properties '$unit_property_name' in '$unit_type' unit."
+if (!props.contains(unit_property)) {
+	println "No properties '$unit_property' in '$unit_type' unit."
 	return
 }
 
-def prop  = unit_property_name
+def prop  = unit_property
 	
 def tmpvalues = new HashSet()
 tmpvalues.addAll(structure.getValeursProp(Unite.class, unit_type, prop));
@@ -61,7 +61,7 @@
 	if (pruneUnusedValues) {
 		println "Pruning the values..."
 		for (String val : tmpvalues) {
-			structure.supprimerVal(Unite.class, unit_type, unit_property_name, val);
+			structure.supprimerVal(Unite.class, unit_type, unit_property, val);
 		}
 	} 
 } else {
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/democrat/Si2SingletonMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/democrat/Si2SingletonMacro.groovy	(revision 0)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/democrat/Si2SingletonMacro.groovy	(revision 2099)
@@ -0,0 +1,89 @@
+// @author Bruno Oberlé
+// v1.0.0 20170711
+
+// Cette macro individualise tous les noms de référents "SI" en leur attribuant un numéro unique (SI_1, SI_2, etc.).
+
+package org.txm.macro.urs.democrat
+
+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.*
+
+// CORPS DU SCRIPT
+
+if (!(corpusViewSelection instanceof MainCorpus)) {
+	println "Corpora selection is not a Corpus"
+	return
+}
+
+// BEGINNING OF PARAMETERS
+@Field @Option(name="unitType", usage="", widget="String", required=true, def="MENTION")
+def unitType
+@Field @Option(name="refPropertyName", usage="", widget="String", required=true, def="REF")
+def refPropertyName
+if (!ParametersDialog.open(this)) return
+
+corpus = corpusViewSelection
+CQI = CQPSearchEngine.getCqiClient()
+word = corpus.getWordProperty()
+analecCorpus = URSCorpora.getCorpus(corpus)
+vue = URSCorpora.getVue(corpus)
+structure = analecCorpus.getStructure()
+if (!structure.getUnites().contains(unitType)) { // check if the structure contains the unitType units
+	println "Error: corpus structure does not contains unit with name=$unitType"
+	return
+}
+
+if (!structure.getUniteProperties(unitType).contains(refPropertyName)) {
+	println "Error: corpus structure does not contains property name=$unitType"
+	return
+} 
+
+def nModified = 0
+def nIgnored = 0
+
+def units = analecCorpus.getUnites(unitType)
+//units.sort() { a, b -> a.getDeb() <=> b.getDeb() ?: a.getFin() <=> b.getFin() }
+
+def refSet = new HashSet()
+for (Unite unit : units) { // process all units
+	def prop = unit.getProp(refPropertyName)
+	refSet.add(prop)
+}
+
+def counter = 1
+for (Unite unit : units) { // process all units
+	
+	def prop = unit.getProp(refPropertyName)
+	if (prop && prop == "SI") {
+		def name = "SI_" + counter
+		while (refSet.contains(name)) {
+			counter++
+			name = "SI_" + counter
+		}
+		counter++
+		//println "old prop"+ prop
+		unit.getProps().put(refPropertyName, name)
+		//println "new prop"+ name
+		nModified++
+	} else {
+		nIgnored++
+	}
+}
+
+println "Result:"
+println "- $nModified units of type $unitType have been modified."
+println "- $nIgnored units of type $unitType have not been modified.\n"
+
+// 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/macroprototypes/urs/exploit/AllMesuresMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macroprototypes/urs/exploit/AllMesuresMacro.groovy	(revision 0)
+++ tmp/org.txm.analec.rcp/src/org/txm/macroprototypes/urs/exploit/AllMesuresMacro.groovy	(revision 2099)
@@ -0,0 +1,132 @@
+// 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.macroprototypes.urs.exploit
+
+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_ursql", usage="TYPE@PROP=REGEX", widget="String", required=true, def="CHAINE")
+String default_schema_ursql
+
+@Field @Option(name="default_minimum_schema_size", usage="", widget="Integer", required=true, def="3")
+int default_minimum_schema_size
+
+
+@Field @Option(name="schema_property_display_name",usage="", widget="String", required=false, def="REF")
+String schema_property_display_name
+
+@Field @Option(name="default_unit_ursql", usage="TYPE@PROP=REGEX", widget="String", required=false, def="MENTION")
+String default_unit_ursql
+
+@Field @Option(name="default_word_property", usage="", widget="String", required=false, def="word")
+String default_word_property
+@Field @Option(name="default_pos_property", usage="", widget="String", required=false, def="CATEGORIE")
+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.getID() // add the corpus name in the first column
+	
+	println "*** Computing mesures for $corpus" // each macro return a "result" and a "data"
+
+	params = [
+		"unit_ursql":default_unit_ursql,
+	]
+	returnedValue = execMesure(UnitsReferentialDensityMacro, line, corpus, params)
+	line << returnedValue["result"]
+	
+	params = [
+		"schema_ursql":default_schema_ursql,
+		"minimum_schema_size":default_minimum_schema_size,
+		"unit_ursql":default_unit_ursql,
+	]
+	returnedValue = execMesure(SchemaLengthsMacro, line, corpus, params)
+	line << returnedValue["result"]
+	
+	params = [
+		"schema_ursql":default_schema_ursql,
+		"minimum_schema_size":default_minimum_schema_size,
+		"unit_ursql":default_unit_ursql,
+	]
+	returnedValue = execMesure(NumberOfSchemaMacro, line, corpus, params)
+	line << returnedValue["result"]
+	
+	params = [
+		"schema_ursql":default_schema_ursql,
+		"minimum_schema_size":default_minimum_schema_size,
+		"schema_property_display_name":schema_property_display_name,
+		"unit_ursql":default_unit_ursql+"@CATEGORIE=GN Défini|GN Démonstratif|Nom Propre",
+		"word_property":default_word_property,
+	]
+	returnedValue = execMesure(UnitsStabilityScoreMacro, line, corpus, params)
+	line << returnedValue["result"]
+	
+	params = [
+		"schema_ursql":default_schema_ursql,
+		"minimum_schema_size":default_minimum_schema_size,
+		"unit_ursql":default_unit_ursql,
+	]
+	returnedValue = execMesure(UnitsInterDistanceMacro, line, corpus, params)
+	line << returnedValue["result"]
+
+	params = [
+		"schema_ursql":default_schema_ursql,
+		"minimum_schema_size":default_minimum_schema_size,
+		"unit_ursql":default_unit_ursql,
+		"word_property":default_pos_property,
+	]
+	returnedValue = execMesure(NatureOfTheFirstUnitMacro, line, corpus, params)
+	line << returnedValue["data"]
+	
+	params = [
+		"schema_ursql":default_schema_ursql,
+		"minimum_schema_size":default_minimum_schema_size,
+		"schema_property_display_name":schema_property_display_name,
+		"unit_ursql":default_unit_ursql,
+		"word_property":default_pos_property,
+	]
+	returnedValue = execMesure(GrammaticalCategoryMacro, 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.libs.args4j/src/org/kohsuke/args4j/CmdLineParser.java
===================================================================
--- tmp/org.txm.libs.args4j/src/org/kohsuke/args4j/CmdLineParser.java	(revision 2098)
+++ tmp/org.txm.libs.args4j/src/org/kohsuke/args4j/CmdLineParser.java	(revision 2099)
@@ -56,6 +56,9 @@
  *     Kohsuke Kawaguchi (kk@kohsuke.org)
  */
 public class CmdLineParser {
+	
+	public static List<String> widgets = Arrays.asList("Query", "Integer", "File", "CreateFile", "FileSave", "FileOpen", "Folder", "StringArray", "StringArrayMultiple", "StructuralUnits" , "String", "Text", "Password", "Separator", "Float", "Boolean", "Date", "Date-Time");
+	
     /**
      * Discovered {@link OptionHandler}s for options.
      */
@@ -153,7 +156,6 @@
         }
 	}
 	
-	public static List<String> widgets = Arrays.asList("Query", "Integer", "File", "CreateFile", "FileSave", "FileOpen", "Folder", "StringArray", "StringArrayMultiple", "StructuralUnits" , "String", "Text", "Float", "Boolean", "Date", "Date-Time");
 	private void checkWidgetNotInMap(String widget) throws IllegalAnnotationError {
 		if(!widgets.contains(widget)) {
             throw new IllegalAnnotationError(Messages.UNDEFINNED_WIDGET.format(widget, widgets));
