Index: tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/messages_ru.properties
===================================================================
--- tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/messages_ru.properties	(revision 417)
+++ tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/messages_ru.properties	(revision 418)
@@ -0,0 +1,7 @@
+
+CooccurrencesEditor_27 = Расчет запроса
+CooccurrencesEditor_28 = Расчет ответов
+CooccurrencesEditor_29 = Расчет подписей к строкам
+CooccurrencesEditor_30 = Подсчет
+CooccurrencesEditor_31 = Расчет словарной таблицы
+CooccurrencesEditor_32 = Расчет показателей специфичности\	
Index: tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/messages_fr.properties
===================================================================
--- tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/messages_fr.properties	(revision 417)
+++ tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/messages_fr.properties	(revision 418)
@@ -1,24 +1,31 @@
 
-Cooccurrence_0   = Coocurrence: 
-Cooccurrence_1   = ** Error: can't find 'n' or 'o': 
-Cooccurrence_10  = \ properties: 
-Cooccurrence_102 = ** Error: negative argument in 'factln' function
-Cooccurrence_103 = ** Error: negative argument in 'rbicoln' function
-Cooccurrence_105 = Occ\	Freq\	CoFreq\	Score\	MeanDist\	Mode
-Cooccurrence_106 = \n
-Cooccurrence_107 = ** Error: 
-Cooccurrence_11  = Occ
-Cooccurrence_12  = Freq
-Cooccurrence_13  = CoFreq
-Cooccurrence_14  = Score
-Cooccurrence_15  = MeanDist
-Cooccurrence_16  = Mode
-Cooccurrence_2   = Cooc: 
-Cooccurrence_22  = Error: ref_forms.length ! ref_freqs.length
-Cooccurrence_23  = Error: no cooccurrents
-Cooccurrence_4   = \ F: 
-Cooccurrence_5   = ** Impossible to compute cooccurrences with this concordance 
-Cooccurrence_6   = Occ\	Freq\	CoFreq\	Score\	MeanDist\	Mode
-Cooccurrence_7   = \ Occ:
-Cooccurrence_8   = \ Score:
-Cooccurrence_9   = \ MeanDist:
+Cooccurrence_0         = Coocurrence: 
+Cooccurrence_1         = ** Error: can't find 'n' or 'o': 
+Cooccurrence_10        = \ properties: 
+Cooccurrence_102       = ** Error: negative argument in 'factln' function
+Cooccurrence_103       = ** Error: negative argument in 'rbicoln' function
+Cooccurrence_105       = Occ\	Freq\	CoFreq\	Score\	MeanDist\	Mode
+Cooccurrence_106       = \n
+Cooccurrence_107       = ** Error: 
+Cooccurrence_11        = Occ
+Cooccurrence_12        = Freq
+Cooccurrence_13        = CoFreq
+Cooccurrence_14        = Score
+Cooccurrence_15        = MeanDist
+Cooccurrence_16        = Mode
+Cooccurrence_2         = Cooc: 
+Cooccurrence_22        = Error: ref_forms.length ! ref_freqs.length
+Cooccurrence_23        = Error: no cooccurrents
+Cooccurrence_4         = \ F: 
+Cooccurrence_5         = ** Impossible to compute cooccurrences with this concordance 
+Cooccurrence_6         = Occ\	Freq\	CoFreq\	Score\	MeanDist\	Mode
+Cooccurrence_7         = \ Occ:
+Cooccurrence_8         = \ Score:
+Cooccurrence_9         = \ MeanDist:
+
+CooccurrencesEditor_27 = Calcul des requêtes
+CooccurrencesEditor_28 = Calcul des retours
+CooccurrencesEditor_29 = Calcul des signatures de lignes
+CooccurrencesEditor_30 = Comptage
+CooccurrencesEditor_31 = Calcul de la table lexicale
+CooccurrencesEditor_32 = Calcul des indices de spécificité\	
Index: tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/CooccurrenceCoreMessages.java
===================================================================
--- tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/CooccurrenceCoreMessages.java	(revision 417)
+++ tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/CooccurrenceCoreMessages.java	(revision 418)
@@ -26,6 +26,13 @@
 	public static String Cooccurrence_8;
 	public static String Cooccurrence_9;
 
