Révision 757

tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/Query.java (revision 757)
269 269

  
270 270
			query = normalizeWhiteChars(query);
271 271

  
272
			// empty query
273
			if(query.isEmpty())	{
274
				return query;
275
			}
272 276
			// query contains double quotes
273
			if (query.contains("\"")) { //$NON-NLS-1$
277
			else if (query.contains("\"")) { //$NON-NLS-1$
274 278
				return query;
275
			} else
279
			}
276 280
			// query contains brackets
277
			if (query.contains("[") && query.contains("]")) { //$NON-NLS-1$ //$NON-NLS-2$
281
			else if (query.contains("[") && query.contains("]")) { //$NON-NLS-1$ //$NON-NLS-2$
278 282
				return query; // probably [] or [...]
279
			} else {
283
			}
284
			else {
280 285
				return '"' + query + '"'; //$NON-NLS-1$
281 286
			}
282 287
		} else if (QueryFixStrategy == ElectricStrategy) {
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Part.java (revision 757)
27 27
//
28 28
package org.txm.searchengine.cqp.corpus;
29 29

  
30
import org.txm.core.results.TXMResult;
30 31
import org.txm.objects.Base;
31 32
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
32 33
import org.txm.searchengine.cqp.clientExceptions.InvalidCqpIdException;
......
39 40
 *
40 41
 * @author jmague
41 42
 */
42
public class Part extends Subcorpus implements Comparable<Part>{
43
public class Part extends Subcorpus {
43 44

  
44 45
	/** The partition. */
45 46
	private Partition partition;
......
166 167
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
167 168
	 */
168 169
	@Override
169
	public int compareTo(Part o) {
170
	public int compareTo(TXMResult o) {
170 171
		return this.getName().compareTo(o.getName());
171 172
	}
172 173

  
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Partition.java (revision 757)
45 45
import org.eclipse.osgi.util.NLS;
46 46
import org.txm.core.messages.TXMCoreMessages;
47 47
import org.txm.core.results.TXMParameters;
48
import org.txm.core.results.TXMResult;
48 49
import org.txm.objects.TxmObject;
49 50
import org.txm.searchengine.cqp.CQPEngine;
50 51
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
......
630 631
	}
631 632
	
632 633

  
634
	@Override
635
	public int compareTo(TXMResult o) {
636
		// Compare node weights
637
		int output = super.compareTo(o);
638
		// Compare simple names if weights are equal
639
		if(output == 0)	{
640
			output = this.getSimpleName().compareToIgnoreCase(o.getSimpleName());
641
		}
642
		return output;
643
	}
644

  
645
	
633 646
}
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Corpus.java (revision 757)
1406 1406
		return corpus;
1407 1407
	}
1408 1408
	
1409
	
1410
	@Override
1411
	public int compareTo(TXMResult o) {
1412
		// Compare node weights
1413
		int output = super.compareTo(o);
1414
		// Compare simple names if weights are equal
1415
		if(output == 0)	{
1416
			output = this.getSimpleName().compareToIgnoreCase(o.getSimpleName());
1417
		}
1418
		return output;
1419
	}
1420

  
1421
	
1409 1422
}
tmp/org.txm.information.rcp/build.properties (revision 757)
2 2
output.. = bin/
3 3
bin.includes = META-INF/,\
4 4
               .,\
5
               plugin.xml
5
               plugin.xml,\
6
               icons/,\
7
               OSGI-INF/
tmp/org.txm.chartsengine.jfreechart.rcp/META-INF/MANIFEST.MF (revision 757)
16 16
 org.txm.rcp;bundle-version="0.7.8"
17 17
Export-Package: org.txm.chartsengine.jfreechart.rcp,
18 18
 org.txm.chartsengine.jfreechart.rcp.events,
19
 org.txm.chartsengine.jfreechart.rcp.handlers,
19 20
 org.txm.chartsengine.jfreechart.rcp.preferences,
20 21
 org.txm.chartsengine.jfreechart.rcp.swt,
21 22
 org.txm.chartsengine.jfreechart.rcp.themes.base.swing,
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 757)
199 199
			
200 200
			// remove empty toolbar
201 201
			//TODO SJ: Hack? MD: yeah -> need to find a way to not display the bottom toolbar on Windows instead
202
//			if (this.bottomToolBar.getItems().length == 0) {
203
//				this.bottomToolBar.dispose();
204
//			}
202
			if (this.bottomToolBar.getItems().length == 0) {
203
				this.bottomToolBar.dispose();
204
			}
205 205
		}
