Révision 2916

tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/preferences/CoocPreferencePage.java (revision 2916)
47 47
 *
48 48
 */
49 49
public class CoocPreferencePage extends TXMPreferencePage {
50

  
51

  
50
	
51
	
52 52
	@Override
53 53
	public void createFieldEditors() {
54

  
54
		
55 55
		/** The scoreformatfield. */
56 56
		StringFieldEditor scoreformatfield = new StringFieldEditor(CooccurrencePreferences.SCORE_FORMAT, CooccurrenceUIMessages.scoreFormatDefault00000E00, getFieldEditorParent());
57 57
		scoreformatfield.setTextLimit(15);
58

  
58
		
59 59
		/** The minfreqfield. */
60 60
		IntegerFieldEditor minfreqfield = new IntegerFieldEditor(TXMPreferences.F_MIN, CooccurrenceUIMessages.minimumFrequencyThresholdOfTheCooccurrent, getFieldEditorParent());
61
		minfreqfield.setValidRange(0, 9999999);
62

  
61
		minfreqfield.setValidRange(0, Integer.MAX_VALUE);
62
		
63 63
		/** The mincountfield. */
64 64
		IntegerFieldEditor mincountfield = new IntegerFieldEditor(CooccurrencePreferences.MIN_COUNT, CooccurrenceUIMessages.minimumCooccurrencyCountThreshold, getFieldEditorParent());
65
		mincountfield.setValidRange(0, 9999999);
66

  
65
		mincountfield.setValidRange(0, Integer.MAX_VALUE);
66
		
67 67
		/** The minscorefield. */
68 68
		DoubleFieldEditor minscorefield = new DoubleFieldEditor(CooccurrencePreferences.MIN_SCORE, CooccurrenceUIMessages.minimumCooccurrencyScoreThreshold, getFieldEditorParent());
69 69
		minscorefield.setTextLimit(15);
......
80 80
		IntegerFieldEditor maxrightfield = new IntegerFieldEditor(CooccurrencePreferences.MAX_RIGHT, CooccurrenceUIMessages.maximumRight, getFieldEditorParent());
81 81
		maxrightfield.setValidRange(0, 99999);
82 82
		
83
		BooleanFieldEditor partiallexicaltablefield =  new BooleanFieldEditor(CooccurrencePreferences.PARTIAL_LEXICAL_TABLE, CooccurrenceUIMessages.usePartialLexicalTable, getFieldEditorParent());
84

  
83
		BooleanFieldEditor partiallexicaltablefield = new BooleanFieldEditor(CooccurrencePreferences.PARTIAL_LEXICAL_TABLE, CooccurrenceUIMessages.usePartialLexicalTable, getFieldEditorParent());
84
		
85 85
		addField(scoreformatfield);
86 86
		addField(minfreqfield);
87 87
		addField(mincountfield);
......
92 92
		addField(maxrightfield);
93 93
		addField(partiallexicaltablefield);
94 94
	}
95

  
96 95
	
97

  
96
	
97
	
98 98
	@Override
99 99
	public void init(IWorkbench workbench) {
100 100
		this.setPreferenceStore(new TXMPreferenceStore(CooccurrencePreferences.getInstance().getPreferencesNodeQualifier()));
101
		//setDescription("Cooccurrences");
101
		// setDescription("Cooccurrences");
102 102
		this.setTitle(CooccurrenceUIMessages.cooccurrences);
103 103
		this.setImageDescriptor(CooccurrenceAdapterFactory.ICON);
104 104
	}
105 105
	
106

  
107
}
106
	
107
}
tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/handlers/ComputeSpecifities.java (revision 2916)
50 50
 * @author sjacquot
51 51
 */
