Révision 908

tmp/org.txm.groovy.core/src/groovy/org/txm/setup/SetSVNQualifier.groovy (revision 908)
1 1
import java.util.jar.Manifest
2 2

  
3
import org.txm.setup.SVNStats
4

  
3 5
File workspace = new File(System.getProperty("user.home"), "workspace047")
4 6

  
5 7
for (File dir : workspace.listFiles()) {
tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java (revision 908)
47 47
import org.eclipse.swt.widgets.Spinner;
48 48
import org.eclipse.swt.widgets.TableColumn;
49 49
import org.txm.core.messages.TXMCoreMessages;
50
import org.txm.core.preferences.TBXPreferences;
50 51
import org.txm.core.results.Parameter;
51 52
import org.txm.index.core.functions.Index;
52 53
import org.txm.index.core.functions.Line;
......
146 147
	/**
147 148
	 * Word properties selector.
148 149
	 */
149
	@Parameter(key=IndexPreferences.PROPERTIES)
150
	@Parameter(key=TBXPreferences.UNIT_PROPERTIES)
150 151
	protected PropertiesSelector<WordProperty> propertiesSelector;
151 152
	
152

  
153 153
	/**
154 154
	 * Creates the part control.
155 155
	 *
tmp/org.txm.rcp/META-INF/MANIFEST.MF (revision 908)
31 31
 org.txm.libs.args4j;bundle-version="1.0.0";visibility:=reexport,
32 32
 org.txm.tokenizer.core;bundle-version="1.0.0";visibility:=reexport,
33 33
 org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport,
34
 org.txm.statsengine.core
34
 org.txm.statsengine.core,
35
 org.eclipse.ui.themes;bundle-version="1.2.1"
35 36
Export-Package: junit.extensions,
36 37
 junit.framework,
37 38
 junit.runner,
tmp/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java (revision 908)
76 76

  
77 77
	public static final String DENSITY_CHART_TYPE = "density"; //$NON-NLS-1$
78 78
	
79
	
80
	/**
81
	 * The corpus.
82
	 */
83
	protected Corpus corpus;
84

  
85

  
86 79
	/** The Xmin corpus. */
87 80
	protected int XminCorpus;
88 81

  
......
161 154
	
162 155
	public Progression(String uuid, Corpus parent)	{
163 156
		super(uuid, parent);
164
		this.corpus = (Corpus) this.parent;
165 157
	}
166 158
	
167 159
	@Override
......
214 206
	@Override
215 207
	public boolean canCompute() {
216 208

  
217
		// null Corpus
218
		if(this.corpus == null)	{
219
			Log.severe("Progression.canCompute(): can not compute with no corpus."); //$NON-NLS-1$
220
			return false;
221
		}
222

  
223 209
		// null or empty queries
224 210
		if (this.queries == null || this.queries.size() == 0)	{
225 211
			Log.severe("Progression.canCompute(): can not compute with no query."); //$NON-NLS-1$
......
378 364
	public boolean stepQueries(List<QueryResult> queryResults) throws CqiClientException {
379 365
		if (queryResults.size() != queries.size()) return false;
380 366

  
381
		maxX = corpus.getSize();
367
		maxX = getCorpus().getSize();
382 368
		int npositions = 0;
383 369
		for (int iQuery = 0 ; iQuery < queries.size() ; iQuery++) {
384 370
			QueryResult result = queryResults.get(iQuery);
......
415 401
	 * @throws CqiClientException the cqi client exception
416 402
	 */
417 403
	public boolean stepQueries() throws CqiClientException	{
418
		maxX = corpus.getSize();
404
		maxX = getCorpus().getSize();
419 405
		int npositions = 0;
420 406
		for (Query query : queries) {
421 407
			// System.out.println("query  "+query.getQueryString());
422
			QueryResult result = corpus.query(query, query.getQueryString()
408
			QueryResult result = getCorpus().query(query, query.getQueryString()
423 409
					.replace(" ", "_") + "_progression", true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$			
424 410
			int nLines = result.getNMatch();
425 411
			if (maxY < nLines)
......
477 463

  
478 464
			// System.out.println("Struct: "+ structure+" property: "+property);
479 465
			// System.out.println(query.getQueryString());
480
			QueryResult result = corpus.query(query, query.getQueryString().replace(" ", "_") + "_progression", true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
466
			QueryResult result = getCorpus().query(query, query.getQueryString().replace(" ", "_") + "_progression", true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
481 467
			int[] starts = result.getStarts();
482 468
			result.drop();
483 469
			int nLines = starts.length;
......
547 533
	 * @throws CqiClientException the cqi client exception
548 534
	 */
549 535
	public boolean stepFinalize() throws CqiClientException	{
550
		if (corpus instanceof Subcorpus) {
551
			List<Match> matches = ((Subcorpus) corpus).getMatches();
536
		if (getCorpus() instanceof Subcorpus) {
537
			List<Match> matches = ((Subcorpus) getCorpus()).getMatches();
552 538
			if (matches.size() == 0) {
553 539
				System.out.println(ProgressionCoreMessages.Progression_1);
554 540
				return false;
......
559 545
		}
560 546
		else {
561 547
			XminCorpus = 0;
562
			XmaxCorpus = corpus.getSize();
548
			XmaxCorpus = getCorpus().getSize();
563 549
		}
564 550
		//System.out.println("min: "+XminCorpus+ "max: "+XmaxCorpus);
565 551

  
tmp/org.txm.index.core/src/org/txm/index/core/preferences/IndexPreferences.java (revision 908)
16 16

  
17 17
	public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(IndexPreferences.class).getSymbolicName();
18 18
	
19
	public static final String PROPERTIES = "properties"; //$NON-NLS-1$
20
	
21
	
22 19
	/**
23 20
	 * Number of lines to display per page.
24 21
	 */
......
38 35
	public void initializeDefaultPreferences() {
39 36
	
40 37
		Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE);
41
		preferences.put(PROPERTIES, "word"); //$NON-NLS-1$
38
		preferences.put(UNIT_PROPERTIES, DEFAULT_UNIT_PROPERTY); //$NON-NLS-1$
39
		preferences.put(UNIT_PROPERTY, DEFAULT_UNIT_PROPERTY); //$NON-NLS-1$
42 40
		preferences.put(PROPERTIES_SEPARATOR, "_"); //$NON-NLS-1$
43 41
		preferences.put(QUERY, ""); //$NON-NLS-1$
44 42
		preferences.putInt(F_MIN, 1);
tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java (revision 908)
42 42
import org.apache.commons.lang.StringUtils;
43 43
import org.eclipse.osgi.util.NLS;
44 44
import org.rosuda.REngine.REXPMismatchException;
45
import org.txm.core.preferences.TBXPreferences;
45 46
import org.txm.core.results.Parameter;
46 47
import org.txm.core.results.TXMParameters;
47 48
import org.txm.core.results.TXMResult;
......
119 120
	/**
120 121
	 * The word properties shown.
121 122
	 */
122
	@Parameter(key=IndexPreferences.PROPERTIES)
123
	@Parameter(key=TBXPreferences.UNIT_PROPERTIES)
123 124
	protected List<WordProperty> pProperties;
124 125
	
125 126
	/**
......
365 366
	@Override
366 367
	public boolean saveParameters() {
367 368
			
368
		this.saveParameter(IndexPreferences.PROPERTIES, WordProperty.propertiesToString(pProperties));
369
		this.saveParameter(TBXPreferences.UNIT_PROPERTIES, WordProperty.propertiesToString(pProperties));
369 370
		
370 371
		if (pQuery != null) {
371 372
			this.saveParameter(IndexPreferences.QUERY, pQuery.getQueryString());
......
377 378
	
378 379
	@Override
379 380
	public boolean loadParameters() {
380
		this.pProperties = (List<WordProperty>) Property.stringToProperties(getCorpus(), this.getStringParameterValue(IndexPreferences.PROPERTIES));
381
		this.pProperties = (List<WordProperty>) Property.stringToProperties(getCorpus(), this.getStringParameterValue(TBXPreferences.UNIT_PROPERTIES));
381 382
		this.pQuery = new Query(this.getStringParameterValue(IndexPreferences.QUERY));
382 383
		return true;
383 384
	}
tmp/org.txm.index.core/src/org/txm/index/core/functions/Lexicon.java (revision 908)
91 91
	/** The writer. */
92 92
	private OutputStreamWriter writer;
93 93

  
94
	private Corpus corpus;
95

  
96
	
97

  
98 94
	/**
99 95
	 * The property.
100 96
	 */
101 97
	@Parameter(key=TBXPreferences.UNIT_PROPERTY)
102 98
	protected Property pProperty;
103

  
104 99
	
105
	
106
	
107 100
	public Lexicon(Corpus corpus)	{
108 101
		this(null, corpus);
109 102
	}
......
114 107
	
115 108
	public Lexicon(String uuid, Corpus corpus)	{
116 109
		super(uuid, corpus);
117
		this.corpus = (Corpus) this.parent;
110
		
118 111
		this.persistable = false; // FIXME: remove that later
119 112
	}
120 113

  
......
123 116
	@Override
124 117
	public boolean loadParameters() throws Exception {
125 118
		try {
126
			this.pProperty = this.getCorpus().getProperty(this.getStringParameterValue(TBXPreferences.UNIT_PROPERTY));
119
			String p = this.getStringParameterValue(TBXPreferences.UNIT_PROPERTY);
120
			this.pProperty = getCorpus().getProperty(p);
127 121
		}
128 122
		catch (CqiClientException e) {
129 123
			// TODO Auto-generated catch block
......
149 143

  
150 144
	@Override
151 145
	public boolean canCompute() throws Exception {
152
		return corpus != null && pProperty != null;
146
		return pProperty != null;
153 147
	}
154 148

  
155 149
	@Override
156 150
	protected boolean _compute() throws Exception {
157
		if (corpus instanceof MainCorpus) {
158
			return computeWithMainCorpus((MainCorpus)corpus, pProperty, monitor);
151
		if (getCorpus() instanceof MainCorpus) {
152
			return computeWithMainCorpus((MainCorpus)getCorpus(), pProperty, monitor);
159 153
		}
160
		else if (corpus instanceof Subcorpus) {
161
			return computewithSubCorpus((Subcorpus)corpus, pProperty, monitor);
154
		else if (getCorpus() instanceof Subcorpus) {
155
			return computewithSubCorpus((Subcorpus)getCorpus(), pProperty, monitor);
162 156
		}
163 157
		else {
164 158
			Log.severe("Error: Lexicon parent is neither a Maincorpus nor a Subcorpus.");
......
290 284

  
291 285
	@Override
292 286
	public boolean delete() {
293
		if (corpus != null) {
294
			corpus.removeData(this);
287
		if (getCorpus() != null) {
288
			getCorpus().removeData(this);
295 289
		}
296 290
		return true;
297 291
	}
......
334 328
	 * @return the corpus
335 329
	 */
336 330
	public Corpus getCorpus() {
337
		return corpus;
331
		return (Corpus)parent;
338 332
	}
339 333

  
340 334
	public String getDetails() {
341
		return  this.corpus.getName() + " " + this.pProperty.getName(); //$NON-NLS-1$
335
		return  getCorpus().getName() + " " + this.pProperty.getName(); //$NON-NLS-1$
342 336
	}
343 337

  
344 338
	//TODO: move this into a Lexicon chart renderer
......
438 432
	@Override
439 433
	public String getName() {
440 434
		try {
441
			return IndexCoreMessages.LEXICON_RESULT_TYPE + ": " + this.corpus.getSimpleName() + ": " + this.getSimpleName();	
435
			return IndexCoreMessages.LEXICON_RESULT_TYPE + ": " + this.getCorpus().getSimpleName() + ": " + this.getSimpleName();	
442 436
		}
443 437
		catch(Exception e) {
444 438
		}
......
515 509
		this.ids = ids;
516 510
		this.forms = null;
517 511
		this.pProperty = property;
518
		this.corpus = (Corpus) corpus;
519 512
	}
520 513

  
521 514

  
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/ProgressionEditor.java (revision 908)
340 340

  
341 341
			// add query button
342 342
			Button plusButton = new Button(queriesFocusComposite, SWT.NONE);
343
			plusButton.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
344
			plusButton.setText("Add multiple queries...");
343
			plusButton.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
344
			plusButton.setText("Add queries from file...");
345 345

  
346 346
			plusButton.addListener(SWT.Selection, new Listener() {
347 347
				@Override
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 908)
65 65
	public static final Pattern FILE_NAME_PATTERN = Pattern.compile("[^a-zA-Z0-9\\.-]+"); //$NON-NLS-1$
66 66
	public static final String UNDERSCORE = "_";
67 67

  
68

  
69 68
	/**
70 69
	 * Unique ID of the result.
71 70
	 */

Formats disponibles : Unified diff