Révision 646
| tmp/org.txm.queryindex.rcp/src/org/txm/functions/queryindex/QueryIndex.java (revision 646) | ||
|---|---|---|
| 20 | 20 |
import org.eclipse.core.runtime.IProgressMonitor; |
| 21 | 21 |
import org.eclipse.jface.resource.ImageDescriptor; |
| 22 | 22 |
import org.eclipse.ui.model.IWorkbenchAdapter; |
| 23 |
import org.eclipse.ui.plugin.AbstractUIPlugin; |
|
| 24 | 23 |
import org.txm.core.messages.TXMCoreMessages; |
| 25 | 24 |
import org.txm.core.results.TXMParameters; |
| 26 | 25 |
import org.txm.core.results.TXMResult; |
| 27 |
import org.txm.functions.TXMCommand; |
|
| 28 | 26 |
import org.txm.index.core.functions.LineComparator.SortMode; |
| 29 | 27 |
import org.txm.index.core.messages.IndexCoreMessages; |
| 30 | 28 |
import org.txm.lexicaltable.core.functions.LexicalTable; |
| ... | ... | |
| 36 | 34 |
import org.txm.searchengine.cqp.corpus.Partition; |
| 37 | 35 |
import org.txm.searchengine.cqp.corpus.QueryResult; |
| 38 | 36 |
import org.txm.searchengine.cqp.corpus.query.Query; |
| 39 |
import org.txm.statsengine.r.core.exceptions.RWorkspaceException; |
|
| 40 | 37 |
import org.txm.utils.logger.Log; |
| 41 | 38 |
|
| 42 |
public class QueryIndex extends TXMCommand implements IAdaptable {
|
|
| 39 |
public class QueryIndex extends TXMResult implements IAdaptable {
|
|
| 43 | 40 |
|
| 44 | 41 |
Corpus corpus; |
| 45 | 42 |
Partition partition; |
| ... | ... | |
| 96 | 93 |
} |
| 97 | 94 |
|
| 98 | 95 |
public QueryIndex(Corpus corpus) {
|
| 96 |
super(corpus); |
|
| 99 | 97 |
this.corpus = corpus; |
| 100 | 98 |
partnames = Arrays.asList(corpus.getName()); |
| 101 | 99 |
} |
| ... | ... | |
| 106 | 104 |
return corpus.getName(); |
| 107 | 105 |
} |
| 108 | 106 |
|
| 109 |
public TXMResult getParent() {
|
|
| 110 |
if (partition != null) return partition; |
|
| 111 |
return corpus; |
|
| 112 |
} |
|
| 113 |
|
|
| 114 | 107 |
public QueryIndex(Partition partition) {
|
| 108 |
super(partition); |
|
| 115 | 109 |
this.corpus = partition.getCorpus(); |
| 116 | 110 |
this.partition = partition; |
| 117 | 111 |
partnames = partition.getPartNames(); |
| ... | ... | |
| 328 | 322 |
|
| 329 | 323 |
try {
|
| 330 | 324 |
LexicalTableImpl lt = new LexicalTableImpl(freqs, rownames, colnames); |
| 331 |
LexicalTable table = new LexicalTable(partition, partition.getProperty(), 1, lt); |
|
| 325 |
LexicalTable table = new LexicalTable(partition, partition.getProperty(), 1, this.getV(), lt);
|
|
| 332 | 326 |
return table; |
| 333 | 327 |
} catch (Exception e) {
|
| 334 | 328 |
Log.printStackTrace(e); |
| ... | ... | |
| 417 | 411 |
|
| 418 | 412 |
@Override |
| 419 | 413 |
public boolean delete() {
|
| 420 |
if (partition != null) return partition.removeResult(this); |
|
| 421 |
else if (corpus != null) return corpus.removeResult(this); |
|
| 414 |
if (partition != null) {
|
|
| 415 |
return partition.removeResult(this); |
|
| 416 |
} |
|
| 417 |
else if (corpus != null) {
|
|
| 418 |
return corpus.removeResult(this); |
|
| 419 |
} |
|
| 422 | 420 |
return false; |
| 423 | 421 |
} |
| 424 | 422 |
|
| ... | ... | |
| 433 | 431 |
} |
| 434 | 432 |
|
| 435 | 433 |
@Override |
| 436 |
public boolean validateParameters() {
|
|
| 434 |
public boolean canCompute() {
|
|
| 437 | 435 |
return corpus != null || partition != null; |
| 438 | 436 |
} |
| 439 | 437 |
|
| 440 | 438 |
@Override |
| 441 |
public boolean compute(IProgressMonitor watcher) throws Exception {
|
|
| 442 |
System.out.println("QueryIndex.compute() not implemented");
|
|
| 439 |
public boolean _compute() throws Exception {
|
|
| 440 |
//FIXME: not yet implemented |
|
| 441 |
System.out.println("QueryIndex.compute(): not yet implemented.");
|
|
| 443 | 442 |
return false; |
| 444 | 443 |
} |
| 445 | 444 |
|
| 446 |
@Override |
|
| 447 |
public boolean setParameters(TXMParameters parameters) {
|
|
| 448 |
return false; |
|
| 449 |
} |
|
| 450 | 445 |
} |
Formats disponibles : Unified diff