Index: TXM/trunk/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/AnnotationWriter.java
===================================================================
--- TXM/trunk/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/AnnotationWriter.java	(revision 3386)
+++ TXM/trunk/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/AnnotationWriter.java	(revision 3387)
@@ -228,6 +228,7 @@
 		Log.fine(" - Copying previous version of XML files in: " + previousXMLTXMDirectory);
 		// for all annotation PER TEXT, update the XML-TXM files
 		currentText = 0;
+		ConsoleProgressBar cpb = new ConsoleProgressBar(annotationsPerTexts.size());
 		while (currentText < end_limits.length) { // end limits : 10, 30, 45, 55, 103
 			currentXMLFile = new File(txmDirectory, textsIds.get(currentText) + ".xml");
 			ArrayList<Annotation> allAnnotations = annotationsPerTexts.get(textsIds.get(currentText));
@@ -267,7 +268,9 @@
 				}
 			}
 			currentText++;
+			cpb.tick();
 		}
+		cpb.done();
 		
 		return true;
 	}
Index: TXM/trunk/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java
===================================================================
--- TXM/trunk/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java	(revision 3386)
+++ TXM/trunk/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java	(revision 3387)
@@ -1449,7 +1449,7 @@
 				distances.put(signaturestr, (distances.get(signaturestr)) + dist);
 			}
 			else {
-				distances.put(signaturestr, 0.0);
+				distances.put(signaturestr, (double)dist);
 			}
 
 			Integer count = (counts.get(signaturestr));
@@ -1465,7 +1465,7 @@
 			}
 
 			// if ("[1599]".equals(signaturestr)) {
-			// System.out.println("p=" + position + " d=" + dist + " total(d)=" + distances.get(signaturestr) + " c=" + counts.get(signaturestr));
+			//System.out.println("sign="+allsignaturesstr.get(position)+" p=" + position + " c=" + counts.get(signaturestr) + " d=" + dist + " total(d)=" + distances.get(signaturestr)); 
 			// }
 			// }
 
@@ -1585,7 +1585,7 @@
 						indexfreqs.get(specifrownames[ii]), scores[ii][1], // freq
 						((float) (distances.get(signaturestr) / counts.get(signaturestr))), // mean distance
 						-1);