206 206
		catch(Exception e) {
207 207
			System.err.println("TXMEditor.createPartControl(): can not create the editor.");
......
658 658
					((NewNavigationWidget)object).setCurrentPosition((Integer) value); 
659 659
				}
660 660
				else if(object instanceof AssistedQueryWidget)	{
661
					((AssistedQueryWidget)object).setText(((Query)value).getQueryString()); 
661
					if(!((Query)value).getQueryString().isEmpty())	{
662
						((AssistedQueryWidget)object).setText(((Query)value).getQueryString());
663
					}
662 664
				}
663 665
				else if(object instanceof QueryWidget)	{
664
					((QueryWidget)object).setText(((Query)value).getQueryString()); 
666
					if(!((Query)value).getQueryString().isEmpty())	{
667
						((QueryWidget)object).setText(((Query)value).getQueryString());
668
					}
665 669
				}
666 670
				else	{
667 671
					f.set(this, value);
tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/AssistedQueryWidget.java (revision 757)
142 142
	}
143 143

  
144 144
	public Query getQuery() {
145
		return new Query(getQueryString());
145
		return this.querywidget.getQuery();
146 146
	}
147 147
}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/QueryWidget.java (revision 757)
117 117
	 * @return the query
118 118
	 */
119 119
	public Query getQuery() {
120
		
121
		return new Query(this.getQueryString());
120
		if(!this.getQueryString().isEmpty())	{
121
			return new Query(this.getQueryString());	
122
		}
123
		else	{
124
			return null;
125
		}
122 126
	};
123 127
}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/Application.java (revision 757)
95 95
			Log.setPrintInConsole(true);
96 96
			Log.setLevel(Level.ALL);
97 97
			Log.severe(TXMUIMessages.Application_2);
98
			TXMPreferences.put(TBXPreferences.PREFERENCES_NODE, TBXPreferences.ADD_TECH_LOGS, true);
99
			TXMPreferences.put(TBXPreferences.PREFERENCES_NODE, TBXPreferences.LOG_LEVEL, "ALL"); //$NON-NLS-1$
100
			TXMPreferences.put(TBXPreferences.PREFERENCES_NODE, TBXPreferences.LOG_STACKTRACE, true);
98
			Toolbox.setPreference(TBXPreferences.ADD_TECH_LOGS, true);
99
			Toolbox.setPreference(TBXPreferences.LOG_LEVEL, "ALL"); //$NON-NLS-1$
100
			Toolbox.setPreference(TBXPreferences.LOG_STACKTRACE, true);
101 101
		}
102 102
		if (argsList.contains("-run")) { //$NON-NLS-1$
103 103
			//System.out.println("Running TXM");
......
108 108
				System.out.println("Stand alone launch, creating minimal TXM user home directory in "+userhomeDirectory.getAbsolutePath());
109 109
				System.out.println("Sample corpora, scripts, import scripts and macros files are not yet installed.");
110 110
				
111
				TXMPreferences.put(TBXPreferences.PREFERENCES_NODE, TBXPreferences.USER_TXM_HOME, userhomeDirectory.getAbsolutePath());
112
				TXMPreferences.put(TBXPreferences.PREFERENCES_NODE, TBXPreferences.INSTALL_DIR, userhomeDirectory.getParentFile().getAbsolutePath());
111
				Toolbox.setPreference(TBXPreferences.USER_TXM_HOME, userhomeDirectory.getAbsolutePath());
112
				Toolbox.setPreference(TBXPreferences.INSTALL_DIR, userhomeDirectory.getParentFile().getAbsolutePath());
113 113
				
114 114
				File corpusworkspaceDirectory = new File(userhomeDirectory, "workspaces");
115 115
				corpusworkspaceDirectory.mkdirs();
......
294 294
		try {
295 295
			preferences.save();
296 296
		} catch (IOException e) {
297
			System.err.println(NLS.bind(
298
					TXMUIMessages.FAILED_TO_SAVE_PREFERENCES, e));
297
			System.err.println(NLS.bind(TXMUIMessages.FAILED_TO_SAVE_PREFERENCES, e));
299 298
			exit = true;
300 299
			return exit;
301 300
		}
tmp/org.txm.information.core/src/org/txm/information/core/functions/Information.java (revision 757)
601 601

  
602 602
	@Override
603 603
	public String getSimpleName() {
604
		return "Informations";
604
		return "Propriétés";
605 605
	}
606 606

  
607 607
	@Override
tmp/org.txm.tigersearch.rcp/src/org/txm/importer/tigersearch/TSImporter.groovy (revision 757)
34 34
				return;
35 35
			}
