Révision 3827

TXM/trunk/bundles/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java (revision 3827)
505 505
	public boolean canCompute() {
506 506

  
507 507
		if (pQuery == null || pQuery.isEmpty()) {
508
			Log.fine("No query set.");
508
			Log.fine("No query set."); //$NON-NLS-1$
509 509
			return false;
510 510
		}
511 511

  
512 512
		if (pProperties == null) {
513
			Log.fine("No properties set.");
513
			Log.fine("No properties set."); //$NON-NLS-1$
514 514
			return false;
515 515
		}
516 516

  
517 517
		if (getCorpus() == null) {
518
			Log.fine("No corpus set.");
518
			Log.fine("No corpus set."); //$NON-NLS-1$
519 519
			return false;
520 520
		}
521 521

  
522 522
		if (pProperties.size() == 0) {
523
			Log.fine("No properties filled.");
523
			Log.fine("No properties filled."); //$NON-NLS-1$
524 524
			return false;
525 525
		}
526 526

  
......
692 692

  
693 693
	@Override
694 694
	public String getComputingStartMessage() {
695
		return TXMCoreMessages.bind(CooccurrenceCoreMessages.cooccurrentsOfP0PropertieP1InTheP2Corpus, (this.pQuery != null?this.pQuery.asString():"<no query>"), WordProperty.asString(this.pProperties),
695
		return TXMCoreMessages.bind(CooccurrenceCoreMessages.cooccurrentsOfP0PropertieP1InTheP2Corpus, (this.pQuery != null?this.pQuery.asString():CooccurrenceCoreMessages.NoQuery), WordProperty.asString(this.pProperties),
696 696
				(this.pMaxLeftContextSize - 1), (this.pMaxRightContextSize - 1), this.pFminFilter, this.pFCoocFilter, this.pScoreMinFilter, this.getCorpus().getName());
697 697
	}
698 698

  
......
1094 1094

  
1095 1095
		}
1096 1096
		catch (Exception e) {
1097
			System.out.println("Error while setting cooccurrence parameters: " + e.getLocalizedMessage());
1097
			System.out.println(CooccurrenceCoreMessages.ErrorWhileSettingCooccurrenceParameters + e.getLocalizedMessage());
1098 1098
			Log.printStackTrace(e);
1099 1099
			return false;
1100 1100
		}
......
1184 1184
				index.setVisible(false);
1185 1185
				index.setParameters(new CQLQuery(pCooccurentQueryFilter), pProperties, null, null, null, null);
1186 1186
				if (!index.compute(new LogMonitor())) {
1187
					Log.severe("Cooccurrence internal Index compute failed. Aborting.");
1187
					Log.severe(CooccurrenceCoreMessages.ErrorWhileComputingIndexForTheCooccurrenceAborting);
1188 1188
					return false;
1189 1189
				}
1190 1190
			}
1191 1191
			catch (Exception e) {
1192
				Log.severe("Error while computing Index for the cooccurrence: " + e.getLocalizedMessage());
1192
				Log.severe(CooccurrenceCoreMessages.ErrorWhileComputingIndexForTheCooccurrenceP0 + e.getLocalizedMessage());
1193 1193
				return false;
1194 1194
			}
1195 1195
		}
......
1355 1355
		//int[] positionsDistances = new ArrayList()