-				if (debug) System.out.println("Line: "+specifrownames[ii]+" dists="+distances.get(signaturestr)+" counts="+counts.get(signaturestr)+" mean="+((float) (distances.get(signaturestr) / counts.get(signaturestr))));
+				// System.out.println("Line: "+specifrownames[ii]+" dists="+distances.get(signaturestr)+" counts="+counts.get(signaturestr)+" mean="+((float) (distances.get(signaturestr) / counts.get(signaturestr))));
 				// select the line
 				if (cline.freq >= this.pFminFilter && cline.nbocc >= this.pFCoocFilter && cline.score >= this.pScoreMinFilter) {
 					if (cline.score >= Integer.MAX_VALUE - 5) {
Index: TXM/trunk/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/preferences/CooccurrencePreferences.java
===================================================================
--- TXM/trunk/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/preferences/CooccurrencePreferences.java	(revision 3386)
+++ TXM/trunk/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/preferences/CooccurrencePreferences.java	(revision 3387)
@@ -31,6 +31,7 @@
 
 	public static final String INCLUDE_X_PIVOT = "include_x_pivot"; //$NON-NLS-1$
 	public static final String PARTIAL_LEXICAL_TABLE = "partial_lexical_table"; //$NON-NLS-1$
+	public static final String MILESTONE_STRUCTURES_TO_IGNORE = "milestone_structures_to_ignore";
 	
 
 	public static final String QUERY_FILTER = "query_filter"; //$NON-NLS-1$
@@ -41,7 +42,9 @@
 	 * @return the instance
 	 */
 	public static TXMPreferences getInstance()	{
+		
 		if (!TXMPreferences.instances.containsKey(CooccurrencePreferences.class)) {
+			
 			new CooccurrencePreferences();
 		}
 		return TXMPreferences.instances.get(CooccurrencePreferences.class);
@@ -50,6 +53,7 @@
 
 	@Override
 	public void initializeDefaultPreferences() {
+		
 		super.initializeDefaultPreferences();
 		Preferences preferences = this.getDefaultPreferencesNode();
 		
@@ -63,9 +67,8 @@
 		preferences.putInt(MIN_RIGHT, 1);
 		preferences.putInt(MAX_RIGHT, 10);
 		
+		preferences.put(MILESTONE_STRUCTURES_TO_IGNORE, "txmcorpus,text,anchor,cb,fw,gb,lb,milestone,pb");
 		preferences.put(UNIT_PROPERTIES, TXMPreferences.DEFAULT_UNIT_PROPERTY);
-		
-		
 	}
 	
 }
Index: TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/preferences/CoocPreferencePage.java
===================================================================
--- TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/preferences/CoocPreferencePage.java	(revision 3386)
+++ TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/preferences/CoocPreferencePage.java	(revision 3387)
@@ -1,107 +0,0 @@
-// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
-// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
-// Lyon 2, University of Franche-Comté, University of Nice
-// Sophia Antipolis, University of Paris 3.
-// 
-// The TXM platform is free software: you can redistribute it
-// and/or modify it under the terms of the GNU General Public
-// License as published by the Free Software Foundation,
-// either version 2 of the License, or (at your option) any
-// later version.
-// 
-// The TXM platform is distributed in the hope that it will be
-// useful, but WITHOUT ANY WARRANTY; without even the implied
-// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-// PURPOSE. See the GNU General Public License for more
-// details.
-// 
-// You should have received a copy of the GNU General
-// Public License along with the TXM platform. If not, see
-// http://www.gnu.org/licenses.
-// 
-// 
-// 
-// $LastChangedDate:$
-// $LastChangedRevision:$
-// $LastChangedBy:$ 
-//
-package org.txm.cooccurrence.rcp.preferences;
-
-import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.jface.preference.IntegerFieldEditor;
-import org.eclipse.jface.preference.StringFieldEditor;
-import org.eclipse.ui.IWorkbench;
-import org.txm.cooccurrence.core.preferences.CooccurrencePreferences;
-import org.txm.cooccurrence.rcp.adapters.CooccurrenceAdapterFactory;
-import org.txm.cooccurrence.rcp.messages.CooccurrenceUIMessages;
-import org.txm.core.preferences.TXMPreferences;
-import org.txm.rcp.preferences.TXMPreferencePage;
-import org.txm.rcp.preferences.TXMPreferenceStore;
-import org.txm.rcp.jface.DoubleFieldEditor;
-
-/**
- * Cooccurrence preference page.
- * 
- * @author mdecorde
- * @author sjacquot
- *
- */
-public class CoocPreferencePage extends TXMPreferencePage {
-	
-	
-	@Override
-	public void createFieldEditors() {
-		
-		/** The scoreformatfield. */
-		StringFieldEditor scoreformatfield = new StringFieldEditor(CooccurrencePreferences.SCORE_FORMAT, CooccurrenceUIMessages.scoreFormatDefault00000E00, getFieldEditorParent());
-		scoreformatfield.setTextLimit(15);
-		
-		/** The minfreqfield. */
-		IntegerFieldEditor minfreqfield = new IntegerFieldEditor(TXMPreferences.F_MIN, CooccurrenceUIMessages.minimumFrequencyThresholdOfTheCooccurrent, getFieldEditorParent());
-		minfreqfield.setValidRange(0, Integer.MAX_VALUE);
-		
-		/** The mincountfield. */
-		IntegerFieldEditor mincountfield = new IntegerFieldEditor(CooccurrencePreferences.MIN_COUNT, CooccurrenceUIMessages.minimumCooccurrencyCountThreshold, getFieldEditorParent());
-		mincountfield.setValidRange(0, Integer.MAX_VALUE);
-		
-		/** The minscorefield. */
-		DoubleFieldEditor minscorefield = new DoubleFieldEditor(CooccurrencePreferences.MIN_SCORE, CooccurrenceUIMessages.minimumCooccurrencyScoreThreshold, getFieldEditorParent());
-		minscorefield.setTextLimit(15);
-		
-		IntegerFieldEditor maxleftfield = new IntegerFieldEditor(CooccurrencePreferences.MAX_LEFT, CooccurrenceUIMessages.maximumLeft, getFieldEditorParent());
-		maxleftfield.setValidRange(0, 99999);
-		
-		IntegerFieldEditor minleftfield = new IntegerFieldEditor(CooccurrencePreferences.MIN_LEFT, CooccurrenceUIMessages.minimumLeft, getFieldEditorParent());
-		minleftfield.setValidRange(0, 99999);
-		
-		IntegerFieldEditor minrightfield = new IntegerFieldEditor(CooccurrencePreferences.MIN_RIGHT, CooccurrenceUIMessages.minimumRight, getFieldEditorParent());
-		minrightfield.setValidRange(0, 99999);
-		
-		IntegerFieldEditor maxrightfield = new IntegerFieldEditor(CooccurrencePreferences.MAX_RIGHT, CooccurrenceUIMessages.maximumRight, getFieldEditorParent());
-		maxrightfield.setValidRange(0, 99999);
-		
-		BooleanFieldEditor partiallexicaltablefield = new BooleanFieldEditor(CooccurrencePreferences.PARTIAL_LEXICAL_TABLE, CooccurrenceUIMessages.usePartialLexicalTable, getFieldEditorParent());
-		
-		addField(scoreformatfield);
-		addField(minfreqfield);
-		addField(mincountfield);
-		addField(minscorefield);
-		addField(maxleftfield);
-		addField(minleftfield);
-		addField(minrightfield);
-		addField(maxrightfield);
-		addField(partiallexicaltablefield);
-	}
-	
-	
-	
-	@Override
-	public void init(IWorkbench workbench) {
-		this.setPreferenceStore(new TXMPreferenceStore(CooccurrencePreferences.getInstance().getPreferencesNodeQualifier()));
-		// setDescription("Cooccurrences");
-		this.setTitle(CooccurrenceUIMessages.cooccurrences);
-		this.setImageDescriptor(CooccurrenceAdapterFactory.ICON);
-	}
-	
-	
-}
Index: TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/preferences/CooccurrencesPreferencePage.java
===================================================================
--- TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/preferences/CooccurrencesPreferencePage.java	(revision 0)
+++ TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/preferences/CooccurrencesPreferencePage.java	(revision 3387)
@@ -0,0 +1,110 @@
+// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.cooccurrence.rcp.preferences;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.ui.IWorkbench;
+import org.txm.cooccurrence.core.preferences.CooccurrencePreferences;
+import org.txm.cooccurrence.rcp.adapters.CooccurrenceAdapterFactory;
+import org.txm.cooccurrence.rcp.messages.CooccurrenceUIMessages;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.rcp.preferences.TXMPreferencePage;
+import org.txm.rcp.preferences.TXMPreferenceStore;
+import org.txm.rcp.jface.DoubleFieldEditor;
+
+/**
+ * Cooccurrence preference page.
+ * 
+ * @author mdecorde
+ * @author sjacquot
+ *
+ */
+public class CooccurrencesPreferencePage extends TXMPreferencePage {
+	
+	
+	@Override
+	public void createFieldEditors() {
+		
+		/** The scoreformatfield. */
+		StringFieldEditor scoreformatfield = new StringFieldEditor(CooccurrencePreferences.SCORE_FORMAT, CooccurrenceUIMessages.scoreFormatDefault00000E00, getFieldEditorParent());
+		scoreformatfield.setTextLimit(15);
+		
+		/** The minfreqfield. */
+		IntegerFieldEditor minfreqfield = new IntegerFieldEditor(TXMPreferences.F_MIN, CooccurrenceUIMessages.minimumFrequencyThresholdOfTheCooccurrent, getFieldEditorParent());
+		minfreqfield.setValidRange(0, Integer.MAX_VALUE);
+		
+		/** The mincountfield. */
+		IntegerFieldEditor mincountfield = new IntegerFieldEditor(CooccurrencePreferences.MIN_COUNT, CooccurrenceUIMessages.minimumCooccurrencyCountThreshold, getFieldEditorParent());
+		mincountfield.setValidRange(0, Integer.MAX_VALUE);
+		
+		/** The minscorefield. */
+		DoubleFieldEditor minscorefield = new DoubleFieldEditor(CooccurrencePreferences.MIN_SCORE, CooccurrenceUIMessages.minimumCooccurrencyScoreThreshold, getFieldEditorParent());
+		minscorefield.setTextLimit(15);
+		
+		IntegerFieldEditor maxleftfield = new IntegerFieldEditor(CooccurrencePreferences.MAX_LEFT, CooccurrenceUIMessages.maximumLeft, getFieldEditorParent());
+		maxleftfield.setValidRange(0, 99999);
+		
+		IntegerFieldEditor minleftfield = new IntegerFieldEditor(CooccurrencePreferences.MIN_LEFT, CooccurrenceUIMessages.minimumLeft, getFieldEditorParent());
+		minleftfield.setValidRange(0, 99999);
+		
+		IntegerFieldEditor minrightfield = new IntegerFieldEditor(CooccurrencePreferences.MIN_RIGHT, CooccurrenceUIMessages.minimumRight, getFieldEditorParent());
+		minrightfield.setValidRange(0, 99999);
+		
+		IntegerFieldEditor maxrightfield = new IntegerFieldEditor(CooccurrencePreferences.MAX_RIGHT, CooccurrenceUIMessages.maximumRight, getFieldEditorParent());
+		maxrightfield.setValidRange(0, 99999);
+		
+		StringFieldEditor milestonesfield = new StringFieldEditor(CooccurrencePreferences.MILESTONE_STRUCTURES_TO_IGNORE, "Milestone structures list (comma separated)", getFieldEditorParent());
+		
+		BooleanFieldEditor partiallexicaltablefield = new BooleanFieldEditor(CooccurrencePreferences.PARTIAL_LEXICAL_TABLE, CooccurrenceUIMessages.usePartialLexicalTable, getFieldEditorParent());
+		
+		addField(scoreformatfield);
+		addField(minfreqfield);
+		addField(mincountfield);
+		addField(minscorefield);
+		addField(maxleftfield);
+		addField(minleftfield);
+		addField(minrightfield);
+		addField(maxrightfield);
+		addField(milestonesfield);
+		addField(partiallexicaltablefield);
+	}
+	
+	
+	
+	@Override
+	public void init(IWorkbench workbench) {
+		this.setPreferenceStore(new TXMPreferenceStore(CooccurrencePreferences.getInstance().getPreferencesNodeQualifier()));
+		// setDescription("Cooccurrences");
+		this.setTitle(CooccurrenceUIMessages.cooccurrences);
+		this.setImageDescriptor(CooccurrenceAdapterFactory.ICON);
+	}
+	
+	
+}

Property changes on: TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/preferences/CooccurrencesPreferencePage.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/messages/CooccurrenceUIMessages.java
===================================================================
--- TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/messages/CooccurrenceUIMessages.java	(revision 3386)
+++ TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/messages/CooccurrenceUIMessages.java	(revision 3387)
@@ -37,6 +37,9 @@
 	public static String score_2; 
 	public static String cooccurrent; 
 	public static String meanDistance; 
+	
+	public static String wordWindow; 
+	public static String structureWindow; 
 
 	static {
 		// initialize resource bundle
Index: TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/messages/messages.properties
===================================================================
--- TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/messages/messages.properties	(revision 3386)
+++ TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/messages/messages.properties	(revision 3387)
@@ -21,3 +21,5 @@
 theScoreThresholdMustBeARealNumberCurrentValueEqualsP0=The score threshold must be a real number (the current value is {0})
 thresholdsColonFmin=Thresholds\: Fmin ≥
 usePartialLexicalTable=Calculate the margins from the frequencies of the co-occurrents instead of the frequencies of all the words of the corpus
+wordWindow=Word window
+structureWindow=Structure
\ No newline at end of file
Index: TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/messages/messages_fr.properties
===================================================================
--- TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/messages/messages_fr.properties	(revision 3386)
+++ TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/messages/messages_fr.properties	(revision 3387)
@@ -21,3 +21,5 @@
 theScoreThresholdMustBeARealNumberCurrentValueEqualsP0=Le seuil d''indice doit être un nombre réel (la valeur actuelle est {0})
 thresholdsColonFmin=Seuils \: Fmin ≥
 usePartialLexicalTable=Calculer les marges à partir des fréquences des cooccurents plutôt qu'à partir des fréquences de tous les mots du corpus
+wordWindow=Fenêtre de mots
+structureWindow=Structure
\ No newline at end of file
Index: TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/editors/EmpantWidget.java
===================================================================
--- TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/editors/EmpantWidget.java	(revision 3386)
+++ TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/editors/EmpantWidget.java	(revision 3387)
@@ -27,10 +27,17 @@
 //
 package org.txm.cooccurrence.rcp.editors;
 
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.KeyListener;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
@@ -38,6 +45,8 @@
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Spinner;
+import org.txm.cooccurrence.core.preferences.CooccurrencePreferences;
+import org.txm.cooccurrence.rcp.messages.CooccurrenceUIMessages;
 import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
@@ -112,13 +121,21 @@
 		l.setText(TXMUIMessages.contextColon);
 		
 		wordType = new Button(line1, SWT.RADIO);
-		wordType.setText(TXMUIMessages.word);
+		wordType.setText(CooccurrenceUIMessages.wordWindow);
 		wordType.addSelectionListener(new SelectionListener() {
 			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				structs.setEnabled(false);
+				checkLeft.setSelection(true);
+				checkRight.setSelection(true);
 				checkXword.setEnabled(false);
+				
+				checkXword.setSelection(false);
+				maxLeft.setSelection(CooccurrencePreferences.getInstance().getInt(CooccurrencePreferences.MAX_LEFT)-1);
+				minLeft.setSelection(CooccurrencePreferences.getInstance().getInt(CooccurrencePreferences.MIN_LEFT)-1);
+				minRight.setSelection(CooccurrencePreferences.getInstance().getInt(CooccurrencePreferences.MIN_RIGHT)-1);
+				maxRight.setSelection(CooccurrencePreferences.getInstance().getInt(CooccurrencePreferences.MAX_RIGHT)-1);
 			}
 			
 			@Override
@@ -127,13 +144,21 @@
 		wordType.setSelection(true);
 		
 		structType = new Button(line1, SWT.RADIO);
-		structType.setText(TXMUIMessages.structure);
+		structType.setText(CooccurrenceUIMessages.structureWindow);
 		structType.addSelectionListener(new SelectionListener() {
 			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				structs.setEnabled(true);
+				checkLeft.setSelection(false);
+				checkRight.setSelection(false);
 				checkXword.setEnabled(true);
+				
+				checkXword.setSelection(true);
+				maxLeft.setSelection(0);
+				minLeft.setSelection(0);
+				minRight.setSelection(0);
+				maxRight.setSelection(0);
 			}
 			
 			@Override
@@ -281,15 +306,23 @@
 	private void loadStructs() {
 		try {
 			java.util.List<StructuralUnit> corpusstructuralunits = corpus.getOrderedStructuralUnits();
+			HashSet<String> suToIgnore = new HashSet<>(Arrays.asList(CooccurrencePreferences.getInstance().getString(CooccurrencePreferences.MILESTONE_STRUCTURES_TO_IGNORE).split(",")));
 			for (StructuralUnit su : corpusstructuralunits) {
-				if (!su.getName().equals("text") //$NON-NLS-1$
-						&& !su.getName().equals("txmcorpus")) //$NON-NLS-1$
-				{
+				//if (!su.getName().equals("text") && !su.getName().equals("txmcorpus")) { //$NON-NLS-1$ $NON-NLS-2$
+				if (!suToIgnore.contains(su.getName())) { //$NON-NLS-1$ $NON-NLS-2$
 					structs.add(su.getName());
 				}
 			}
 			if (corpusstructuralunits.size() > 0) {
-				structs.select(0);
+				int pi = Arrays.binarySearch(structs.getItems(), "p");
+				int si = Arrays.binarySearch(structs.getItems(), "s");
+				if (pi > 0) {
+					structs.select(pi);
+				} else if (si > 0) {
+					structs.select(si);
+				} else {
+					structs.select(0);
+				}
 			}
 		}
 		catch (CqiClientException e) {
Index: TXM/trunk/org.txm.cooccurrence.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.cooccurrence.rcp/plugin.xml	(revision 3386)
+++ TXM/trunk/org.txm.cooccurrence.rcp/plugin.xml	(revision 3387)
@@ -20,7 +20,7 @@
          point="org.eclipse.ui.preferencePages">
       <page
             category="org.txm.rcp.preferences.UserPreferencePage"
-            class="org.txm.cooccurrence.rcp.preferences.CoocPreferencePage"
+            class="org.txm.cooccurrence.rcp.preferences.CooccurrencesPreferencePage"
             id="org.txm.cooccurrence.rcp.preferences.CoocPreferencePage"
             name="%page.name">
       </page>
