Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/SchemasCoverage.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/SchemasCoverage.groovy	(revision 2163)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/SchemasCoverage.groovy	(revision 2164)
@@ -1,181 +0,0 @@
-// Copyright © 2019 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.exploit
-
-import groovy.transform.Field
-
-import org.jfree.chart.JFreeChart
-import org.jfree.chart.editor.ChartEditor
-import org.kohsuke.args4j.*
-import org.txm.Toolbox
-import org.txm.annotation.urs.*
-import org.txm.chartsengine.core.preferences.ChartsEnginePreferences
-import org.txm.chartsengine.r.core.RChartsEngine
-import org.txm.macro.urs.AnalecUtils
-import org.txm.progression.core.chartsengine.jfreechart.themes.highcharts.renderers.ProgressionItemSelectionRenderer
-import org.txm.progression.core.functions.Progression
-import org.txm.rcp.Application
-import org.txm.rcp.IImageKeys
-import org.txm.rcp.swt.widget.parameters.*
-import org.txm.searchengine.cqp.CQPSearchEngine
-import org.txm.searchengine.cqp.corpus.*
-import org.txm.searchengine.cqp.corpus.query.CQLQuery
-import org.txm.chartsengine.rcp.*;
-import visuAnalec.elements.*
-
-def scriptName = this.class.getSimpleName()
-
-def selection = []
-for (def s : corpusViewSelections) {
-	if (s instanceof CQPCorpus) selection << s
-	else if (s instanceof Partition) selection.addAll(s.getParts())
-}
-
-if (selection.size() == 0) {
-	println "** $scriptName: please select a Corpus or a Partition in the Corpus view: "+corpusViewSelections
-	return false
-} else {
-	for (def c : selection) c.compute(false)
-}
-
-// BEGINNING OF PARAMETERS
-@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="schema_property_display", usage="PROP", widget="String", required=true, def="REF")
-		String schema_property_display
-		
-@Field @Option(name="unit_ursql", usage="TYPE@PROP=VALUE", widget="String", required=false, def="")
-		String unit_ursql
-@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="structure_properties", usage="name_prpperty,name2_property2,name3_property", widget="String", required=true, def="div_n,p_n")
-		String structure_properties
-@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 (structure_properties.length() == 0) return;
-
-def CQI = CQPSearchEngine.getCqiClient()
-
-for (def corpus : selection) {
-
-	def properties = [corpus.getStructuralUnit("text").getProperty("id")]
-	
-	// build structural unit properties list from the "structure_properties" parameter
-	for (def name : structure_properties.split(",")) {
-		name = name.trim()
-		String[] split = name.split("_", 2);
-		if (split.length == 2) {
-			def su = corpus.getStructuralUnit(split[0])
-			if (su == null) {
-				println "No Structure for name=$name"
-			} else {
-				def p = su.getProperty(split[1])
-				if (p == null) {
-					println "No Structure property for name=$name"
-				} else {
-					properties << p
-				}
-			}
-		} else {
-			println "Wrong structural unit name format: $name"
-		}
-	}
-	def cql_limit_matches = corpus.getMatches()
-	
-	def word = corpus.getWordProperty()
-	def analecCorpus = URSCorpora.getCorpus(corpus)
-	AnalecUtils.defineProperty(Schema.class, analecCorpus, schema_ursql, "LOCALISATION")
-	URSCorpora.getVue(corpus).initVueParDefaut()
-
-	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 "** The $unit_ursql unit URSQL cannot be computed in the corpus with types: $errors."
-		return;
-	}
-	
-	if (schema_property_display.length() > 0) {
-		errors = AnalecUtils.isPropertyDefined(Schema.class, analecCorpus, AnalecUtils.getFilterParameters(schema_ursql)[0], schema_property_display).size()
-		if (errors > 0) {
-			println "Error: some Schema types don't contain the $schema_property_display property: $errors"
-			return
-		}
-	}
-
-	def allUnits = [:]
-	def allHighlightedUnits = [:]
-	def allSchemas = AnalecUtils.selectSchemasInCorpus(debug, analecCorpus, corpus, schema_ursql, 0, 99999999, strict_inclusion)
-
-	if (allSchemas.size() == 0) {
-		println "No schema match for '$schema_ursql' selection. Aborting"
-		return
-	}
-
-	if (debug) println "Building selection of units to highlight..."
-	allHighlightedUnits = AnalecUtils.groupAllUnitesInElements(debug, allSchemas, unit_ursql)
-
-	if (allHighlightedUnits.size() == 0) {
-		println "No schema&unit match for '$schema_ursql' and '$unit_ursql' selection. Aborting"
-		return
-	}
-	if (debug) println "allHighlightedUnits=${allHighlightedUnits.size()}"
-
-	println "annotating ${allSchemas.size()} schemas..." 
-	for (Schema schema : allSchemas) {
-		if (debug) println "	schema="+schema.getProps()
-		def selectedUnits = allHighlightedUnits[schema]
-
-		if (selectedUnits.size() == 0) continue;
-		selectedUnits = AnalecUtils.filterUniteByInclusion(debug, selectedUnits, corpus.getMatches(), strict_inclusion, 0)
-
-		if (selectedUnits.size() == 0) continue;
-
-		if (selectedUnits.size() < minimum_schema_size) {
-			schema.getProps()["LOCALISATION"] = "N/A"
-			if (debug) println schema.getProp(schema_property_display)+" -> N/A"
-			continue; // no need to go further, process next selected eleemnt of corpora view
-		}
-
-
-		if (debug) println "		selectedUnits=${selectedUnits.size()}"
-
-		// get all positions for the selected units
-		def positions = new TreeSet()
-		for (def unit : selectedUnits) {
-			positions.addAll(unit.getDeb()..unit.getFin())
-		}
-		int[] positions_array = positions
-		if (debug) println "		positions=${positions.size()}"
-		
-		// test each property indexes
-		for (def property : properties) {
-			if (debug) println "		testing $property..."
-			def idx = CQI.cpos2Struc(property.getQualifiedName(), positions_array)
-			def hash = new HashSet()
-			hash.addAll(idx)
-			if (debug) println "		hash=$hash"
-			if (hash.size() == 1) { // the units are only in ONE structure
-				int[] struct = hash
-				def ref = CQI.struc2Str(property.getQualifiedName(), struct)[0]
-				println schema.getProp(schema_property_display)+" (${selectedUnits.size} units) -> "+property.getFullName()+" "+ref
-				schema.getProps()["LOCALISATION"] = property.getFullName()+" "+ref
-			} 
-		}
-	}
-}
-
-//println ""+queries.size()+" selected schemas: "+queries
-
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/SchemasCoverageMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/SchemasCoverageMacro.groovy	(revision 0)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/urs/exploit/SchemasCoverageMacro.groovy	(revision 2164)
@@ -0,0 +1,181 @@
+// Copyright © 2019 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.exploit
+
+import groovy.transform.Field
+
+import org.jfree.chart.JFreeChart
+import org.jfree.chart.editor.ChartEditor
+import org.kohsuke.args4j.*
+import org.txm.Toolbox
+import org.txm.annotation.urs.*
+import org.txm.chartsengine.core.preferences.ChartsEnginePreferences
+import org.txm.chartsengine.r.core.RChartsEngine
+import org.txm.macro.urs.AnalecUtils
+import org.txm.progression.core.chartsengine.jfreechart.themes.highcharts.renderers.ProgressionItemSelectionRenderer
+import org.txm.progression.core.functions.Progression
+import org.txm.rcp.Application
+import org.txm.rcp.IImageKeys
+import org.txm.rcp.swt.widget.parameters.*
+import org.txm.searchengine.cqp.CQPSearchEngine
+import org.txm.searchengine.cqp.corpus.*
+import org.txm.searchengine.cqp.corpus.query.CQLQuery
+import org.txm.chartsengine.rcp.*;
+import visuAnalec.elements.*
+
+def scriptName = this.class.getSimpleName()
+
+def selection = []
+for (def s : corpusViewSelections) {
+	if (s instanceof CQPCorpus) selection << s
+	else if (s instanceof Partition) selection.addAll(s.getParts())
+}
+
+if (selection.size() == 0) {
+	println "** $scriptName: please select a Corpus or a Partition in the Corpus view: "+corpusViewSelections
+	return false
+} else {
+	for (def c : selection) c.compute(false)
+}
+
+// BEGINNING OF PARAMETERS
+@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="schema_property_display", usage="PROP", widget="String", required=true, def="REF")
+		String schema_property_display
+		
+@Field @Option(name="unit_ursql", usage="TYPE@PROP=VALUE", widget="String", required=false, def="")
+		String unit_ursql
+@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="structure_properties", usage="name_prpperty,name2_property2,name3_property", widget="String", required=true, def="div_n,p_n")
+		String structure_properties
+@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 (structure_properties.length() == 0) return;
+
+def CQI = CQPSearchEngine.getCqiClient()
+
+for (def corpus : selection) {
+
+	def properties = [corpus.getStructuralUnit("text").getProperty("id")]
+	
+	// build structural unit properties list from the "structure_properties" parameter
+	for (def name : structure_properties.split(",")) {
+		name = name.trim()
+		String[] split = name.split("_", 2);
+		if (split.length == 2) {
+			def su = corpus.getStructuralUnit(split[0])
+			if (su == null) {
+				println "No Structure for name=$name"
+			} else {
+				def p = su.getProperty(split[1])
+				if (p == null) {
+					println "No Structure property for name=$name"
+				} else {
+					properties << p
+				}
+			}
+		} else {
+			println "Wrong structural unit name format: $name"
+		}
+	}
+	def cql_limit_matches = corpus.getMatches()
+	
+	def word = corpus.getWordProperty()
+	def analecCorpus = URSCorpora.getCorpus(corpus)
+	AnalecUtils.defineProperty(Schema.class, analecCorpus, schema_ursql, "LOCALISATION")
+	URSCorpora.getVue(corpus).initVueParDefaut()
+
+	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 "** The $unit_ursql unit URSQL cannot be computed in the corpus with types: $errors."
+		return;
+	}
+	
+	if (schema_property_display.length() > 0) {
+		errors = AnalecUtils.isPropertyDefined(Schema.class, analecCorpus, AnalecUtils.getFilterParameters(schema_ursql)[0], schema_property_display).size()
+		if (errors > 0) {
+			println "Error: some Schema types don't contain the $schema_property_display property: $errors"
+			return
+		}
+	}
+
+	def allUnits = [:]
+	def allHighlightedUnits = [:]
+	def allSchemas = AnalecUtils.selectSchemasInCorpus(debug, analecCorpus, corpus, schema_ursql, 0, 99999999, strict_inclusion)
+
+	if (allSchemas.size() == 0) {
+		println "No schema match for '$schema_ursql' selection. Aborting"
+		return
+	}
+
+	if (debug) println "Building selection of units to highlight..."
+	allHighlightedUnits = AnalecUtils.groupAllUnitesInElements(debug, allSchemas, unit_ursql)
+
+	if (allHighlightedUnits.size() == 0) {
+		println "No schema&unit match for '$schema_ursql' and '$unit_ursql' selection. Aborting"
+		return
+	}
+	if (debug) println "allHighlightedUnits=${allHighlightedUnits.size()}"
+
+	println "annotating ${allSchemas.size()} schemas..." 
+	for (Schema schema : allSchemas) {
+		if (debug) println "	schema="+schema.getProps()
+		def selectedUnits = allHighlightedUnits[schema]
+
+		if (selectedUnits.size() == 0) continue;
+		selectedUnits = AnalecUtils.filterUniteByInclusion(debug, selectedUnits, corpus.getMatches(), strict_inclusion, 0)
+
+		if (selectedUnits.size() == 0) continue;
+
+		if (selectedUnits.size() < minimum_schema_size) {
+			schema.getProps()["LOCALISATION"] = "N/A"
+			if (debug) println schema.getProp(schema_property_display)+" -> N/A"
+			continue; // no need to go further, process next selected eleemnt of corpora view
+		}
+
+
+		if (debug) println "		selectedUnits=${selectedUnits.size()}"
+
+		// get all positions for the selected units
+		def positions = new TreeSet()
+		for (def unit : selectedUnits) {
+			positions.addAll(unit.getDeb()..unit.getFin())
+		}
+		int[] positions_array = positions
+		if (debug) println "		positions=${positions.size()}"
+		
+		// test each property indexes
+		for (def property : properties) {
+			if (debug) println "		testing $property..."
+			def idx = CQI.cpos2Struc(property.getQualifiedName(), positions_array)
+			def hash = new HashSet()
+			hash.addAll(idx)
+			if (debug) println "		hash=$hash"
+			if (hash.size() == 1) { // the units are only in ONE structure
+				int[] struct = hash
+				def ref = CQI.struc2Str(property.getQualifiedName(), struct)[0]
+				println schema.getProp(schema_property_display)+" (${selectedUnits.size} units) -> "+property.getFullName()+" "+ref
+				schema.getProps()["LOCALISATION"] = property.getFullName()+" "+ref
+			} 
+		}
+	}
+}
+
+//println ""+queries.size()+" selected schemas: "+queries
+
