Révision 2511
| tmp/org.txm.properties.core/src/org/txm/properties/core/functions/CorpusPropertiesComputer.java (revision 2511) | ||
|---|---|---|
| 25 | 25 |
import org.txm.searchengine.cqp.corpus.StructuralUnit; |
| 26 | 26 |
import org.txm.searchengine.cqp.corpus.StructuralUnitProperty; |
| 27 | 27 |
import org.txm.searchengine.cqp.corpus.WordProperty; |
| 28 |
import org.txm.searchengine.cqp.corpus.query.Match; |
|
| 28 | 29 |
import org.txm.utils.logger.Log; |
| 29 | 30 |
|
| 30 | 31 |
public class CorpusPropertiesComputer extends PropertiesComputer<CQPCorpus> {
|
| ... | ... | |
| 140 | 141 |
propertiesValues.clear(); |
| 141 | 142 |
|
| 142 | 143 |
AbstractCqiClient cqiClient = CorpusManager.getCorpusManager().getCqiClient(); |
| 144 |
|
|
| 145 |
int s = Math.min(props.pMaxPropertiesToDisplay, numberOfWords); |
|
| 146 |
int[] positions = new int[s]; |
|
| 147 |
int n = 0; |
|
| 148 |
List<Match> matches = result.getMatches(); |
|
| 149 |
for (Match m : matches) {
|
|
| 150 |
if (n >= s) break; |
|
| 151 |
for (int i = m.getStart(); i < m.getEnd(); i++) {
|
|
| 152 |
if (n >= s) break; |
|
| 153 |
positions[n++] = i; |
|
| 154 |
} |
|
| 155 |
} |
|
| 156 |
|
|
| 143 | 157 |
for (Property p : properties) {
|
| 144 | 158 |
// int size; |
| 145 | 159 |
try {
|
| 146 |
// size = |
|
| 147 |
// CorpusManager.getCorpusManager().getCqiClient().lexiconSize(p.getQualifiedName()); |
|
| 148 |
// propertiesCounts.put(p.getName(), size); |
|
| 149 |
// List<String> list = |
|
| 150 |
// Arrays.asList(corpus.getLexicon(p).getForms(this.maxvalue)); |
|
| 151 |
|
|
| 152 |
int[] positions = new int[Math.min(props.pMaxPropertiesToDisplay, numberOfWords)]; |
|
| 153 |
for (int i = 0; i < Math.min(props.pMaxPropertiesToDisplay, numberOfWords); i++) {
|
|
| 154 |
positions[i] = i; |
|
| 155 |
} |
|
| 156 |
|
|
| 157 |
// ArrayList<String> values = new ArrayList<String>(); |
|
| 158 | 160 |
LinkedHashSet<String> values = new LinkedHashSet<>(cqiClient.getSingleData(p, positions)); |
| 159 | 161 |
propertiesValues.put(p.getName(), new ArrayList<>(values)); |
| 160 | 162 |
} |
Formats disponibles : Unified diff