36 36
			this.metadata = new Metadatas(copy,
37
					Toolbox.getParam(Toolbox.METADATA_ENCODING),
38
					Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR),
39
					Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
37
					Toolbox.getPreference(Toolbox.METADATA_ENCODING),
38
					Toolbox.getPreference(Toolbox.METADATA_COLSEPARATOR),
39
					Toolbox.getPreference(Toolbox.METADATA_TXTSEPARATOR), 1)
40 40
		}
41 41
		isSuccessFul = true;
42 42
	}
tmp/org.txm.core/src/java/org/txm/core/preferences/TBXPreferences.java (revision 757)
83 83
//		
84 84
		preferences.putBoolean(TBXPreferences.EXPERT_USER, false); //$NON-NLS-1$
85 85
		
86
		preferences.put(TBXPreferences.LOG_LEVEL, "OFF"); //$NON-NLS-1$
86
		// FIXME
87 87
		preferences.putBoolean(TBXPreferences.ADD_TECH_LOGS, false); //$NON-NLS-1$
88 88
		preferences.putBoolean(TBXPreferences.LOG_STACKTRACE, true); //$NON-NLS-1$
89 89
		preferences.putBoolean(TBXPreferences.LOG_IN_FILE, false); //$NON-NLS-1$
......
92 92
		preferences.put(TBXPreferences.METADATA_ENCODING, "UTF-8"); //$NON-NLS-1$
93 93
		preferences.put(TBXPreferences.METADATA_TXTSEPARATOR, "\""); //$NON-NLS-1$
94 94
		
95
		preferences.put(EXPORT_COLSEPARATOR, "\t");
96
		preferences.put(EXPORT_ENCODING, System.getProperty("file.encoding"));
97
		preferences.put(EXPORT_TXTSEPARATOR, "");
95
		preferences.put(EXPORT_COLSEPARATOR, "\t"); //$NON-NLS-1$
96
		preferences.put(EXPORT_ENCODING, System.getProperty("file.encoding")); //$NON-NLS-1$
97
		preferences.put(EXPORT_TXTSEPARATOR, ""); //$NON-NLS-1$
98 98
		preferences.putBoolean(EXPORT_SHOW, false);
99 99
		
100 100
		preferences.putBoolean(SHOW_ALL_RESULT_NODES, false);
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 757)
58 58
 * @author mdecorde
59 59
 * @author sjacquot
60 60
 */