52 52
public class ComputeSpecifities extends BaseAbstractHandler {
53

  
54

  
53
	
54
	
55 55
	@Override
56 56
	public Object execute(ExecutionEvent event) throws ExecutionException {
57

  
57
		
58 58
		if (!this.checkStatsEngine()) {
59 59
			return null;
60 60
		}
61

  
61
		
62 62
		try {
63 63
			Object selection = this.getCorporaViewSelectedObject(event);
64 64
			Specificities specificities = null;
65 65
			LexicalTable lexicalTable = null;
66 66
			
67 67
			// Reopening from existing result
68
			if(selection instanceof Specificities)	{
68
			if (selection instanceof Specificities) {
69 69
				specificities = (Specificities) selection;
70
				//lexicalTable = (LexicalTable) ((Specificities) selection).getParent();
70
				// lexicalTable = (LexicalTable) ((Specificities) selection).getParent();
71 71
			}
72 72
			// Creating
73
			else	{
73
			else {
74 74
				
75 75
				// creating from Partition
76 76
				if (selection instanceof Partition) {
......
82 82
				}
83 83
				// creating from Partition index
84 84
				else if (selection instanceof PartitionIndex) {
85
					lexicalTable = new LexicalTable((PartitionIndex)selection);
85
					lexicalTable = new LexicalTable((PartitionIndex) selection);
86 86
				}
87 87
				// creating from Lexical Table
88 88
				else if (selection instanceof LexicalTable) {
89 89
					lexicalTable = (LexicalTable) selection;
90 90
				}
91
	
91
				
92 92
				if (lexicalTable == null) {
93 93
					return super.logCanNotExecuteCommand(selection);
94 94
				}
95 95
				specificities = new Specificities(lexicalTable);
96 96
				
97
				if(!(selection instanceof LexicalTable))	{
97
				if (!(selection instanceof LexicalTable)) {
98 98
					// show the lexical table only if the command was called from a lexical table
99 99
					lexicalTable.setVisible(false);
100 100
					// also change the default fmin/vmax parameters to cover whole range
101 101
					lexicalTable.setFMinFilter(1);
102
					lexicalTable.setVMaxFilter(9999999);
102
					lexicalTable.setVMaxFilter(Integer.MAX_VALUE);
103 103
				}
104 104
			}
105

  
105
			
106 106
			TXMEditor.openEditor(specificities, SpecificitiesEditor.ID);
107 107
			
108 108
		}
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/prototypes/CQPBenchmark.groovy (revision 2916)
285 285
	// AFC PARTITION
286 286
	print " AFC"
287 287
	time = System.currentTimeMillis();
288
	CA ca = new CA(discours_dates, word_property, 0 ,9999999)
288
	CA ca = new CA(discours_dates, word_property, 0 ,Integer.MAX_VALUE)
289 289
	ca.stepLexicalTable();
290 290
	ca.stepSortTableLexical();
291 291
	ca.compute()
tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java (revision 2916)
83 83
	protected int Fmax = 0;
84 84
	
85 85
	/** The current Fmin value. */
86
	protected int Fmin = 9999999;
86
	protected int Fmin = Integer.MAX_VALUE;
87 87
	
88 88
	/** The current lines. */
89 89
	protected List<Line> lines = new ArrayList<>();
......
1153 1153
	
1154 1154
	/** The novoc. */
1155 1155
	protected static int novoc = 1;
1156

  
1156
	
1157 1157
	/** The prefix r. */
1158 1158
	protected static String prefixR = "Index"; //$NON-NLS-1$
1159

  
1159
	
1160 1160
	/**
1161 1161
	 * As r matrix.
1162 1162
	 *
1163 1163
	 * TODO MD: restore the asRMatrix method used by the execR&co macros as demonstration
1164
	 * TODO MD: finalize a export to R mechanism (maybe linked to the export engines to be implemented 
1164
	 * TODO MD: finalize a export to R mechanism (maybe linked to the export engines to be implemented
1165 1165
	 *
1166 1166
	 * @return the string
1167 1167
	 * @throws RWorkspaceException the r workspace exception
1168 1168
	 */
1169 1169
	public String asRMatrix() throws RWorkspaceException {
1170
		String symbol = prefixR+novoc;
1171

  
1172
		ArrayList<String> colnames = new ArrayList<String>();
1173
		ArrayList<String> partnames = new ArrayList<String>();
1170
		String symbol = prefixR + novoc;
1171
		
1172
		ArrayList<String> colnames = new ArrayList<>();
1173
		ArrayList<String> partnames = new ArrayList<>();
1174 1174
		partnames.add(this.getCorpus().getName());
1175 1175
		
1176 1176
		colnames.add("F"); //$NON-NLS-1$
1177 1177
		if (partnames.size() > 1)
1178 1178
			for (int j = 0; j < partnames.size(); j++)
1179
				colnames.add(partnames.get(j)); 
1180

  
1181
		//System.out.println("cols: "+colnames);
1182

  
1179
			colnames.add(partnames.get(j));
1180
		
1181
		// System.out.println("cols: "+colnames);
1182
		
1183 1183
		String[] keywords = new String[this.lines.size()];
1184

  
1184
		
1185 1185
		int[] freq = new int[this.lines.size()];
1186
		ArrayList<int[]> partfreqs = new ArrayList<int[]>(partnames.size());
1186
		ArrayList<int[]> partfreqs = new ArrayList<>(partnames.size());
1187 1187
		if (partnames.size() > 1)
1188 1188
			for (int j = 0; j < partnames.size(); j++)
1189
				partfreqs.add(new int[this.lines.size()]);
1190

  
1191
		for (int i = 0 ; i < lines.size() ; i++) 
1192
		{
1189
			partfreqs.add(new int[this.lines.size()]);
1190
		
1191
		for (int i = 0; i < lines.size(); i++) {
1193 1192
			Line ligne = lines.get(i);
1194
			freq[i] = ligne.getFrequency(); 
1193
			freq[i] = ligne.getFrequency();
1195 1194
			keywords[i] = ligne.toString();
1196 1195
			if (partnames.size() > 1)
1197
				for (int j = 0; j < partnames.size(); j++)
1198
				{
1199
					partfreqs.get(j)[i] = ligne.getFrequency(j);
1196
				for (int j = 0; j < partnames.size(); j++) {
1197
				partfreqs.get(j)[i] = ligne.getFrequency(j);
1200 1198
				}
1201

  
1199
				
1202 1200
		}
1203

  
1201
		
1204 1202
		RWorkspace rw = RWorkspace.getRWorkspaceInstance();
1205 1203
		if (partnames.size() > 1)
1206 1204
			for (int j = 0; j < partnames.size(); j++)
1207
				rw.addVectorToWorkspace("vocpartfreqs"+j, partfreqs.get(j)); //$NON-NLS-1$
1205
			rw.addVectorToWorkspace("vocpartfreqs" + j, partfreqs.get(j)); //$NON-NLS-1$
1208 1206
		rw.addVectorToWorkspace("vocfreq", freq); //$NON-NLS-1$
1209 1207
		rw.addVectorToWorkspace("vockeywords", keywords); //$NON-NLS-1$
1210 1208
		rw.addVectorToWorkspace("voccolnames", colnames.toArray(new String[colnames.size()])); //$NON-NLS-1$
1211

  
1209
		
1212 1210
		int ncol = 1;
1213 1211
		if (partnames.size() > 1)
1214 1212
			ncol += partnames.size();
1215

  
1213
		
1216 1214
		int nrow = lines.size();
1217 1215
		String partscmd = ""; //$NON-NLS-1$
1218 1216
		if (partnames.size() > 1)
1219 1217
			for (int j = 0; j < partnames.size(); j++)
1220
				partscmd +=", vocpartfreqs"+j; //$NON-NLS-1$
1221

  
1222
		rw.eval(symbol+ "<- matrix(data = c(vocfreq"+partscmd+"), nrow = "+nrow+", ncol = "+ncol+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
1223
		rw.eval("colnames("+symbol+" ) <- voccolnames"); //$NON-NLS-1$ //$NON-NLS-2$
1224
		rw.eval("rownames("+symbol+" ) <- vockeywords"); //$NON-NLS-1$ //$NON-NLS-2$
1225
		rw.eval(symbol+ "<- list(data="+symbol+")"); //$NON-NLS-1$ //$NON-NLS-2$
1226

  
1218
			partscmd += ", vocpartfreqs" + j; //$NON-NLS-1$
1219
			
1220
		rw.eval(symbol + "<- matrix(data = c(vocfreq" + partscmd + "), nrow = " + nrow + ", ncol = " + ncol + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
1221
		rw.eval("colnames(" + symbol + " ) <- voccolnames"); //$NON-NLS-1$ //$NON-NLS-2$
1222
		rw.eval("rownames(" + symbol + " ) <- vockeywords"); //$NON-NLS-1$ //$NON-NLS-2$
1223
		rw.eval(symbol + "<- list(data=" + symbol + ")"); //$NON-NLS-1$ //$NON-NLS-2$
1224
		
1227 1225
		novoc++;
1228 1226
		return symbol;
1229 1227
	}
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/preferences/LexicalTablePreferencePage.java (revision 2916)
51 51
	public void createFieldEditors() {
52 52
		
53 53
		IntegerFieldEditor fmin = new IntegerFieldEditor(TXMPreferences.F_MIN, TXMCoreMessages.common_lowestFrequency, this.getFieldEditorParent());
54
		fmin.setValidRange(1, 999999999);
54
		fmin.setValidRange(1, Integer.MAX_VALUE);
55 55
		
56 56
		IntegerFieldEditor vmax = new IntegerFieldEditor(TXMPreferences.V_MAX, TXMCoreMessages.common_numberOfLines, this.getFieldEditorParent());
57
		vmax.setValidRange(1, 999999999);
57
		vmax.setValidRange(1, Integer.MAX_VALUE);
58 58
		
59 59
		this.addField(fmin);
60 60
		this.addField(vmax);
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAParametersDialog.java (revision 2916)
190 190
		maxlinesLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, true, false));
191 191
		maxlinesSpinner = new Spinner(composite, SWT.BORDER);
192 192
		maxlinesSpinner.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
193
		maxlinesSpinner.setMaximum(9999999);
193
		maxlinesSpinner.setMaximum(Integer.MAX_VALUE);
194 194
		maxlinesSpinner.setMinimum(1);
195
		maxlinesSpinner.setSelection(9999999);
195
		maxlinesSpinner.setSelection(Integer.MAX_VALUE);
196 196
		maxlinesSpinner.setSelection(vmax);
197 197
		
198 198
		fminLabel = new Label(composite, SWT.NONE);
......
200 200
		fminLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, true, false));
201 201
		fminSpinner = new Spinner(composite, SWT.BORDER);
202 202
		fminSpinner.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
203
		fminSpinner.setMaximum(9999999);
203
		fminSpinner.setMaximum(Integer.MAX_VALUE);
204 204
		fminSpinner.setMinimum(1);
205 205
		fminSpinner.setSelection(fmin);
206 206
		
tmp/org.txm.referencer.core/src/org/txm/referencer/core/functions/Referencer.java (revision 2916)
542 542
	public void toTxt(Writer writer, int from, int to, String colseparator, String txtseparator)
543 543
			throws CqiClientException, IOException {
544 544
		try {
545
			getLines(0, 9999999);
545
			getLines(0, Integer.MAX_VALUE);
546 546
			writer.write(pProperty.getName() + colseparator + this.pPattern + "\n"); //$NON-NLS-1$
547 547
			for (Line line : lines) {
548 548
				writer.write(txtseparator + line.getPropValue().replace(txtseparator, txtseparator + txtseparator) + txtseparator + colseparator + txtseparator + line.getReferences().toString()
tmp/org.txm.queryindex.rcp/src/org/txm/queryindex/core/functions/QueryIndex.java (revision 2916)
74 74
	}
75 75
	
76 76
	public int getFmin() {
77
		int t = 999999999;
77
		int t = Integer.MAX_VALUE;
78 78
		for (QueryIndexLine line : lines.values()) {
79 79
			int f = line.getFrequency();
80 80
			if (f < t) t = f;
tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java (revision 2916)
86 86
	@Override
87 87
	public boolean loadParameters() {
88 88
		try {
89
			this.fMin = 999999999;
89
			this.fMin = Integer.MAX_VALUE;
90 90
			this.fMax = 0;
91 91
			StructuralUnit su = this.getCorpus().getStructuralUnit(this.getStringParameterValue(TextsBalancePreferences.STRUCTURAL_UNIT));
92 92
			this.setParameters(su, su.getProperty(this.getStringParameterValue(TextsBalancePreferences.STRUCTURAL_UNIT_PROPERTY)));

Formats disponibles : Unified diff