+	public static String CooccurrencesEditor_27;
+	public static String CooccurrencesEditor_28;
+	public static String CooccurrencesEditor_29;
+	public static String CooccurrencesEditor_30;
+	public static String CooccurrencesEditor_31;
+	public static String CooccurrencesEditor_32;
+
 	
 	//FIXME: unused keys
 	public static String Cooccurrence_0;
Index: tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/messages.properties
===================================================================
--- tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/messages.properties	(revision 417)
+++ tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/messages.properties	(revision 418)
@@ -1,24 +1,31 @@
 
-Cooccurrence_0   = Coocurrence : 
-Cooccurrence_1   = ** Echec de la recherche de 'n' ou 'o' : 
-Cooccurrence_10  = \ propriétés : 
-Cooccurrence_102 = ** Erreur : argument négatif dans la fonction 'factln'
-Cooccurrence_103 = ** Erreur : argument négatif dans la fonction 'rbicoln'
-Cooccurrence_105 = Occ\	Fréq\	CoFréq\	Indice\	DistMoy\	Mode
-Cooccurrence_106 = \n
-Cooccurrence_107 = ** Erreur : 
-Cooccurrence_11  = Occ
-Cooccurrence_12  = Fréq
-Cooccurrence_13  = CoFréq
-Cooccurrence_14  = Indice
-Cooccurrence_15  = DistMoy
-Cooccurrence_16  = Mode
-Cooccurrence_2   = Cooc : 
-Cooccurrence_22  = Erreur: ref_forms.length ! ref_freqs.length
-Cooccurrence_23  = Erreur: pas de cooccurrents
-Cooccurrence_4   = \ F : 
-Cooccurrence_5   = ** Impossible de calculer des cooccurrences avec cette concordance
-Cooccurrence_6   = Occ\	Fréq\	CoFréq\	Indice\	DistMoy\	Mode
-Cooccurrence_7   = \ Occ :
-Cooccurrence_8   = \ Indice:
-Cooccurrence_9   = \ DistMoy:
+Cooccurrence_0         = Coocurrence : 
+Cooccurrence_1         = ** Echec de la recherche de 'n' ou 'o' : 
+Cooccurrence_10        = \ propriétés : 
+Cooccurrence_102       = ** Erreur : argument négatif dans la fonction 'factln'
+Cooccurrence_103       = ** Erreur : argument négatif dans la fonction 'rbicoln'
+Cooccurrence_105       = Occ\	Fréq\	CoFréq\	Indice\	DistMoy\	Mode
+Cooccurrence_106       = \n
+Cooccurrence_107       = ** Erreur : 
+Cooccurrence_11        = Occ
+Cooccurrence_12        = Fréq
+Cooccurrence_13        = CoFréq
+Cooccurrence_14        = Indice
+Cooccurrence_15        = DistMoy
+Cooccurrence_16        = Mode
+Cooccurrence_2         = Cooc : 
+Cooccurrence_22        = Erreur: ref_forms.length ! ref_freqs.length
+Cooccurrence_23        = Erreur: pas de cooccurrents
+Cooccurrence_4         = \ F : 
+Cooccurrence_5         = ** Impossible de calculer des cooccurrences avec cette concordance
+Cooccurrence_6         = Occ\	Fréq\	CoFréq\	Indice\	DistMoy\	Mode
+Cooccurrence_7         = \ Occ :
+Cooccurrence_8         = \ Indice:
+Cooccurrence_9         = \ DistMoy:
+
+CooccurrencesEditor_27 = build queries
+CooccurrencesEditor_28 = get matches
+CooccurrencesEditor_29 = build line signatures
+CooccurrencesEditor_30 = counting
+CooccurrencesEditor_31 = build lexical table
+CooccurrencesEditor_32 = get specif scores
Index: tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java
===================================================================
--- tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java	(revision 417)
+++ tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java	(revision 418)
@@ -46,10 +46,12 @@
 import org.txm.concordance.core.functions.Line;
 import org.txm.cooccurrence.core.functions.comparators.CLineComparator;
 import org.txm.cooccurrence.core.messages.CooccurrenceCoreMessages;
-import org.txm.functions.Function;
+import org.txm.cooccurrence.core.preferences.CooccurrencePreferences;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.core.results.TXMParameters;
+import org.txm.functions.ProgressWatcher;
+import org.txm.functions.TXMCommand;
 import org.txm.index.core.functions.Index;
