Révision 3433
TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/editors/CooccurrencesEditor.java (revision 3433) | ||
---|---|---|
33 | 33 |
|
34 | 34 |
import org.eclipse.core.runtime.IProgressMonitor; |
35 | 35 |
import org.eclipse.jface.operation.IRunnableWithProgress; |
36 |
import org.eclipse.jface.viewers.ColumnViewerToolTipSupport; |
|
37 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
|
38 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
|
36 | 39 |
import org.eclipse.jface.viewers.TableViewer; |
37 | 40 |
import org.eclipse.osgi.util.NLS; |
38 | 41 |
import org.eclipse.swt.SWT; |
... | ... | |
344 | 347 |
|
345 | 348 |
viewer.setLabelProvider(new LineLabelProvider()); |
346 | 349 |
viewer.setContentProvider(new LineContentProvider()); |
350 |
viewer.getTable().setToolTipText(""); |
|
351 |
viewer.addPostSelectionChangedListener(new ISelectionChangedListener() { |
|
352 |
|
|
353 |
@Override |
|
354 |
public void selectionChanged(SelectionChangedEvent event) { |
|
355 |
|
|
356 |
viewer.getTable().setToolTipText(viewer.getStructuredSelection().toList().toString()); |
|
357 |
} |
|
358 |
}); |
|
359 |
//ColumnViewerToolTipSupport.enableFor(viewer); |
|
347 | 360 |
|
348 | 361 |
nColumn = new TableColumn(viewer.getTable(), SWT.RIGHT); |
349 | 362 |
nColumn.setText(" "); //$NON-NLS-1$ |
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchWindowAdvisor.java (revision 3433) | ||
---|---|---|
54 | 54 |
import org.txm.annotation.core.AnnotationEngine; |
55 | 55 |
import org.txm.annotation.core.AnnotationEnginesManager; |
56 | 56 |
import org.txm.core.engines.EngineType; |
57 |
import org.txm.core.results.TXMResult; |
|
57 | 58 |
import org.txm.objects.CorpusBuild; |
59 |
import org.txm.objects.Project; |
|
58 | 60 |
import org.txm.rcp.messages.TXMUIMessages; |
59 | 61 |
import org.txm.utils.logger.Log; |
60 | 62 |
|
... | ... | |
175 | 177 |
* @see WorkbenchAdvisor#preShutdown() |
176 | 178 |
*/ |
177 | 179 |
public boolean preWindowShellClose() { |
180 |
|
|
181 |
ArrayList<TXMResult> altered = new ArrayList<>(); |
|
182 |
for (Project project : Toolbox.workspace.getProjects()) { |
|
183 |
for (TXMResult result : project.getDeepChildren()) { |
|
184 |
if (result.isAltered()) { |
|
185 |
altered.add(result); |
|
186 |
} |
|
187 |
} |
|
188 |
} |
|
189 |
|
|
190 |
if (altered.size() > 0) { |
|
191 |
StringBuilder mess = new StringBuilder(); |
|
192 |
mess.append("Some result have been manually modified: "); |
|
193 |
for (TXMResult result : altered) { |
|
194 |
mess.append("\n- "+result.getName()+ " ("+result.getResultType()+") : "+result.getSimpleDetails()); |
|
195 |
} |
|
196 |
mess.append("\n\nYou're going to lost those modifications. Continue?"); |
|
197 |
return MessageDialog.openConfirm(this.getWindowConfigurer().getWindow().getShell(), "Some result are modified", mess.toString()); |
|
198 |
} |
|
199 |
|
|
178 | 200 |
AnnotationEnginesManager aem = (AnnotationEnginesManager) Toolbox.getEngineManager(EngineType.ANNOTATION); |
179 | 201 |
HashMap<CorpusBuild, ArrayList<AnnotationEngine>> notSaved = aem.getEnginesWithSaveNeededPerCorpus(); |
180 | 202 |
if (notSaved.size() > 0) { |
181 | 203 |
StringBuilder mess = new StringBuilder(); |
182 | 204 |
mess.append( "Some annotations are not saved for corpus and engines:"); |
183 | 205 |
for (CorpusBuild corpus : notSaved.keySet()) { |
184 |
mess.append("\n- "+corpus+":");
|
|
206 |
mess.append("\n- "+corpus.getName()+": "+corpus.getSimpleDetails());
|
|
185 | 207 |
for (AnnotationEngine a: notSaved.get(corpus)) { |
186 | 208 |
mess.append("\n - "+a.getName()); |
187 | 209 |
} |
188 | 210 |
} |
189 |
mess.append("\n\nContinue and lost the unsaved annotations ?");
|
|
211 |
mess.append("\n\nContinue and lost the unsaved annotations "); |
|
190 | 212 |
return MessageDialog.openConfirm(this.getWindowConfigurer().getWindow().getShell(), "Some annotations are not saved", mess.toString()); |
191 | 213 |
} else { |
192 | 214 |
return true; |
TXM/trunk/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java (revision 3433) | ||
---|---|---|
32 | 32 |
import java.io.FileOutputStream; |
33 | 33 |
import java.io.IOException; |
34 | 34 |
import java.io.OutputStreamWriter; |
35 |
import java.io.PrintWriter; |
|
35 | 36 |
import java.io.Writer; |
36 | 37 |
import java.util.ArrayList; |
37 | 38 |
import java.util.Collections; |
... | ... | |
204 | 205 |
@Override |
205 | 206 |
public String toString() { |
206 | 207 |
return occ + CooccurrenceCoreMessages.fColon + freq + CooccurrenceCoreMessages.occColon + nbocc + CooccurrenceCoreMessages.scoreColon + score + CooccurrenceCoreMessages.meanDistColon |
207 |
+ distmoyenne + CooccurrenceCoreMessages.propertiesColon + props; |
|
208 |
+ distmoyenne + CooccurrenceCoreMessages.propertiesColon + props+debug;
|
|
208 | 209 |
} |
209 | 210 |
} |
210 | 211 |
|
... | ... | |
1347 | 1348 |
*/ |
1348 | 1349 |
public boolean stepCount() { |
1349 | 1350 |
// ArrayList<Integer> keepedPosition = new ArrayList<>(); |
1350 |
|
|
1351 |
//PrintWriter debugWriter = new PrintWriter(new File("/home/mdecorde/debugcooc.txt")); |
|
1351 | 1352 |
int startsearchM2 = 0; // optimisation: m2 is ordered |
1352 | 1353 |
int startsearchM3 = 0; // optimisation: m3 is ordered |
1353 | 1354 |
// time = System.currentTimeMillis(); |
... | ... | |
1411 | 1412 |
continue; |
1412 | 1413 |
} |
1413 | 1414 |
|
1414 |
if (allsignaturesstr.get(position).equals("[succès]")) {
|
|
1415 |
if (allsignaturesstr.get(position).equals("[1308]")) {
|
|
1415 | 1416 |
int a = 1+1; |
1416 | 1417 |
} |
1417 | 1418 |
|
... | ... | |
1464 | 1465 |
counts.put(signaturestr, 1); |
1465 | 1466 |
} |
1466 | 1467 |
|
1467 |
if (allsignaturesstr.get(position).equals("[succès]")) {
|
|
1468 |
int b = 1+1;
|
|
1468 |
if (allsignaturesstr.get(position).equals("[1308]")) {
|
|
1469 |
System.out.println("dist= "+dist+" distances="+distances.get(signaturestr)+" counts="+counts.get(signaturestr));
|
|
1469 | 1470 |
} |
1470 | 1471 |
|
1471 | 1472 |
// if ("[1599]".equals(signaturestr)) { |
1472 |
//System.out.println("sign="+allsignaturesstr.get(position)+" p=" + position + " c=" + counts.get(signaturestr) + " d=" + dist + " total(d)=" + distances.get(signaturestr)); |
|
1473 |
// System.out.println("sign="+allsignaturesstr.get(position)+" p=" + position + " c=" + counts.get(signaturestr) + " d=" + dist + " total(d)=" + distances.get(signaturestr));
|
|
1473 | 1474 |
// } |
1474 | 1475 |
// } |
1475 | 1476 |
|
... | ... | |
1589 | 1590 |
indexfreqs.get(specifrownames[ii]), scores[ii][1], // freq |
1590 | 1591 |
((float) (distances.get(signaturestr) / counts.get(signaturestr))), // mean distance |
1591 | 1592 |
-1); |
1592 |
cline.debug = ""+this;
|
|
1593 |
cline.debug = "";//" "+signaturestr;
|
|
1593 | 1594 |
// System.out.println("Line: "+specifrownames[ii]+" dists="+distances.get(signaturestr)+" counts="+counts.get(signaturestr)+" mean="+((float) (distances.get(signaturestr) / counts.get(signaturestr)))); |
1594 | 1595 |
// select the line |
1595 | 1596 |
if (cline.freq >= this.pFminFilter && cline.nbocc >= this.pFCoocFilter && cline.score >= this.pScoreMinFilter) { |
Formats disponibles : Unified diff