1356 1356
		for (Match m : m1) { // for each match = for each focus
1357 1357

  
1358
			if (debug) System.out.println("m="+m);
1358
			if (debug) System.out.println("m="+m); //$NON-NLS-1$
1359 1359
			if (m.getTarget() >= 0) { // if target is set focus on target position
1360 1360
				m.setStart(m.getTarget());
1361 1361
				m.setEnd(m.getTarget());
......
1424 1424
					dist = position - m.getEnd() - 1;
1425 1425
				}
1426 1426
				else { // the n match is in the m match !?
1427
					Log.warning("Warning: the n match is in the m match ? " + n + " " + m);
1427
					Log.warning("Warning: the n match is in the m match ? " + n + " " + m); //$NON-NLS-1$ //$NON-NLS-2$
1428 1428
					dist = 0;
1429 1429
				}
1430 1430
				
1431
				if (debug) System.out.println(" p="+position+" sign="+allsignaturesstr.get(position)+" dist="+dist);
1431
				if (debug) System.out.println(" p="+position+" sign="+allsignaturesstr.get(position)+" dist="+dist); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
1432 1432
				if (positionsDistances.containsKey(position) && positionsDistances.get(position) > dist) {
1433 1433
					positionsDistances.put(position, dist);
1434 1434
//					if (debug) System.out.println(" using the higher distance");
......
1523 1523
		if (debug) System.out.println(anticontextquery);
1524 1524
		if (debug) System.out.println(m3);
1525 1525

  
1526
		Log.finest("R1 size=" + m1.size());
1527
		Log.finest("R2 size=" + m2.size());
1528
		Log.finest("R3 size=" + m3.size());
1526
		Log.finest("R1 size=" + m1.size()); //$NON-NLS-1$
1527
		Log.finest("R2 size=" + m2.size()); //$NON-NLS-1$
1528
		Log.finest("R3 size=" + m3.size()); //$NON-NLS-1$
1529 1529

  
1530 1530
		// System.out.println(query+" M1 size: "+m1.size());
1531 1531
		// System.out.println(contextquery+" M2 size: "+m2.size());
......
1590 1590
						indexfreqs.get(specifrownames[ii]), scores[ii][1], // freq
1591 1591
						((float) (distances.get(signaturestr) / counts.get(signaturestr))), // mean distance
1592 1592
						-1);
1593
				cline.debug = " "+signaturestr;
1593
				cline.debug = " "+signaturestr; //$NON-NLS-1$
1594 1594
				// System.out.println("Line: "+specifrownames[ii]+" dists="+distances.get(signaturestr)+" counts="+counts.get(signaturestr)+" mean="+((float) (distances.get(signaturestr) / counts.get(signaturestr))));
1595 1595
				// select the line
1596 1596
				if (cline.freq >= this.pFminFilter && cline.nbocc >= this.pFCoocFilter && cline.score >= this.pScoreMinFilter) {
......
1615 1615
		// structural context
1616 1616

  
1617 1617
		String sfixedQuery = CQLQuery.fixQuery(pQuery.getQueryString(), this.getCorpus().getLang()); // a query starting with " or [ or (
1618
		if (sfixedQuery.contains("@[") || sfixedQuery.contains("@\"")) {
1618
		if (sfixedQuery.contains("@[") || sfixedQuery.contains("@\"")) { //$NON-NLS-1$ //$NON-NLS-2$
1619 1619
			
1620
		} else if (sfixedQuery.startsWith("(")) {
1621
			sfixedQuery = "(@"+sfixedQuery.substring(1);
1622
		} else if (sfixedQuery.startsWith("((")) {
1623
			sfixedQuery = "((@"+sfixedQuery.substring(2);
1620
		} else if (sfixedQuery.startsWith("(")) { //$NON-NLS-1$
1621
			sfixedQuery = "(@"+sfixedQuery.substring(1); //$NON-NLS-1$
1622
		} else if (sfixedQuery.startsWith("((")) { //$NON-NLS-1$
1623
			sfixedQuery = "((@"+sfixedQuery.substring(2); //$NON-NLS-1$
1624 1624
		} else {
1625
			sfixedQuery = "@"+sfixedQuery;
1625
			sfixedQuery = "@"+sfixedQuery; //$NON-NLS-1$
1626 1626
		}
1627 1627

  
1628 1628
		if (pStructuralUnitLimit != null) {
TXM/trunk/bundles/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/preferences/CooccurrencePreferences.java (revision 3827)
31 31

  
32 32
	public static final String INCLUDE_X_PIVOT = "include_x_pivot"; //$NON-NLS-1$
33 33
	public static final String PARTIAL_LEXICAL_TABLE = "partial_lexical_table"; //$NON-NLS-1$
34
	public static final String MILESTONE_STRUCTURES_TO_IGNORE = "milestone_structures_to_ignore";
34
	public static final String MILESTONE_STRUCTURES_TO_IGNORE = "milestone_structures_to_ignore"; //$NON-NLS-1$
35 35
	
36 36

  
37 37
	public static final String QUERY_FILTER = "query_filter"; //$NON-NLS-1$
......
67 67
		preferences.putInt(MIN_RIGHT, 1);
68 68
		preferences.putInt(MAX_RIGHT, 10);
69 69
		
70
		preferences.put(MILESTONE_STRUCTURES_TO_IGNORE, "txmcorpus,text,anchor,cb,fw,gb,lb,milestone,pb");
70
		preferences.put(MILESTONE_STRUCTURES_TO_IGNORE, "txmcorpus,text,anchor,cb,fw,gb,lb,milestone,pb"); //$NON-NLS-1$
71 71
		preferences.put(UNIT_PROPERTIES, TXMPreferences.DEFAULT_UNIT_PROPERTY);
72 72
	}
73 73
	
TXM/trunk/bundles/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/r/CooccurrencesRTransformer.java (revision 3827)
60 60
				//+ ", query=\""+this.query.getQueryString()+"\""
61 61
				+ ")"); //$NON-NLS-1$
62 62

  
63
		rw.eval("rm(coocfreq, cooccofreq, coocscore, coocmeandist)");
63
		rw.eval("rm(coocfreq, cooccofreq, coocscore, coocmeandist)"); //$NON-NLS-1$
64 64
		nocooc++;
65 65
		return symbol;
66 66
	}
TXM/trunk/bundles/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/CooccurrenceCoreMessages.java (revision 3827)
19 19
	
20 20
	public static String P0CooccurentsForP1Occurrences;
21 21
	public static String propertiesColon; 
22
	public static String error_error;
23

  
22 24
	public static String errorColonNegativeArgumentInFactlnFunction; 
23 25
	public static String errorColonNegativeArgumentInRbicolnFunction; 
24 26
	public static String occ; 
25 27
	public static String freq; 
26
	public static String coFreq; 
28
	public static String coFreq;
29

  
30
	public static String common_noResults; 
27 31
	public static String score; 
28 32
	public static String meanDist; 
29 33
	public static String errorColonNoCooccurrents; 
......
36 40
	public static String cooccurrentsOfP0PropertieP1InTheP2Corpus;
37 41
	
38 42
	
43
	public static String ErrorWhileComputingIndexForTheCooccurrenceAborting;
44

  
45
	public static String ErrorWhileComputingIndexForTheCooccurrenceP0;
46

  
47
	public static String ErrorWhileSettingCooccurrenceParameters;
48

  
39 49
	public static String info_buildingQueries;
40 50
	public static String info_retreivingMatches;
41 51
	public static String info_buildingLineSignatures;
......
43 53
	public static String info_buildingLexicalTable;
44 54
	public static String info_computingSpecificitiesScores;
45 55
	public static String info_details;
56

  
57
	public static String NoQuery;
46 58
	
47 59
	static {
48 60
		// initialize resource bundle
TXM/trunk/bundles/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/messages.properties (revision 3827)
1 1
#TXM messages generated by the PluginMessagesManager class
2 2
#Fri Jun 10 16:36:03 CEST 2022
3 3
coFreq=CoFreq
4
common_noResults=
4 5
cooccurrentsOfP0PropertieP1InTheP2Corpus=Cooccurrents of {0}, property {1} {2} {3}, ≥{4} ≥{5} ≥{6}, in {7} corpus...
6
error_error=
5 7
errorColonNegativeArgumentInFactlnFunction=** Error\: negative argument in 'factln' function
6 8
errorColonNegativeArgumentInRbicolnFunction=** Error\: negative argument in 'rbicoln' function
7 9
errorColonNoCooccurrents=** Error\: no cooccurrents
10
ErrorWhileComputingIndexForTheCooccurrenceAborting=Error while computing Index for the cooccurrence. Aborting.
11
ErrorWhileComputingIndexForTheCooccurrenceP0=Error while computing Index for the cooccurrence: 
12
ErrorWhileSettingCooccurrenceParameters=Error while setting cooccurrence parameters: 
8 13
fColon=\ F\: 
9 14
freq=Freq
10 15
info_buildingLexicalTable=Building lexical table...
......
16 21
info_retreivingMatches=Retrieving matches...
17 22
meanDist=MeanDist
18 23
meanDistColon=\ M.D.\:
24
NoQuery=<no query>
19 25
occ=Occ
20 26
occColon=\ Occ\:
21 27
occFreqCoFreqScoreMeanDistMode=Occ Freq CoFreq Score MeanDist Mode

Formats disponibles : Unified diff