-import org.txm.lexicaltable.core.functions.LexicalTable;
-import org.txm.lexicaltable.core.functions.LexicalTableFactory;
 import org.txm.lexicaltable.core.statsengine.r.data.LexicalTableImpl;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.clientExceptions.UnexpectedAnswerException;
@@ -61,9 +63,7 @@
 import org.txm.searchengine.cqp.corpus.query.Match;
 import org.txm.searchengine.cqp.corpus.query.Query;
 import org.txm.searchengine.cqp.serverException.CqiServerError;
-import org.txm.specificities.core.functions.SpecificitesResult;
 import org.txm.specificities.core.statsengine.r.function.SpecificitiesImpl;
-import org.txm.lexicaltable.core.statsengine.data.ILexicalTable;
 import org.txm.statsengine.core.StatException;
 import org.txm.statsengine.r.core.RWorkspace;
 import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
@@ -76,7 +76,7 @@
  * @author mdecorde
  * 
  */
-public class Cooccurrence extends Function  {
+public class Cooccurrence extends TXMCommand  {
 
 	/** The voc. */
 	Index voc;
@@ -105,16 +105,16 @@
 	StructuralUnit limit;
 
 	/** The maxleft. */
-	int maxleft;
+	int maxLeft;
 
 	/** The maxright. */
-	int maxright;
+	int maxRight;
 
 	/** The minleft. */
-	int minleft = 1;
+	int minLeft = 1;
 
 	/** The minright. */
-	int minright = 1;
+	int minRight = 1;
 
 	/** The lines. */
 	List<CLine> lines = new ArrayList<CLine>();
@@ -156,13 +156,13 @@
 	private Query contextquery;
 
 	/** The minf. */
-	private int minf;
+	private int minFreq;
 
 	/** The minscore. */
-	private double minscore;
+	private double minScore;
 
 	/** The mincof. */
-	private int mincof;
+	private int minCof;
 
 	/** The anticontextquery. */
 	private Query anticontextquery;
@@ -266,24 +266,24 @@
 	 * @param query the query
 	 * @param properties the properties
 	 * @param limit the limit
-	 * @param maxleft the maxleft
-	 * @param minleft the minleft
-	 * @param minright the minright
-	 * @param maxright the maxright
-	 * @param minf the minf
-	 * @param mincof the mincof
-	 * @param minscore the minscore
+	 * @param maxLeft the maxleft
+	 * @param minLeft the minleft
+	 * @param minRight the minright
+	 * @param maxRight the maxright
+	 * @param minFreq the minf
+	 * @param minCof the mincof
+	 * @param minsSore the minscore
 	 * @param includeXpivot the include xpivot
 	 * @throws Exception the exception
 	 */
+	@Deprecated
 	public Cooccurrence(Corpus corpus, Query query, List<Property> properties,
-			StructuralUnit limit, int maxleft, int minleft, int minright,
-			int maxright, int minf, int mincof, double minscore, boolean includeXpivot, boolean buildLexicalTableWithCooccurrents)
+			StructuralUnit limit, int maxLeft, int minLeft, int minRight,
+			int maxRight, int minFreq, int minCof, double minsSore, boolean includeXpivot, boolean buildLexicalTableWithCooccurrents)
 					throws Exception {
 		
 		super(corpus);
 		
-		long time = System.currentTimeMillis();
 
 		// System.out.println(Messages.Cooccurrence_0);
 		this.corpus = corpus;
@@ -293,19 +293,39 @@
 
 		this.properties = properties;
 		this.limit = limit;
-		this.minleft = minleft;
-		this.maxleft = maxleft;
-		this.minright = minright;
-		this.maxright = maxright;
-		this.minf = minf;
-		this.minscore = minscore;
-		this.mincof = mincof;
+		this.minLeft = minLeft;
+		this.maxLeft = maxLeft;
+		this.minRight = minRight;
+		this.maxRight = maxRight;
+		this.minFreq = minFreq;
+		this.minScore = minsSore;
+		this.minCof = minCof;
 		this.includeXpivot = includeXpivot;
 		this.buildLexicalTableWithCooccurrents = buildLexicalTableWithCooccurrents;
 
 		//System.out.println("-- Done"); //$NON-NLS-1$
 	}
 
+
+	/**
+	 * Creates an empty <link>Cooccurrence</link> object, child of the specified <link>Corpus</link>.
+	 * @param corpus
+	 */
+	public Cooccurrence(Corpus corpus) {
+		this(corpus, null);
+	}
+
+	/**
+	 * Creates an empty <link>Cooccurrence</link> object, child of the specified <link>Corpus</link>.
+	 * @param corpus
+	 * @param parameters
+	 */
+	public Cooccurrence(Corpus corpus, TXMParameters parameters) {
+		super(corpus, parameters);
+		this.corpus = corpus;
+	}
+
+	
 	public boolean getIncludeXPivot() {
 		return includeXpivot;
 	}
@@ -348,24 +368,6 @@
 		getLines();
 	}
 
