Révision 2102
tmp/org.txm.tigersearch.rcp/src/org/txm/searchengine/ts/TIGERSearchEngine.java (revision 2102) | ||
---|---|---|
1 | 1 |
package org.txm.searchengine.ts; |
2 | 2 |
|
3 | 3 |
import java.io.File; |
4 |
import java.lang.reflect.Field; |
|
5 | 4 |
import java.util.ArrayList; |
6 | 5 |
import java.util.LinkedHashSet; |
7 | 6 |
import java.util.List; |
8 | 7 |
|
9 | 8 |
import org.eclipse.core.runtime.IProgressMonitor; |
10 | 9 |
import org.txm.core.results.TXMResult; |
11 |
import org.txm.function.tigersearch.TIGERSearch; |
|
12 | 10 |
import org.txm.objects.CorpusBuild; |
13 | 11 |
import org.txm.objects.Match; |
14 | 12 |
import org.txm.objects.Project; |
... | ... | |
20 | 18 |
import org.txm.searchengine.cqp.corpus.MainCorpus; |
21 | 19 |
import org.txm.utils.DeleteDir; |
22 | 20 |
|
23 |
import cern.colt.Arrays; |
|
24 |
import ims.tiger.corpus.Sentence; |
|
25 |
import ims.tiger.gui.tigergraphviewer.draw.Display_Sentence; |
|
26 |
import ims.tiger.gui.tigergraphviewer.forest.ResultForest; |
|
27 | 21 |
import ims.tiger.index.reader.Index; |
28 |
import ims.tiger.index.reader.structure.CorpusFeatures; |
|
29 |
import ims.tiger.index.reader.structure.SentenceIndex; |
|
30 | 22 |
import ims.tiger.query.api.MatchResult; |
31 |
import ims.tiger.query.internalapi.InternalCorpusQueryManager; |
|
32 | 23 |
import ims.tiger.query.processor.CorpusQueryProcessor; |
33 | 24 |
|
34 | 25 |
public class TIGERSearchEngine extends SearchEngine { |
... | ... | |
89 | 80 |
} |
90 | 81 |
|
91 | 82 |
LinkedHashSet<TIGERMatch> tigerMatchesList = new LinkedHashSet<TIGERMatch>(); |
83 |
|
|
84 |
List<String> variables = java.util.Arrays.asList(mresult.getVariableNames()); |
|
85 |
//System.out.println("Variables: "+variables+" iPivot="+variables.indexOf("pivot")); |
|
86 |
int iPivot = variables.indexOf("pivot"); |
|
87 |
|
|
92 | 88 |
//System.out.println("submatchSize: "+subsize); |
93 | 89 |
for (int imatch = 0 ; imatch < size; imatch++) { // the matching sentences |
94 | 90 |
int sent = mresult.getSentenceNumberAt(imatch); |
... | ... | |
96 | 92 |
|
97 | 93 |
//System.out.println(" sent: "+sent); |
98 | 94 |
int sent_submatch = mresult.getSentenceSubmatchSize(sent); |
95 |
|
|
96 |
|
|
99 | 97 |
//System.out.println(" sent submatch size: "+sent_submatch); |
100 | 98 |
for (int isubmatch = 0 ; isubmatch < sent_submatch ; isubmatch++) { // the matches in the sentence |
101 | 99 |
int[] match = mresult.getSentenceSubmatchAt(sent, isubmatch); |
102 | 100 |
|
103 | 101 |
int sent_start = starts[sent]; |
104 | 102 |
|
105 |
//System.out.println(" sent="+sent_start+ " matches="+Arrays.toString(match));
|
|
103 |
// System.out.println(" sent="+sent_start+ " matches="+Arrays.toString(match)+" ipivot="+iPivot);
|
|
106 | 104 |
for (int i = 0 ; i < match.length ; i++) { |
105 |
|
|
106 |
if (iPivot != -1 && i != iPivot) continue; // skip match that are not 'pivot' |
|
107 |
|
|
107 | 108 |
int left = index.getLeftCorner(sent, match[i]); |
108 | 109 |
int right = index.getRightCorner(sent, match[i]); |
109 | 110 |
//System.out.println(" M="+match[i]+" ("+left+", "+right+")"); |
Formats disponibles : Unified diff