Révision 3830
TXM/trunk/bundles/org.txm.concordance.core/src/org/txm/concordance/core/messages/ConcordanceCoreMessages.java (revision 3830) | ||
---|---|---|
36 | 36 |
public static String rightContext_2; |
37 | 37 |
public static String none; |
38 | 38 |
public static String concordanceOfP0InTheP1Corpus; |
39 |
|
|
40 |
|
|
41 |
|
|
42 |
public static String CQPErrorP0; |
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
public static String NoQuery; |
|
39 | 47 |
|
40 | 48 |
|
41 | 49 |
static { |
TXM/trunk/bundles/org.txm.concordance.core/src/org/txm/concordance/core/messages/messages.properties (revision 3830) | ||
---|---|---|
3 | 3 |
compositeColon=Composite\: |
4 | 4 |
concordanceOfP0InTheP1Corpus=Concordance of {0}>in {1} corpus... |
5 | 5 |
context=Context |
6 |
CQPErrorP0=** CQP error: {0} |
|
6 | 7 |
failedToExportConcordanceColonP0=** Failed to export concordance\: {0}. |
7 | 8 |
failedToGetTextsLimitsColonP0=** Failed to retrieve texts limits\: {0}. |
8 | 9 |
failedToRetrieveTextidPropertyFromLines=** Failed to retrieve the 'text_id' property from rows |
... | ... | |
10 | 11 |
leftContext=LeftContext |
11 | 12 |
leftContext_2=Left context |
12 | 13 |
none=None |
14 |
NoQuery=<no query> |
|
13 | 15 |
reference=Reference |
14 | 16 |
references=References |
15 | 17 |
RESULT_TYPE=Concordance |
TXM/trunk/bundles/org.txm.concordance.core/src/org/txm/concordance/core/functions/Line.java (revision 3830) | ||
---|---|---|
278 | 278 |
|
279 | 279 |
@Override |
280 | 280 |
public String toString() { |
281 |
return match.toString() + "=" + keywordsViewValues; |
|
281 |
return match.toString() + "=" + keywordsViewValues; //$NON-NLS-1$
|
|
282 | 282 |
} |
283 | 283 |
|
284 | 284 |
/** |
... | ... | |
293 | 293 |
public String leftContextToString(String propertySeparator, |
294 | 294 |
String wordSeparator, int limit, LineDecorator decorator) { |
295 | 295 |
|
296 |
if (getLeftContextSize() == 0) return ""; |
|
296 |
if (getLeftContextSize() == 0) return ""; //$NON-NLS-1$
|
|
297 | 297 |
|
298 | 298 |
int currentPos = keywordpos - getLeftContextSize(); |
299 | 299 |
|
... | ... | |
307 | 307 |
for (Property property : values.keySet()) { |
308 | 308 |
List<String> ivalues = values.get(property); |
309 | 309 |
if (ivalues == null) { |
310 |
System.out.println("ERROR: null ivalues in " + values + " for property " + property); |
|
310 |
System.out.println("ERROR: null ivalues in " + values + " for property " + property); //$NON-NLS-1$ //$NON-NLS-2$
|
|
311 | 311 |
} |
312 | 312 |
else { |
313 | 313 |
word.add(ivalues.get(i)); |
... | ... | |
361 | 361 |
word.add(values.get(property).get(i)); |
362 | 362 |
|
363 | 363 |
if (currentPos == targetpos) { // highlight the @ target |
364 |
words.add("[" + StringUtils.join(word, propertySeparator) + "]"); |
|
364 |
words.add("[" + StringUtils.join(word, propertySeparator) + "]"); //$NON-NLS-1$ //$NON-NLS-2$
|
|
365 | 365 |
} |
366 | 366 |
else { |
367 | 367 |
words.add(StringUtils.join(word, propertySeparator)); |
... | ... | |
403 | 403 |
public String rightContextToString(String propertySeparator, |
404 | 404 |
String wordSeparator, int limit, LineDecorator decorator) { |
405 | 405 |
int s = getKeywordsSize(); |
406 |
if (s == 0) return ""; |
|
406 |
if (s == 0) return ""; //$NON-NLS-1$
|
|
407 | 407 |
|
408 | 408 |
List<String> words = new ArrayList<>(); |
409 | 409 |
Map<Property, List<String>> values = getRightCtxViewProperties(); |
TXM/trunk/bundles/org.txm.concordance.core/src/org/txm/concordance/core/functions/comparators/LocalizedLineComparator.java (revision 3830) | ||
---|---|---|
70 | 70 |
* @param locale the new locale |
71 | 71 |
*/ |
72 | 72 |
public void setLocale(Locale locale) { |
73 |
Log.fine("Set comparator locale to "+locale); |
|
73 |
Log.fine("Set comparator locale to "+locale); //$NON-NLS-1$
|
|
74 | 74 |
this.locale = locale; |
75 | 75 |
this.collator = Collator.getInstance(locale); |
76 | 76 |
this.collator.setStrength(Collator.TERTIARY); |
TXM/trunk/bundles/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java (revision 3830) | ||
---|---|---|
81 | 81 |
*/ |
82 | 82 |
public class Concordance extends QueryBasedTXMResult { |
83 | 83 |
|
84 |
public static final String TARGET_SELECT = "Select"; |
|
85 |
public static final String TARGET_SHOW = "Show"; |
|
86 |
public static final String TARGET_KEEPLEFT = "Keep left"; |
|
87 |
public static final String TARGET_KEEPRIGHT = "Keep right"; |
|
84 |
public static final String TARGET_SELECT = "Select"; //$NON-NLS-1$
|
|
85 |
public static final String TARGET_SHOW = "Show"; //$NON-NLS-1$
|
|
86 |
public static final String TARGET_KEEPLEFT = "Keep left"; //$NON-NLS-1$
|
|
87 |
public static final String TARGET_KEEPRIGHT = "Keep right"; //$NON-NLS-1$
|
|
88 | 88 |
|
89 | 89 |
/** The noconc. */ |
90 | 90 |
protected static int noconc = 1;; |
... | ... | |
255 | 255 |
this.availableRightSortProperties.removeAll(pAnalysisRightProperties); |
256 | 256 |
|
257 | 257 |
String refPropertyNames = this.getStringParameterValue(ConcordancePreferences.VIEW_REFERENCE_PATTERN); |
258 |
String refPropertyNames2 = this.getCorpus().getProject().getCommandPreferences("concordance").get(ConcordancePreferences.VIEW_REFERENCE_PATTERN); |
|
258 |
String refPropertyNames2 = this.getCorpus().getProject().getCommandPreferences("concordance").get(ConcordancePreferences.VIEW_REFERENCE_PATTERN); //$NON-NLS-1$
|
|
259 | 259 |
if (refPropertyNames2 != null && refPropertyNames2.length() > 0) { |
260 | 260 |
ReferencePattern ref = ReferencePattern.stringToReferencePattern(this.getCorpus(), refPropertyNames2); |
261 | 261 |
if (ref.getProperties().size() > 0) { // ensure the ref properties is well set |
262 | 262 |
refPropertyNames = refPropertyNames2; |
263 | 263 |
} |
264 | 264 |
} |
265 |
if ("*".equals(refPropertyNames)) { |
|
265 |
if ("*".equals(refPropertyNames)) { //$NON-NLS-1$
|
|
266 | 266 |
Property refProperty = this.getCorpus().getProperty("ref");//$NON-NLS-1$ |
267 | 267 |
if (refProperty == null) { |
268 | 268 |
StructuralUnitProperty sup_textid = this.getCorpus().getTextIdStructuralUnitProperty(); |
... | ... | |
277 | 277 |
} |
278 | 278 |
|
279 | 279 |
refPropertyNames = this.getStringParameterValue(ConcordancePreferences.SORT_REFERENCE_PATTERN); |
280 |
refPropertyNames2 = this.getCorpus().getProject().getCommandPreferences("concordance").get(ConcordancePreferences.SORT_REFERENCE_PATTERN); |
|
280 |
refPropertyNames2 = this.getCorpus().getProject().getCommandPreferences("concordance").get(ConcordancePreferences.SORT_REFERENCE_PATTERN); //$NON-NLS-1$
|
|
281 | 281 |
if (refPropertyNames2 != null && refPropertyNames2.length() > 0) { |
282 | 282 |
refPropertyNames = refPropertyNames2; |
283 | 283 |
} |
... | ... | |
334 | 334 |
} |
335 | 335 |
else { |
336 | 336 |
try { |
337 |
this.queryResult = pQuery.getSearchEngine().query(this.getCorpus(), pQuery, pQuery.getQueryString().replace(" ", "_") + "_concordance", true); |
|
337 |
this.queryResult = pQuery.getSearchEngine().query(this.getCorpus(), pQuery, pQuery.getQueryString().replace(" ", "_") + "_concordance", true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
|
338 | 338 |
} catch (Exception e) { |
339 | 339 |
this.nLines = 0; |
340 | 340 |
this.pTopIndex = 0; |
341 | 341 |
this.lines = new ArrayList<>(); |
342 |
Log.warning("** CQP error: "+e.getMessage());
|
|
342 |
Log.warning(ConcordanceCoreMessages.CQPErrorP0+e.getMessage());
|
|
343 | 343 |
Log.printStackTrace(e); |
344 | 344 |
return false; |
345 | 345 |
} |
... | ... | |
486 | 486 |
|
487 | 487 |
@Override |
488 | 488 |
public String[] getExportTXTExtensions() { |
489 |
return new String[] { "*.csv" }; |
|
489 |
return new String[] { "*.csv" }; //$NON-NLS-1$
|
|
490 | 490 |
} |
491 | 491 |
|
492 | 492 |
/** |
... | ... | |
635 | 635 |
// i++; |
636 | 636 |
// } |
637 | 637 |
// } else { |
638 |
Log.fine("Get CQL limit for query=" + pLimitCQL); |
|
638 |
Log.fine("Get CQL limit for query=" + pLimitCQL); //$NON-NLS-1$
|
|
639 | 639 |
CQLLimitStarts = this.getCorpus().getStartLimits(pLimitCQL); |
640 | 640 |
if (CQLLimitStarts.length > 0 && CQLLimitStarts[0] != 0) { |
641 | 641 |
int[] tmp = new int[CQLLimitStarts.length + 1]; |
... | ... | |
1006 | 1006 |
@Override |
1007 | 1007 |
public String getComputingStartMessage() { |
1008 | 1008 |
if (this.pQuery == null) { |
1009 |
return TXMCoreMessages.bind(ConcordanceCoreMessages.concordanceOfP0InTheP1Corpus, "<none>", this.getCorpus());
|
|
1009 |
return TXMCoreMessages.bind(ConcordanceCoreMessages.concordanceOfP0InTheP1Corpus, ConcordanceCoreMessages.NoQuery, this.getCorpus());
|
|
1010 | 1010 |
} |
1011 | 1011 |
else { |
1012 | 1012 |
return TXMCoreMessages.bind(ConcordanceCoreMessages.concordanceOfP0InTheP1Corpus, this.pQuery.asString(), this.getCorpus()); |
... | ... | |
1055 | 1055 |
} |
1056 | 1056 |
} |
1057 | 1057 |
catch (Exception e) { |
1058 |
System.out.println("Error: " + e); |
|
1058 |
System.out.println("Error: " + e); //$NON-NLS-1$
|
|
1059 | 1059 |
Log.printStackTrace(e); |
1060 | 1060 |
} |
1061 | 1061 |
|
... | ... | |
1613 | 1613 |
String keyColSeparator = colseparator; // the separator is "" if export in CONTEXT mode |
1614 | 1614 |
// write header and set keywordColumnSeparator |
1615 | 1615 |
if (format == Format.CONTEXT) { |
1616 |
keyColSeparator = ""; |
|
1616 |
keyColSeparator = ""; //$NON-NLS-1$
|
|
1617 | 1617 |
writer.write( |
1618 | 1618 |
txtseparator + ConcordanceCoreMessages.reference + txtseparator |
1619 | 1619 |
+ colseparator + txtseparator + ConcordanceCoreMessages.context + txtseparator |
TXM/trunk/bundles/org.txm.concordance.core/src/org/txm/concordance/core/r/ConcordanceRTransformer.java (revision 3830) | ||
---|---|---|
62 | 62 |
//+ ", query=\""+conc.query.getQueryString()+"\"" |
63 | 63 |
+ ")"); //$NON-NLS-1$ |
64 | 64 |
|
65 |
rw.eval("rm(concrefs, conclefts, conckeywords, concrights)"); |
|
65 |
rw.eval("rm(concrefs, conclefts, conckeywords, concrights)"); //$NON-NLS-1$
|
|
66 | 66 |
return symbol; |
67 | 67 |
} |
68 | 68 |
|
TXM/trunk/bundles/org.txm.concordance.core/src/org/txm/concordance/core/tests/TestConcordance.java (revision 3830) | ||
---|---|---|
62 | 62 |
if (subcorpusname != null) { |
63 | 63 |
corpus = corpus.getSubcorpusByName(subcorpusname); |
64 | 64 |
} |
65 |
CQLQuery query = new CQLQuery(CQLQuery.fixQuery(queryString, "fr")); |
|
65 |
CQLQuery query = new CQLQuery(CQLQuery.fixQuery(queryString, "fr")); //$NON-NLS-1$
|
|
66 | 66 |
|
67 | 67 |
List<WordProperty> leftCSortProperties = new ArrayList<>(); |
68 | 68 |
for (String p : leftCSortPropertiesString) |
Formats disponibles : Unified diff