61
public abstract class TXMResult implements Cloneable, IProgressMonitor {
61
public abstract class TXMResult implements Cloneable, IProgressMonitor, Comparable<TXMResult> {
62 62

  
63 63

  
64 64
	public static final DateFormat ID_TIME_FORMAT = new SimpleDateFormat("YYYYMMdd");
......
1309 1309
	 * @return the String "*"
1310 1310
	 */
1311 1311
	public String getEmptyName()	{
1312
		return "*"; 
1312
		return "..."; //$NON-NLS-1$
1313 1313
	}
1314 1314

  
1315 1315
	/**
......
1720 1720
		return userName;
1721 1721
	}
1722 1722

  
1723
	@Override
1724
	public int compareTo(TXMResult o) {
1725
		// Compare node weights
1726
		return Integer.compare(this.weight, o.weight);
1727
	}
1728

  
1729
	
1723 1730
}
tmp/org.txm.core/src/java/org/txm/Toolbox.java (revision 757)
85 85
	}
86 86

  
87 87
	/**
88
	 * if searchengine or statengine or workspace is not ready then the toolbox
89
	 * is not ready.
88
	 * If searchengine or statengine or workspace is not ready then the toolbox is not ready.
90 89
	 *
91 90
	 * @return true, if successful
92 91
	 */
......
119 118
	}
120 119

  
121 120
	/**
122
	 * Shortcut to the TBXPreferences getString method
121
	 * Gets a preference from the Toolbox Preferences node.
123 122
	 * 
124 123
	 * @param key
125 124
	 * @return
126 125
	 */
127
	public static String getParam(String key) {
126
	public static String getPreference(String key) {
128 127
		return TXMPreferences.getString(key, TBXPreferences.PREFERENCES_NODE);
129 128
	}
130 129

  
130
	/**
131
	 * Sets a preference of the Toolbox Preferences node.
132
	 * @param key
133
	 * @param value
134
	 */
135
	public static void setPreference(String key, Object value) {
136
		TXMPreferences.put(TBXPreferences.PREFERENCES_NODE, key, value);
137
	}
138

  
139
	
131 140
	public static EnginesManager<?> getEngineManager(EngineType et) {
132 141

  
133 142
		if (engines == null) {
tmp/org.txm.chartsengine.rcp/META-INF/MANIFEST.MF (revision 757)
22 22
 org.txm.chartsengine.rcp.preferences,
23 23
 org.txm.chartsengine.rcp.swt
24 24
Bundle-Vendor: Textometrie.org
25
Bundle-ActivationPolicy: lazy
tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditor.java (revision 757)
14 14
import org.eclipse.swt.widgets.Composite;
15 15
import org.eclipse.swt.widgets.Group;
16 16
import org.eclipse.ui.IPartListener;
17
import org.eclipse.ui.IWorkbenchPage;
18 17
import org.eclipse.ui.IWorkbenchPart;
19
import org.eclipse.ui.IWorkbenchWindow;
20
import org.eclipse.ui.PartInitException;
21 18
import org.eclipse.ui.PlatformUI;
22 19
import org.eclipse.ui.part.EditorPart;
23 20
import org.eclipse.ui.part.MultiPageEditorPart;
......
30 27
import org.txm.chartsengine.rcp.swt.AdvancedChartEditorToolBar;
31 28
import org.txm.chartsengine.rcp.swt.ChartComposite;
32 29
import org.txm.chartsengine.rcp.swt.ChartEditorToolBar;
33
import org.txm.core.results.TXMResult;
34
import org.txm.rcp.TXMWindows;
35 30
import org.txm.rcp.editors.TXMEditor;
36
import org.txm.rcp.editors.TXMResultEditorInput;
37 31
import org.txm.utils.logger.Log;
38 32

  
39 33
/**
tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java (revision 757)
817 817
		if (pQuery != null) {
818 818
			return pQuery.toString();
819 819
		}
820
		return this.getName();
820
		else	{
821
			return this.getEmptyName();
822
		}
821 823
	}
822 824

  
823 825
	/**
tmp/org.txm.referencer.core/src/org/txm/referencer/core/functions/Referencer.java (revision 757)
295 295
					refValues.put(property, cqiClient.getData(property,
296 296
							l.positions, Collections.nCopies(l.positions.size(), 1)));
297 297
				}
298

  
299
				for (int j = 0 ; j < l.positions.size() ; j++)// build the Reference object
300
				{
298
				// build the Reference object
299
				for (int j = 0 ; j < l.positions.size() ; j++) {
301 300
					String propvalue = ""; //$NON-NLS-1$
302 301
					for (Property property : pPattern) {
303
						propvalue += refValues.get(property).get(j).get(0)+", "; //$NON-NLS-1$
302
						propvalue += refValues.get(property).get(j).get(0) + ", "; //$NON-NLS-1$
304 303
					}
305 304

  
306 305
					l.addReference(propvalue.substring(0, propvalue.length()-2));
307 306
				}
308
				if (pHierarchicSort)
309
					l.sortRef(true);
310
				else
311
					l.sortAlpha();
307
				if (pHierarchicSort) {
308
					l.sortRef(true);
309
				}
310
				else {
311
					l.sortAlpha();
312
				}
312 313
				l.notcomputed = false;
313 314
			}
314 315
		}
......
333 334
	 *
334 335
	 * @return the name
335 336
	 */
336
	public String getName() {
337
		return getCorpus().getName() + ": " + pQuery; //$NON-NLS-1$
337
	public String getName() {
338
		if(pQuery != null)	{
339
			return getCorpus().getName() + ": " + pQuery; //$NON-NLS-1$
340
		}
341
		else {
342
			return this.getEmptyName();
343
		}
338 344
	}
339 345

  
340 346
	/**
......
413 419

  
414 420
	@Override
415 421
	public String getSimpleName() {
416
		if (pQuery != null) {
422
		try {
417 423
			return pQuery.toString();
418 424
		}
419
		else {
420
			return getName();
425
		catch (Exception e) {
426
			return this.getEmptyName();
421 427
		}
422 428
	}
423 429

  
......
544 550
	public boolean canCompute() {
545 551

  
546 552
		if (pQuery == null || pQuery.isEmpty()) {
547
			System.out.println("Empty query");
553
			System.out.println("No query set.");
548 554
			return false;
549 555
		}
550 556
		if (pPattern == null || pPattern.size() == 0) {
551
			System.out.println("No reference pattern");
557
			System.out.println("No reference pattern set.");
552 558
			return false;
553 559
		}
554 560
		if (pProperty == null) {
555
			System.out.println("No property");
561
			System.out.println("No property set.");
556 562
			return false;
557 563
		}
558 564
		
......
561 567

  
562 568
	@Override
563 569
	public boolean loadParameters() throws CqiClientException {
564
		this.pQuery = new Query(this.getStringParameterValue(ReferencerPreferences.QUERY));
570
		if(!this.getStringParameterValue(ReferencerPreferences.QUERY).isEmpty()) {
571
			this.pQuery = new Query(this.getStringParameterValue(ReferencerPreferences.QUERY));
572
		}
565 573
		this.pPattern = StructuralUnitProperty.stringToProperties(this.getCorpus(), this.getStringParameterValue(ReferencerPreferences.PATTERN));
566 574
		this.pProperty = this.getCorpus().getProperty(this.getStringParameterValue(ReferencerPreferences.UNIT_PROPERTY));
567 575
		return true;
tmp/org.txm.groovy.core/src/groovy/org/txm/test/CQPBenchmark.groovy (revision 757)
97 97
	long time;
98 98
	// START START START START
99 99
	if (firstExecution == 0)
100
		csv << ["object", "size", "nPart", "command", "query", "query freq", "$CORPUSNAME $QUERY1 $QUERY2 mode "+Toolbox.getParam(Toolbox.CQI_NETWORK_MODE)]
100
		csv << ["object", "size", "nPart", "command", "query", "query freq", "$CORPUSNAME $QUERY1 $QUERY2 mode "+Toolbox.getPreference(Toolbox.CQI_NETWORK_MODE)]
101 101
	else
102
		csv[i++] << "$CORPUSNAME $QUERY1 $QUERY2 mode "+Toolbox.getParam(Toolbox.CQI_NETWORK_MODE)
102
		csv[i++] << "$CORPUSNAME $QUERY1 $QUERY2 mode "+Toolbox.getPreference(Toolbox.CQI_NETWORK_MODE)
103 103
	
104 104
	// INFORMATIONS
105 105
	print " INFO"
tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bvh/annotate.groovy (revision 757)
90 90
		files = new File(rootDir,"ptreetagger").listFiles()	
91 91
		for(File f : files)
92 92
		{
93
			File modelfile = new File(Toolbox.getParam(Toolbox.TREETAGGER_MODELS_PATH),"/afr.par");
93
			File modelfile = new File(Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH),"/afr.par");
94 94
			File infile = f
95 95
			File outfile = new File(rootDir+"/treetagger",f.getName());
96 96
			println("3- APPLY TT on : "+infile+" with : "+modelfile +" >>  "+outfile);
97 97
			
98
			TreeTagger tt = new TreeTagger(Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/");
98
			TreeTagger tt = new TreeTagger(Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/");
99 99
			tt.settoken();
100 100
			tt.setlemma();
101 101
			tt.setquiet();
tmp/org.txm.groovy.core/src/groovy/org/txm/importer/corptef/annotate.groovy (revision 757)
59 59
		for(File teifile : listfiles)
60 60
		{
61 61
			println("annotate "+teifile)
62
			File modelfile = new File(Toolbox.getParam(Toolbox.TREETAGGER_MODELS_PATH),"/rgaqcj.par");
62
			File modelfile = new File(Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH),"/rgaqcj.par");
63 63
			if(!modelfile.exists())
64 64
			{
65 65
				println "Skipping ANNOTATE: Incorrect modelfile path: "+modelfile;
......
74 74
			builder.process(ttsrcfile);
75 75
			
76 76
			//Apply TT
77
			if(!new File(Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/").exists() || Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH).length() == 0 )
77
			if(!new File(Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/").exists() || Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH).length() == 0 )
78 78
			{
79
				println("Path to TreeTagger is wrong: "+Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/")
79
				println("Path to TreeTagger is wrong: "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/")
80 80
				return;
81 81
			}
82
			TreeTagger tt = new TreeTagger(Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/");
82
			TreeTagger tt = new TreeTagger(Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/");
83 83
			tt.settoken();
84 84
			tt.setlemma();
85 85
			tt.setquiet();
tmp/org.txm.groovy.core/src/groovy/org/txm/importer/transcriber/transcriberLoader.groovy (revision 757)
122 122
		println "Error: could not create a copy of metadata file "+allmetadatasfile.getAbsoluteFile();
123 123
		return;
124 124
	}
125
	metadatas = new Metadatas(copy, Toolbox.getParam(Toolbox.METADATA_ENCODING), Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR), Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
125
	metadatas = new Metadatas(copy, Toolbox.getPreference(Toolbox.METADATA_ENCODING), Toolbox.getPreference(Toolbox.METADATA_COLSEPARATOR), Toolbox.getPreference(Toolbox.METADATA_TXTSEPARATOR), 1)
126 126
}
127 127
else
128 128
	println "no metadata file: "+allmetadatasfile
tmp/org.txm.groovy.core/src/groovy/org/txm/importer/perrault/annotate.groovy (revision 757)
75 75
		files = new File(rootDir,"treetagger").listFiles()	
76 76
		for(File f : files)
77 77
		{
78
			File modelfile = new File(Toolbox.getParam(Toolbox.TREETAGGER_MODELS_PATH),"/fr.par");
78
			File modelfile = new File(Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH),"/fr.par");
79 79
			if(!modelfile.exists())
80 80
			{
81 81
				println "Skipping ANNOTATE: Incorrect modelfile path: "+modelfile;
......
85 85
			File outfile = new File(f.getParent(),f.getName()+"-out.tt");
86 86
			println("3- APPLY TT on : "+infile+" with : "+modelfile +" >>  "+outfile);
87 87
			
88
			if(!new File(Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/").exists())
88
			if(!new File(Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/").exists())
89 89
			{
90
				println("Path to TreeTagger is wrong "+Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/")
90
				println("Path to TreeTagger is wrong "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/")
91 91
				return;
92 92
			}
93
			TreeTagger tt = new TreeTagger(Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/");
93
			TreeTagger tt = new TreeTagger(Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/");
94 94
			tt.settoken();
95 95
			tt.setlemma();
96 96
			tt.setquiet();
tmp/org.txm.groovy.core/src/groovy/org/txm/importer/txt/txtLoader.groovy (revision 757)
97 97
		println "Error: could not create a copy of metadata file "+allmetadatasfile.getAbsoluteFile();
98 98
		return;
99 99
	}
100
	metadatas = new Metadatas(copy, Toolbox.getParam(Toolbox.METADATA_ENCODING), Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR), Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
100
	metadatas = new Metadatas(copy, Toolbox.getPreference(Toolbox.METADATA_ENCODING), Toolbox.getPreference(Toolbox.METADATA_COLSEPARATOR), Toolbox.getPreference(Toolbox.METADATA_TXTSEPARATOR), 1)
101 101
} else {
102 102
	println "No metadata file: "+allmetadatasfile
103 103
}
tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/XTZImporter.groovy (revision 757)
109 109
				return;
110 110
			}
111 111
			metadata = new Metadatas(copy,
112
			Toolbox.getParam(Toolbox.METADATA_ENCODING),
113
			Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR),
114
			Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
112
			Toolbox.getPreference(Toolbox.METADATA_ENCODING),
113
			Toolbox.getPreference(Toolbox.METADATA_COLSEPARATOR),
114
			Toolbox.getPreference(Toolbox.METADATA_TXTSEPARATOR), 1)
115 115
		}
116 116

  
117 117
		String cleanDirectories = module.getParameters().getKeyValueParameters().get(ImportKeys.CLEAN);
tmp/org.txm.groovy.core/src/groovy/org/txm/importer/discours/importer.groovy (revision 757)
95 95
				println "Error: could not create a copy of metadata file "+csvfile.getAbsoluteFile();
96 96
				return;
97 97
			}
98
			metadatas = new Metadatas(copy, Toolbox.getParam(Toolbox.METADATA_ENCODING), Toolbox.getParam(Toolbox.METADATA_COLSEPARATOR), Toolbox.getParam(Toolbox.METADATA_TXTSEPARATOR), 1)
98
			metadatas = new Metadatas(copy, Toolbox.getPreference(Toolbox.METADATA_ENCODING), Toolbox.getPreference(Toolbox.METADATA_COLSEPARATOR), Toolbox.getPreference(Toolbox.METADATA_TXTSEPARATOR), 1)
99 99
		} else {
100 100
			println "No metadata file: "+csvfile
101 101
			println "Aborting"
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/teitxm/AnnotateWTC.groovy (revision 757)
73 73
			File outfile = ttoutfile;
74 74

  
75 75
			// TODO: why org.txm.utils.treetagger.TreeTagger tt = ..., throw IllegalAccessError ???
76
			String opt = Toolbox.getParam(Toolbox.TREETAGGER_OPTIONS);
76
			String opt = Toolbox.getPreference(Toolbox.TREETAGGER_OPTIONS);
77 77
			if (opt == null) opt = "";
78 78
			String[] options = opt.split("  ");
79
			def tt = new TreeTagger(Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/", options);
79
			def tt = new TreeTagger(Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/", options);
80 80
			tt.settoken();
81 81
			tt.setlemma();
82 82
			tt.setquiet();
......
107 107
		if(debug) {
108 108
			println "rootDirFile "+binDir
109 109
			println "txmDir "+txmDir
110
			println "TREETAGGER INSTALL PATH : "+Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)
111
			println "TREETAGGER MODELS PATH : "+Toolbox.getParam(Toolbox.TREETAGGER_MODELS_PATH)
110
			println "TREETAGGER INSTALL PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)
111
			println "TREETAGGER MODELS PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH)
112 112
		}
113 113

  
114 114
		//test if the Toolbox know TreeTagger
115
		if (!new File(Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/").exists())
115
		if (!new File(Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/").exists())
116 116
		{
117
			println("Could not find TreeTagger binaries in "+Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/")
117
			println("Could not find TreeTagger binaries in "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/")
118 118
			return false;
119 119
		}
120 120

  
......
127 127
		List<File> files = txmDir.listFiles()
128 128

  
129 129
		// get model file and check it
130
		File modelfile = new File(Toolbox.getParam(Toolbox.TREETAGGER_MODELS_PATH), modelfilename);
130
		File modelfile = new File(Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH), modelfilename);
131 131
		if (debug)
132 132
			println "model file : "+modelfile;
133 133

  
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/teitxm/Annotate.groovy (revision 757)
108 108
	File modelsDirectory;
109 109
	
110 110
	public Annotate() {
111
		modelsDirectory = new File(Toolbox.getParam(Toolbox.TREETAGGER_MODELS_PATH)); // default models directory is set in the Toolbox
111
		modelsDirectory = new File(Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH)); // default models directory is set in the Toolbox
112 112
	}
113 113
		
114 114
	/**
......
267 267
		if (debug) {
268 268
			println "rootDirFile "+binDir
269 269
			println "txmDir "+txmDir
270
			println "TREETAGGER INSTALL PATH : "+Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)
271
			println "TREETAGGER MODELS PATH : "+Toolbox.getParam(Toolbox.TREETAGGER_MODELS_PATH)
270
			println "TREETAGGER INSTALL PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)
271
			println "TREETAGGER MODELS PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH)
272 272
		}
273 273

  
274 274
		//test if the Toolbox know TreeTagger
275
		if (!new File(Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/").exists()) {
276
			println("Could not find TreeTagger binaries in "+Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/")
275
		if (!new File(Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/").exists()) {
276
			println("Could not find TreeTagger binaries in "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/")
277 277
			return false;
278 278
		}
279 279
		String langAll = null
......
310 310

  
311 311
		if (cancelNow) return;
312 312

  
313
		File modelDirectory = new File(Toolbox.getParam(Toolbox.TREETAGGER_MODELS_PATH));
313
		File modelDirectory = new File(Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH));
314 314
		if (!modelDirectory.exists()) {
315 315
			println "Skipping ANNOTATE: TreeTagger language model file directory not found: "+modelDirectory.getAbsolutePath();
316 316
			return false;
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/teitxm/BuildTTSrc.groovy (revision 757)
170 170
			}
171 171

  
172 172
			String str = buffer.toString()
173
			if ("false".equals(Toolbox.getParam(Toolbox.TREETAGGER_APOSTROPHE))) {
173
			if ("false".equals(Toolbox.getPreference(Toolbox.TREETAGGER_APOSTROPHE))) {
174 174
				str = str.replace("’", "'").replace("‘", "'");
175 175
			}
176 176
			output.write(str)
tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java (revision 757)
798 798
			return lexicon.getSimpleName();
799 799
		}
800 800
		else {
801
			try {
802
				
803
				String name = ""; //$NON-NLS-1$
804
				
805
				if (pQuery != null && !pQuery.isEmpty())	{
806
					name += pQuery.getQueryString();
807
				}
808
				else	{
809
					name += this.getEmptyName();
810
				}
801
			String name = ""; //$NON-NLS-1$
802
			if (pQuery != null && !pQuery.isEmpty()) {
803
				name += pQuery.getQueryString();
811 804
				name += ": "; //$NON-NLS-1$
812
				
813
				for (Property s : pProperties)	{
805

  
806
				for (Property s : pProperties) {
814 807
					name += s.getName() + pPropertiesSeparator;
815 808
				}
816
				if (pProperties.size() > 0)	{
809
				if (pProperties.size() > 0) {
817 810
					name = name.substring(0, name.length() - 1);
818 811
				}
819 812
				return name;
820
			} catch(Exception e) {
821

  
822 813
			}
823
			return this.parent.getSimpleName();
814
			else {
815
				return this.getEmptyName();
816
			}
824 817
		}
825 818
	}
826 819

  
tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/adapters/CorpusAdapterFactory.java (revision 757)
2 2
package org.txm.searchengine.cqp.rcp.adapters;
3 3

  
4 4
import java.util.ArrayList;
5
import java.util.Collection;
6
import java.util.Collections;
5 7

  
6 8
import org.eclipse.jface.resource.ImageDescriptor;
7 9
import org.eclipse.ui.model.IWorkbenchAdapter;
......
16 18
import org.txm.rcp.adapters.TXMResultAdapterFactory;
17 19
import org.txm.searchengine.cqp.corpus.Corpus;
18 20
import org.txm.searchengine.cqp.corpus.CorpusManager;
21
import org.txm.searchengine.cqp.corpus.Partition;
19 22
import org.txm.searchengine.cqp.corpus.Subcorpus;
20 23

  
21 24

  
......
35 38
			return new TXMResultAdapter() {
36 39
				@Override
37 40
				public Object[] getChildren(Object corpus) {
38
					ArrayList<TXMResult> children = ((Corpus) corpus).getChildren(!TBXPreferences.getBoolean(TBXPreferences.SHOW_ALL_RESULT_NODES, TBXPreferences.PREFERENCES_NODE));
41
					ArrayList<TXMResult> allChildren = ((Corpus) corpus).getChildren(!TBXPreferences.getBoolean(TBXPreferences.SHOW_ALL_RESULT_NODES, TBXPreferences.PREFERENCES_NODE));
39 42

  
43
					ArrayList partitions = new ArrayList();
44
					ArrayList subcorporas = new ArrayList();
45
					ArrayList otherChildren = new ArrayList();
46
					ArrayList children = new ArrayList();
47
					
40 48
					// FIXME: remove Text and SavedQuery from the corpora view
41
					for (int i = 0; i < children.size(); i++) {
42
						Object element = children.get(i);
49
					// + sort and group the partitions and subcorpus 
50
					for (int i = 0; i < allChildren.size(); i++) {
51
						Object element = allChildren.get(i);
43 52
						if (
44 53
								//!TBXPreferences.getBoolean(TBXPreferences.SHOW_ALL_RESULT_NODES, TBXPreferences.PREFERENCES_NODE) && 
45
								(element instanceof Text || element instanceof SavedQuery)) {
46
							children.remove(i);
47
							i--;
54
								!(element instanceof Text)
55
								&& !(element instanceof SavedQuery)
56
								&& !(element instanceof Corpus)
57
								&& !(element instanceof Partition)
58
								) {
59
							otherChildren.add(element);
48 60
						}
61
						else if(element instanceof Partition)	{
62
							partitions.add(element);
63
						}
64
						else if(element instanceof Corpus)	{
65
							subcorporas.add(element);
66
						}
49 67
					}
50 68
					
69
					Collections.sort(partitions);
70
					Collections.sort(subcorporas);
71
					
72
					children.addAll(partitions);
73
					children.addAll(subcorporas);
74
					children.addAll(otherChildren);
75
					
51 76
					return children.toArray();
52 77
				}
53 78

  
tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java (revision 757)
625 625

  
626 626
	@Override
627 627
	public String getSimpleName() {
628
		StringBuffer output = new StringBuffer();
629

  
630 628
		if (pQuery != null && !pQuery.isEmpty())	{
629
			StringBuffer output = new StringBuffer();
631 630
			output.append(pQuery.getQueryString());
631
			if (pMaxLeftContextSize > 0 && pMaxRightContextSize > 0)	{
632
				output.append(" (" + (pMaxLeftContextSize - 1) + ", " + (pMaxRightContextSize - 1) + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 
633
			}
634
			return output.toString();
632 635
		}
633 636
		else	{
634
			output.append(this.getEmptyName());
637
			return this.getEmptyName();
635 638
		}
636

  
637
		if (pMaxLeftContextSize > 0 && pMaxRightContextSize > 0)	{
638
			output.append(" (" + (pMaxLeftContextSize - 1) + ", " + (pMaxRightContextSize - 1) + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 
639
		}
640

  
641
		// if the result was not computed
642
		if (output.length() == 0) {
643
			output.append(this.getParent().getName());
644
		}
645

  
646
		return output.toString();
647 639
	}
648 640

  
649 641
	/**
......
1560 1552
			return occ+CooccurrenceCoreMessages.Cooccurrence_4+freq+CooccurrenceCoreMessages.Cooccurrence_7+nbocc+CooccurrenceCoreMessages.Cooccurrence_8+score+CooccurrenceCoreMessages.Cooccurrence_9+distmoyenne+CooccurrenceCoreMessages.Cooccurrence_10+props;
1561 1553
		}
1562 1554
	}
1555

  
1563 1556
	
1564
	
1565 1557
}

Formats disponibles : Unified diff