-	public void clearMemory() {
-		distances = null;
-		distancescounts = null;
-		counts = null;
-		indexfreqs = null;
-		counted = null;
-		m1 = null;
-		m2 = null;
-		m3 = null;
-		allsignaturesstr = null;
-		lt = null;
-		keysToString = null;
-		occproperties = null;
-		count = null;
-		dist = null;
-		freq = null;
-		scores = null;
-	}
 
 	/**
 	 * Step query limits.
@@ -378,51 +380,51 @@
 		{
 			String tempquery =""; //$NON-NLS-1$
 			String lname = limit.getName();
-			if (minleft > 0 ) { // test if there is a left context
-				tempquery += "(<"	+ lname + ">[]* </" + lname + ">){" + (maxleft) + "," + (maxleft) + "}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+			if (minLeft > 0 ) { // test if there is a left context
+				tempquery += "(<"	+ lname + ">[]* </" + lname + ">){" + (maxLeft) + "," + (maxLeft) + "}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
 			}
 			// (<p>[]*</p>){0, 50} "je" (<p>[]*</p>){0, 50}
 			tempquery +=" <" + lname + ">[]* " + query.getQueryString() + " []* </" + lname + "> "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-			if (minright > 0) { // test if there is a right context
-				tempquery+="(<" + lname + ">[]* </" + lname + ">){" + (maxright) + "," + (maxright) + "}";  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+			if (minRight > 0) { // test if there is a right context
+				tempquery+="(<" + lname + ">[]* </" + lname + ">){" + (maxRight) + "," + (maxRight) + "}";  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
 			}
 			this.contextquery = new Query(tempquery);
 
 			if (includeXpivot) {
 				String anticontextquerystring = ""; //$NON-NLS-1$
-				if (minleft > 1)// minleft = 2..N
-					anticontextquerystring += "(<" + lname + ">[]* </" + lname + ">){" + (minleft - 1) + "," + (minleft - 1) + "} <" + lname + ">[]* "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+				if (minLeft > 1)// minleft = 2..N
+					anticontextquerystring += "(<" + lname + ">[]* </" + lname + ">){" + (minLeft - 1) + "," + (minLeft - 1) + "} <" + lname + ">[]* "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
 				anticontextquerystring += query.getQueryString();
-				if (minright > 1) // minright = 2..N
-					anticontextquerystring += " []* </" + lname + "> (<" + lname + ">[]* </" + lname + ">){" + (minright - 1) + "," + (minright - 1) + "}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+				if (minRight > 1) // minright = 2..N
+					anticontextquerystring += " []* </" + lname + "> (<" + lname + ">[]* </" + lname + ">){" + (minRight - 1) + "," + (minRight - 1) + "}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
 				this.anticontextquery = new Query(anticontextquerystring);
 			} else {
 				String anticontextquerystring = ""; //$NON-NLS-1$
-				if (minleft > 0)// minleft = 2..N
-					anticontextquerystring += "(<" + lname + ">[]* </" + lname + ">){" + (minleft - 1) + "," + (minleft - 1) + "} <" + lname + ">[]* "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+				if (minLeft > 0)// minleft = 2..N
+					anticontextquerystring += "(<" + lname + ">[]* </" + lname + ">){" + (minLeft - 1) + "," + (minLeft - 1) + "} <" + lname + ">[]* "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
 				anticontextquerystring += query.getQueryString();
-				if (minright > 0) // minright = 2..N
-					anticontextquerystring += " []* </" + lname + "> (<" + lname + ">[]* </" + lname + ">){" + (minright - 1) + "," + (minright - 1) + "}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+				if (minRight > 0) // minright = 2..N
+					anticontextquerystring += " []* </" + lname + "> (<" + lname + ">[]* </" + lname + ">){" + (minRight - 1) + "," + (minRight - 1) + "}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
 				this.anticontextquery = new Query(anticontextquerystring);
 			}
 		} else // word context
 		{
 			String tempquery =""; //$NON-NLS-1$
-			if (minleft > 0 ) { // test if there is a left context
-				tempquery += "[]{"	+ maxleft + "," + maxleft + "} "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			if (minLeft > 0 ) { // test if there is a left context
+				tempquery += "[]{"	+ maxLeft + "," + maxLeft + "} "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 			}
 			tempquery+= query.getQueryString();
 
-			if (minright > 0) { // test if there is a right context
-				tempquery+=" []{" + maxright + "," + maxright + "} "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			if (minRight > 0) { // test if there is a right context
+				tempquery+=" []{" + maxRight + "," + maxRight + "} "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 			}
 			this.contextquery = new Query(tempquery); 
 			String anticontextquerystring = ""; //$NON-NLS-1$
-			if (minleft > 1)
-				anticontextquerystring += "[]{" + (minleft - 1) + ", " + (minleft - 1) + "}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			if (minLeft > 1)
+				anticontextquerystring += "[]{" + (minLeft - 1) + ", " + (minLeft - 1) + "}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 			anticontextquerystring += query.getQueryString();
-			if (minright > 1)
-				anticontextquerystring += "[]{" + (minright -1) + "," + (minright -1)+ "} "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			if (minRight > 1)
+				anticontextquerystring += "[]{" + (minRight -1) + "," + (minRight -1)+ "} "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 			this.anticontextquery = new Query(anticontextquerystring);
 		}
 		return true;
@@ -834,7 +836,7 @@
 						((float) (distances.get(signaturestr) / distancescounts
 								.get(signaturestr))) - 1.0f, -1);
 				//System.out.println(cline);
-				if (cline.freq >= this.minf	&& cline.nbocc >= this.mincof && Math.abs(cline.score) >= this.minscore)
+				if (cline.freq >= this.minFreq	&& cline.nbocc >= this.minCof && Math.abs(cline.score) >= this.minScore)
 				{
 					if (cline.score >= Integer.MAX_VALUE - 5)
 						cline.score = Float.MAX_EXPONENT;
@@ -910,8 +912,8 @@
 			// System.out.println("CONC PROPS :"+conc.getViewProperties());
 			properties = conc.getViewProperties();
 			limit = null;
-			maxleft = conc.getLeftContextSize();
-			maxright = conc.getRightContextSize();
+			maxLeft = conc.getLeftContextSize();
+			maxRight = conc.getRightContextSize();
 			this.conclines = conclines;
 			return true;
 		} catch (CqiClientException e) {
@@ -933,11 +935,129 @@
 		seuil_score = score;
 	}
 
+
 	/**
+	 * 
+	 * @param watcher
+	 * @param query
+	 * @param properties
+	 * @param limit
+	 * @param minleft
+	 * @param maxleft
+	 * @param minright
+	 * @param maxright
+	 * @param minf
+	 * @param minscore
+	 * @param mincof
+	 * @param includeXpivot
+	 * @param buildLexicalTableWithCooccurrents
+	 * @return
+	 */
+	public boolean compute(ProgressWatcher watcher, Query query, List<Property> properties, StructuralUnit limit, int minleft, int maxleft, int minright,
+			int maxright, int minf, double minscore, int mincof, boolean includeXpivot, boolean buildLexicalTableWithCooccurrents)	{
+		
+		this.query = query;
+		this.properties = properties;
+		this.limit = limit;
+		this.minLeft = minleft;
+		this.maxLeft = maxleft;
+		this.minRight = minright;
+		this.maxRight = maxright;
+		this.minFreq = minf;
+		this.minScore = minscore;
+		this.minCof = mincof;
+		this.includeXpivot = includeXpivot;
+		this.buildLexicalTableWithCooccurrents = buildLexicalTableWithCooccurrents;
+
+		//FIXME: debug
+		System.out.println("cooc: "+corpus+" "+query+" "+properties+" "+limit+" "+maxleft+" "+minleft+" "+minright+" "+maxright+" "+minf+" "+mincof+" "+minscore+" "+includeXpivot);
+		
+		this.setCurrentMonitor(watcher);
+		monitor.subTask(CooccurrenceCoreMessages.CooccurrencesEditor_27);
+		try {
+			if (!this.stepQueryLimits()) {
+				return false;
+			}	
+			
+			monitor.subTask(CooccurrenceCoreMessages.CooccurrencesEditor_28);
+			if (!this.stepGetMatches()) {
+				return false;
+			}
+			monitor.worked(10);
+			
+			monitor.subTask(CooccurrenceCoreMessages.CooccurrencesEditor_29);
+			if (!this.stepBuildSignatures())
+				return false;
+			monitor.worked(10);
+			
+			monitor.subTask(CooccurrenceCoreMessages.CooccurrencesEditor_30);
+			if (!this.stepCount())	{
+				return false;
+			}
+			monitor.worked(10);
+			
+			monitor.subTask(CooccurrenceCoreMessages.CooccurrencesEditor_31);
+			this.acquireSemaphore();
+			if (!this.stepBuildLexicalTable())	{
+				return false;
+			}
+			monitor.worked(10);
+			this.releaseSemaphore();
+			
+			monitor.subTask(CooccurrenceCoreMessages.CooccurrencesEditor_32);
+			this.acquireSemaphore();
+			if (!this.stepGetScores())	{
+				return false;
+			}
+			monitor.worked(10);
+			this.releaseSemaphore();
+			
+			this.clearMemory();
+		}
+		// user canceling
+		catch(ThreadDeath e) {
+			return false;
+		}
+		catch(Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+		
+		return true;
+
+	}
+	
+	
+	@Override
+	public boolean compute(ProgressWatcher watcher) {
+		if(this.compute(
+				watcher,
+				new Query(this.getStringParameterValue(CooccurrencePreferences.QUERY)),
+				(List<Property>) parameters.get("properties"),
+				(StructuralUnit) parameters.get("limit"),
+				this.getIntParameterValue(CooccurrencePreferences.MIN_LEFT),
+				this.getIntParameterValue(CooccurrencePreferences.MAX_LEFT),
+				this.getIntParameterValue(CooccurrencePreferences.MIN_RIGHT),
+				this.getIntParameterValue(CooccurrencePreferences.MAX_RIGHT),
+				this.getIntParameterValue(CooccurrencePreferences.MIN_FREQ),
+				this.getIntParameterValue(CooccurrencePreferences.MIN_SCORE),
+				this.getIntParameterValue(CooccurrencePreferences.MIN_COUNT),
+				this.getBooleanParameterValue(CooccurrencePreferences.INCLUDE_X_PIVOT),
+				this.getBooleanParameterValue(CooccurrencePreferences.PARTIAL_LEXICAL_TABLE)))	{
+			
+			// persistence
+			TXMPreferences.putLocalParameters(this, parameters);
+			return true;
+		}
+		return false;
+	}
+	
+	/**
 	 * Compute.
 	 *
 	 * @return true, if successful
 	 */
+	//FIXME: not used? or may in portal? in any case, need to use other method compute() now
 	public boolean compute() {
 		if (conclines == null || conc == null || P == -1 || FA == -1
 				|| properties == null || corpus == null) {
@@ -1515,7 +1635,7 @@
 	 * @param maxleft the new max left
 	 */
 	public void setMaxLeft(int maxleft) {
-		this.maxleft = maxleft;
+		this.maxLeft = maxleft;
 	}
 
 	/**
@@ -1524,7 +1644,7 @@
 	 * @param minleft the new min left
 	 */
 	public void setMinLeft(int minleft) {
-		this.minleft = minleft;
+		this.minLeft = minleft;
 	}
 
 	/**
@@ -1533,7 +1653,7 @@
 	 * @param maxright the new max right
 	 */
 	public void setMaxRight(int maxright) {
-		this.maxright = maxright;
+		this.maxRight = maxright;
 	}
 
 	/**
@@ -1542,7 +1662,7 @@
 	 * @param minright the new min right
 	 */
 	public void setMinRight(int minright) {
-		this.minright = minright;
+		this.minRight = minright;
 	}
 
 	/**
@@ -1551,7 +1671,7 @@
 	 * @return the max left
 	 */
 	public int getMaxLeft() {
-		return maxleft;
+		return maxLeft;
 	}
 
 	/**
@@ -1560,7 +1680,7 @@
 	 * @return the min left
 	 */
 	public int getMinLeft() {
-		return minleft;
+		return minLeft;
 	}
 
 	/**
@@ -1569,7 +1689,7 @@
 	 * @return the max right
 	 */
 	public int getMaxRight() {
-		return maxright;
+		return maxRight;
 	}
 
 	/**
@@ -1578,7 +1698,7 @@
 	 * @return the min right
 	 */
 	public int getMinRight() {
-		return minright;
+		return minRight;
 	}
 
 	/** The nocooc. */
@@ -1646,12 +1766,33 @@
 		try {
 			this.writer.flush();
 			this.writer.close();	
-		} catch (IOException e) {
+		} catch (NullPointerException e) {
+			// do nothing
+		} catch (Exception e) {
 			// TODO Auto-generated catch block
 			org.txm.utils.logger.Log.printStackTrace(e);
 		}
 	}
 
+	//FIXME: useless?
+	public void clearMemory() {
+		distances = null;
+		distancescounts = null;
+		counts = null;
+		indexfreqs = null;
+		counted = null;
+		m1 = null;
+		m2 = null;
+		m3 = null;
+		allsignaturesstr = null;
+		lt = null;
+		keysToString = null;
+		occproperties = null;
+		count = null;
+		dist = null;
+		freq = null;
+		scores = null;
+	}
 	
 	@Override
 	public String getName() {
@@ -1661,30 +1802,23 @@
 
 	@Override
 	public String getSimpleName() {
-		return query + " (" + (maxleft-1) + ", " + (maxright-1) + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		return query + " (" + (maxLeft-1) + ", " + (maxRight-1) + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 	}
 
 	@Override
 	public String getDetails() {
-		return this.toInfos();
-	}
-
-	/**
-	 * To infos.
-	 *
-	 * @return the string
-	 */
-	public String toInfos() {
 		StringBuffer buf = new StringBuffer(60);
 		buf.append("Cooc: \n"); //$NON-NLS-1$
 		buf.append(" Corpus: " + this.corpus + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 		buf.append(" Query: " + this.query + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 		buf.append(" Properties: " + this.properties + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 		buf.append(" Structure: " + this.limit + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
-		buf.append(" Empans: " + (this.minleft-1) + "<left<" + (this.maxleft-1) + " ; " + (this.minright-1) + "<right<" + (this.maxright-1) + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+		buf.append(" Empans: " + (this.minLeft-1) + "<left<" + (this.maxLeft-1) + " ; " + (this.minRight-1) + "<right<" + (this.maxRight-1) + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
 		buf.append(" Filters: freq>" + this.seuil_freq + " ; count>" + seuil_count + " ; score>" + seuil_score + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 		return buf.toString();
 	}
 
 
+
+
 }
Index: tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/preferences/CooccurrencePreferences.java
===================================================================
--- tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/preferences/CooccurrencePreferences.java	(revision 417)
+++ tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/preferences/CooccurrencePreferences.java	(revision 418)
@@ -39,8 +39,13 @@
 	public static final String MIN_RIGHT = PREFERENCES_PREFIX + "min_right"; //$NON-NLS-1$
 	public static final String MAX_RIGHT = PREFERENCES_PREFIX + "max_right"; //$NON-NLS-1$
 
+	public static final String INCLUDE_X_PIVOT = PREFERENCES_PREFIX + "include_x_pivot"; //$NON-NLS-1$
 	public static final String PARTIAL_LEXICAL_TABLE = PREFERENCES_PREFIX + "partial_lexical_table"; //$NON-NLS-1$
 	
+	// local result preferences
+	public static final String QUERY = PREFERENCES_PREFIX + "query"; //$NON-NLS-1$
+
+	
 	/**
 	 * 
 	 */
@@ -52,7 +57,7 @@
 	public void initializeDefaultPreferences() {
 		Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE);
 		
-		preferences.put(SCORE_FORMAT, "E00");
+		preferences.put(SCORE_FORMAT, "E00"); //$NON-NLS-1$
 		preferences.putInt(MIN_FREQ, 2);
 		preferences.putInt(MIN_COUNT, 2);
 		preferences.putDouble(MIN_SCORE, 2.0);
@@ -62,7 +67,9 @@
 		preferences.putInt(MIN_RIGHT, 0);
 		preferences.putInt(MAX_RIGHT, 10);
 		
+		preferences.put(QUERY, ""); //$NON-NLS-1$
 		
+		
 	}
 	
 }
