Révision 3170
tmp/org.txm.core/src/java/org/txm/importer/ApplyXsl2.java (revision 3170) | ||
---|---|---|
56 | 56 |
import java.io.FileWriter; |
57 | 57 |
import java.io.IOException; |
58 | 58 |
import java.io.StringWriter; |
59 |
import java.util.ArrayList; |
|
60 | 59 |
import java.util.Arrays; |
61 | 60 |
import java.util.HashMap; |
62 | 61 |
import java.util.List; |
63 | 62 |
import java.util.logging.Level; |
64 | 63 |
|
65 |
import javax.xml.transform.Source; |
|
66 | 64 |
import javax.xml.transform.Transformer; |
67 | 65 |
import javax.xml.transform.TransformerConfigurationException; |
68 | 66 |
import javax.xml.transform.TransformerException; |
69 |
import javax.xml.transform.URIResolver; |
|
70 | 67 |
import javax.xml.transform.stream.StreamResult; |
71 | 68 |
import javax.xml.transform.stream.StreamSource; |
72 | 69 |
|
73 |
import net.sf.saxon.TransformerFactoryImpl; |
|
74 |
|
|
75 | 70 |
import org.eclipse.osgi.util.NLS; |
76 | 71 |
import org.txm.utils.ConsoleProgressBar; |
77 |
import org.txm.utils.Diff; |
|
78 | 72 |
import org.txm.utils.io.FileCopy; |
79 | 73 |
import org.txm.utils.io.IOUtils; |
80 | 74 |
import org.txm.utils.logger.Log; |
81 | 75 |
import org.txm.utils.saxon.SaxonNodeSet; |
82 | 76 |
|
77 |
import net.sf.saxon.TransformerFactoryImpl; |
|
78 |
|
|
83 | 79 |
// TODO: Auto-generated Javadoc |
84 | 80 |
/** |
85 | 81 |
* apply a xsl file to a file : use process(File infile, File outfile, String[] |
... | ... | |
589 | 585 |
* @throws FileNotFoundException |
590 | 586 |
*/ |
591 | 587 |
public static void main(String[] args) throws Exception { |
592 |
// String xslfile = "/home/mdecorde/TXM/xsl/breakByMilestone.xsl"; |
|
593 |
String xslfile = "G:/Feuilles de style/filtre-frantext-query-export4txm.xsl"; |
|
594 |
File xslFile = new File(xslfile); |
|
595 |
ApplyXsl2 a = new ApplyXsl2(xslFile); |
|
588 |
File xslfile = new File(System.getProperty("user.home"), "xml/xsltest/test.xsl"); |
|
589 |
assert(xslfile.exists()); |
|
590 |
ApplyXsl2 a = new ApplyXsl2(xslfile); |
|
596 | 591 |
|
597 |
// File srcdirectory = new File("/home/mdecorde/TXM/corpora/transcribertest/HTML"); |
|
598 |
File srcdirectory = new File("C:/Documents and Settings/alavrent/xml/applyxsl"); |
|
599 |
assert (srcdirectory.exists()); |
|
600 |
assert (srcdirectory.isDirectory()); |
|
601 |
assert (srcdirectory.canRead()); |
|
602 |
assert (srcdirectory.canExecute()); |
|
592 |
File srcdirectory = new File(System.getProperty("user.home"), "xml/xsltest"); |
|
593 |
assert(srcdirectory.exists()); |
|
594 |
assert(srcdirectory.isDirectory()); |
|
595 |
assert(srcdirectory.canRead()); |
|
596 |
assert(srcdirectory.canExecute()); |
|
603 | 597 |
|
604 | 598 |
File[] files = srcdirectory.listFiles(IOUtils.HIDDENFILE_FILTER); |
605 |
System.out.println("process : " + srcdirectory + "/*"); |
|
606 |
System.out.println("with : " + xslfile); |
|
599 |
|
|
600 |
// files = files.findAll{item-> item.getName().endsWith(".xml")}; |
|
601 |
|
|
607 | 602 |
long bigstart = System.currentTimeMillis(); |
608 | 603 |
for (File infile : files) { |
609 |
if (infile.canRead() && infile.getName().endsWith(".xml")) { |
|
610 |
File outfile = new File(infile.getAbsolutePath() + ".out.xml"); |
|
604 |
if (!(infile.getName().toLowerCase().endsWith(".xml"))) continue; |
|
605 |
|
|
606 |
File outfile = new File(infile.getAbsolutePath()+".out"); |
|
607 |
if (infile.canRead()) { |
|
611 | 608 |
long start = System.currentTimeMillis(); |
612 |
System.out.println("Process : " + infile.getName() + " >> ");
|
|
613 |
// String[] params = {"pbval1",""+1,"pbval2",""+2};
|
|
609 |
System.out.println("Process : "+infile.getName());
|
|
610 |
// String[] params = ["pbval1",1,"pbval2",2];
|
|
614 | 611 |
a.process(infile, outfile); // no parameters |
615 |
// a.process( infile.getAbsolutePath() ,outfile,params);
|
|
616 |
System.out.println("Done : " + (System.currentTimeMillis() - start) + "ms");
|
|
612 |
// a.process( infile.getAbsolutePath(),outfile,params); |
|
613 |
System.out.println("Done : "+(System.currentTimeMillis()-start)+"ms");
|
|
617 | 614 |
} |
618 | 615 |
} |
619 |
System.out.println("Total time : " + (System.currentTimeMillis() - bigstart) + "ms");
|
|
616 |
System.out.println("Total time : "+(System.currentTimeMillis()-bigstart)+"ms");
|
|
620 | 617 |
} |
621 | 618 |
} |
tmp/org.txm.core/src/java/org/txm/importer/xtz/ImportModule.java (revision 3170) | ||
---|---|---|
135 | 135 |
else { |
136 | 136 |
System.out.println("XML-TXM files already produced in " + new File(binaryDirectory, "txm/" + corpusName)); |
137 | 137 |
} |
138 |
if (monitor != null) { monitor.worked(25); } |
|
138 | 139 |
} |
139 | 140 |
|
140 | 141 |
// update existing Text file pointers |
... | ... | |
197 | 198 |
// System.out.println("XML-TXM files already annotated."); |
198 | 199 |
} |
199 | 200 |
} |
201 |
if (monitor != null) { monitor.worked(25); } |
|
200 | 202 |
|
201 | 203 |
|
202 |
|
|
203 | 204 |
Thread Tcompiler = new Thread("XTZ Compiler - " + project.getSrcdir().getName()) { |
204 | 205 |
|
205 | 206 |
@Override |
... | ... | |
218 | 219 |
else { |
219 | 220 |
System.out.println("No CQP index created."); |
220 | 221 |
} |
222 |
if (monitor != null) { monitor.worked(25); } |
|
221 | 223 |
} |
222 | 224 |
}; |
223 | 225 |
|
... | ... | |
236 | 238 |
System.out.println("Error while importing corpus during 'pager' step, reason=" + pager.getReason()); |
237 | 239 |
return; |
238 | 240 |
} |
241 |
|
|
239 | 242 |
} |
240 | 243 |
else { |
241 | 244 |
System.out.println("No edition produced."); |
242 | 245 |
} |
246 |
if (monitor != null) { monitor.worked(25); } |
|
243 | 247 |
} |
244 | 248 |
}; |
245 | 249 |
|
tmp/org.txm.core/src/java/org/txm/importer/xtz/ImportStep.java (revision 3170) | ||
---|---|---|
28 | 28 |
protected boolean stopAtFirstError = true; |
29 | 29 |
|
30 | 30 |
protected boolean debug = true; |
31 |
|
|
31 |
|
|
32 | 32 |
public ImportStep(ImportModule module) { |
33 | 33 |
this.module = module; |
34 | 34 |
this.project = module.getProject(); |
35 |
debug = module.debug; |
|
35 |
this.debug = module.debug; |
|
36 |
//TODO split a SubMonitor like in the TXMResult.compute() but only when the ImportStep is starting |
|
36 | 37 |
} |
37 | 38 |
|
38 | 39 |
public File getInputDirectory() { |
tmp/org.txm.core/src/java/org/txm/importer/scripts/xmltxm/Xml2Ana.groovy (revision 3170) | ||
---|---|---|
27 | 27 |
// |
28 | 28 |
package org.txm.importer.scripts.xmltxm |
29 | 29 |
|
30 |
import org.txm.importer.StaxIdentityParser; |
|
31 |
|
|
32 |
import java.text.DateFormat; |
|
33 |
import java.util.ArrayList; |
|
34 |
import java.util.Date; |
|
35 |
import java.util.HashMap; |
|
36 |
import java.util.Locale; |
|
37 |
|
|
38 | 30 |
import javax.xml.stream.*; |
39 | 31 |
|
40 |
import java.net.URL; |
|
41 |
|
|
42 |
import org.txm.importer.filters.*; |
|
32 |
import org.txm.importer.StaxIdentityParser; |
|
43 | 33 |
import org.txm.scripts.importer.HasElement |
44 |
import org.txm.scripts.importer.StaxStackWriter |
|
45 | 34 |
import org.txm.utils.AsciiUtils; |
46 | 35 |
|
47 | 36 |
/** |
... | ... | |
54 | 43 |
* you must specify the correspondance between word attributs and ana types&respStmtIDs |
55 | 44 |
* then the attributes of w tags will be transformed into interp tag |
56 | 45 |
*/ |
57 |
class Xml2Ana extends StaxIdentityParser |
|
58 |
{ |
|
46 |
class Xml2Ana extends StaxIdentityParser { |
|
59 | 47 |
/** The dir. */ |
60 | 48 |
private def dir; |
61 | 49 |
|
... | ... | |
94 | 82 |
public static final String TEXT = "text" |
95 | 83 |
public static final String ID = "id" |
96 | 84 |
|
85 |
public ArrayList<String> missingWordsIDS = new ArrayList<String>(); |
|
86 |
|
|
97 | 87 |
/** |
98 |
* Instantiates a new xml2 ana.
|
|
88 |
* Instantiates a new XML2Ana processor.
|
|
99 | 89 |
* |
100 |
* @param url the url
|
|
101 |
* @param wordprefix the wordprefix
|
|
90 |
* @param file input File
|
|
91 |
* |
|
102 | 92 |
*/ |
103 | 93 |
public Xml2Ana(File file) { |
104 | 94 |
super(file.toURI().toURL()); |
105 | 95 |
//File file = new File(url.getFile()).getAbsoluteFile() |
106 | 96 |
textname = file.getName(); |
107 | 97 |
int idx = textname.lastIndexOf("."); |
108 |
if (idx > 0) |
|
98 |
if (idx > 0) {
|
|
109 | 99 |
textname = textname.substring(0, idx) |
100 |
} |
|
110 | 101 |
|
111 |
|
|
112 | 102 |
checkTags.put("respStmt",false); |
113 | 103 |
checkTags.put("titleStmt",false); |
114 | 104 |
checkTags.put("appInfo",false); |
... | ... | |
144 | 134 |
boolean hasText = false; |
145 | 135 |
boolean textElementAdded = false; |
146 | 136 |
def anabalises = []; |
147 |
protected void processStartElement() |
|
148 |
{ |
|
137 |
protected void processStartElement() { |
|
149 | 138 |
// println "checkTags=$checkTags"; |
150 | 139 |
// println "parser=$parser"; |
151 | 140 |
firstElement++; |
... | ... | |
167 | 156 |
|
168 | 157 |
writer.writeStartElement(parser.getLocalName()); // write w |
169 | 158 |
|
170 |
for (int i = 0 ; i < parser.getNamespaceCount() ; i++) // write namespaces |
|
159 |
for (int i = 0 ; i < parser.getNamespaceCount() ; i++) { // write namespaces
|
|
171 | 160 |
writer.writeNamespace(parser.getNamespacePrefix(i), parser.getNamespaceURI(i)); |
172 |
|
|
161 |
} |
|
162 |
|
|
173 | 163 |
for (int i= 0 ; i < parser.getAttributeCount() ;i++ ) { // transform attributes |
174 | 164 |
String type = parser.getAttributeLocalName(i); |
175 | 165 |
String value = parser.getAttributeValue(i); |
... | ... | |
184 | 174 |
} else if (type == ID) { // keep id attribute |
185 | 175 |
String wordid = value |
186 | 176 |
if (wordid.startsWith("w")) { |
187 |
if (!wordid.startsWith("w_")) |
|
177 |
if (!wordid.startsWith("w_")) {
|
|
188 | 178 |
wordid = "w_"+wordid.substring(1) |
179 |
} |
|
189 | 180 |
} |
190 | 181 |
// else { |
191 | 182 |
// wordid = "w_"+textname+"_"+wordid; |
192 | 183 |
// } |
193 | 184 |
|
194 | 185 |
wordid = AsciiUtils.buildWordId(wordid); // remove characters not compatible with the id attribute value |
195 |
|
|
186 |
if (wordid.length() == 0) { |
|
187 |
Location loc = parser.getLocation(); |
|
188 |
missingWordsIDS.add("["+loc.lineNumber+", "+loc.columnNumber+"]"); |
|
189 |
} |
|
196 | 190 |
writer.writeAttribute(type, wordid); |
197 | 191 |
|
198 | 192 |
} else { // add attributes that was in the original <w> |
199 |
if (convertAllAttributes) |
|
193 |
if (convertAllAttributes) {
|
|
200 | 194 |
anabalises.add(["#src", "#"+type, value]) |
201 |
else
|
|
195 |
} else {
|
|
202 | 196 |
writer.writeAttribute(type, value); |
197 |
} |
|
203 | 198 |
} |
204 | 199 |
} |
205 | 200 |
|
... | ... | |
212 | 207 |
boolean hasTeiNS = false; |
213 | 208 |
boolean hasTXMNs = false; |
214 | 209 |
for (int i = 0 ; i < parser.getNamespaceCount() ; i++) { |
215 |
if (parser.getNamespaceURI(i) == TXMNS) |
|
210 |
if (parser.getNamespaceURI(i) == TXMNS) {
|
|
216 | 211 |
hasTXMNs = true; |
217 |
else if (parser.getNamespaceURI(i) == TEINS)
|
|
212 |
} else if (parser.getNamespaceURI(i) == TEINS) {
|
|
218 | 213 |
hasTeiNS = true; |
214 |
} |
|
219 | 215 |
} |
220 | 216 |
if (!hasTeiNS) { |
221 | 217 |
writer.writeDefaultNamespace(TEINS); |
222 | 218 |
} |
223 |
if (!hasTXMNs) |
|
219 |
if (!hasTXMNs) {
|
|
224 | 220 |
writer.writeNamespace(TXM, TXMNS); |
221 |
} |
|
225 | 222 |
break; |
226 | 223 |
|
227 | 224 |
default: |
... | ... | |
275 | 272 |
super.after(); // close writer, parser, etc |
276 | 273 |
} |
277 | 274 |
|
278 |
protected void addTEIElement() |
|
279 |
{ |
|
275 |
protected void addTEIElement() { |
|
280 | 276 |
writer.writeStartElement("TEI"); |
281 | 277 |
writer.writeDefaultNamespace(TEINS); |
282 | 278 |
writer.writeNamespace(TXM, TXMNS); |
... | ... | |
284 | 280 |
writeTeiHeader(); |
285 | 281 |
} |
286 | 282 |
|
287 |
protected void processCharacters() |
|
288 |
{ |
|
283 |
protected void processCharacters() { |
|
289 | 284 |
if (flagWord) { |
290 | 285 |
writer.writeCharacters(parser.getText().trim()); // keep form in 1 line |
291 | 286 |
} else { |
... | ... | |
301 | 296 |
public static String ANA = "ana" |
302 | 297 |
public static String RESP = "resp" |
303 | 298 |
public static String TYPE = "type" |
304 |
protected void processEndElement() |
|
305 |
{ |
|
299 |
protected void processEndElement() { |
|
306 | 300 |
switch (parser.getLocalName()) { |
307 | 301 |
case wtag: |
308 | 302 |
writer.writeEndElement(); // txm:form |
309 |
for (def values : anabalises) |
|
310 |
{// <txm:ana resp=ref type=corresptype>value</txm:ana> |
|
303 |
for (def values : anabalises) { // <txm:ana resp=ref type=corresptype>value</txm:ana> |
|
311 | 304 |
writer.writeStartElement(TXMNS, ANA); |
312 | 305 |
writer.writeAttribute(RESP, values[0]); |
313 | 306 |
writer.writeAttribute(TYPE, values[1]); |
... | ... | |
352 | 345 |
super.processEndElement(); |
353 | 346 |
} |
354 | 347 |
|
355 |
protected void writeTeiHeader() |
|
356 |
{ |
|
348 |
protected void writeTeiHeader() {
|
|
349 |
|
|
357 | 350 |
writer.writeStartElement("teiHeader"); |
358 | 351 |
writer.writeStartElement("fileDesc") |
359 | 352 |
this.writeTXMResps(); |
... | ... | |
372 | 365 |
writer.writeEndElement(); // teiHeader |
373 | 366 |
} |
374 | 367 |
|
375 |
protected void writeContentOfEncodingDesc() |
|
376 |
{ |
|
368 |
protected void writeContentOfEncodingDesc() {
|
|
369 |
|
|
377 | 370 |
writer.writeStartElement("appInfo") |
378 | 371 |
this.writeTXMApps(); |
379 | 372 |
writer.writeEndElement(); // appInfo |
... | ... | |
389 | 382 |
* |
390 | 383 |
* @return the string |
391 | 384 |
*/ |
392 |
public String checkResp() |
|
393 |
{ |
|
385 |
public String checkResp() {
|
|
386 |
|
|
394 | 387 |
String rez ="found tags : \n"; |
395 |
for (String key : checkTags.keySet()) |
|
388 |
for (String key : checkTags.keySet()) {
|
|
396 | 389 |
rez += "\t"+key+"\n"; |
390 |
} |
|
397 | 391 |
return rez; |
398 | 392 |
} |
399 | 393 |
|
... | ... | |
403 | 397 |
* @param correspRef the corresp ref |
404 | 398 |
* @param correspType the corresp type |
405 | 399 |
*/ |
406 |
public void setCorrespondances(correspRef, correspType) |
|
407 |
{ |
|
400 |
public void setCorrespondances(correspRef, correspType) {
|
|
401 |
|
|
408 | 402 |
this.correspRef = correspRef; |
409 | 403 |
this.correspType = correspType; |
410 | 404 |
} |
... | ... | |
418 | 412 |
* @param taxonomies the taxonomies |
419 | 413 |
* @param items the items |
420 | 414 |
*/ |
421 |
public void setHeaderInfos(respId,resps, applications, taxonomies, items) |
|
422 |
{ |
|
415 |
public void setHeaderInfos(respId,resps, applications, taxonomies, items) {
|
|
416 |
|
|
423 | 417 |
this.respId = respId |
424 | 418 |
this.resps = resps |
425 | 419 |
this.applications = applications |
... | ... | |
430 | 424 |
/** |
431 | 425 |
* Write txm resps. |
432 | 426 |
*/ |
433 |
public void writeTXMResps() |
|
434 |
{ |
|
427 |
public void writeTXMResps() {
|
|
428 |
|
|
435 | 429 |
for (String ref : respId) { |
430 |
|
|
436 | 431 |
String[] infos = resps.get(ref); |
437 | 432 |
writer.writeStartElement("respStmt"); |
438 | 433 |
writer.writeStartElement(RESP); |
... | ... | |
454 | 449 |
/** |
455 | 450 |
* Write txm apps. |
456 | 451 |
*/ |
457 |
public void writeTXMApps() |
|
458 |
{ |
|
452 |
public void writeTXMApps() {
|
|
453 |
|
|
459 | 454 |
for (String ref : respId) { |
460 | 455 |
List<String> list= applications.get(ref); |
461 | 456 |
String ident = list.get(0); |
... | ... | |
497 | 492 |
/** |
498 | 493 |
* Write txm taxonomies. |
499 | 494 |
*/ |
500 |
public void writeTXMTaxonomies() |
|
501 |
{ |
|
495 |
public void writeTXMTaxonomies() {
|
|
496 |
|
|
502 | 497 |
for (String tax : items.keySet()) { |
503 | 498 |
writer.writeStartElement("taxonomy"); |
504 | 499 |
writer.writeAttribute(ID, tax); |
... | ... | |
519 | 514 |
} |
520 | 515 |
} |
521 | 516 |
|
517 |
public ArrayList<String> getMissingWordIDS() { |
|
518 |
return missingWordIDS; |
|
519 |
} |
|
520 |
|
|
522 | 521 |
/** |
523 | 522 |
* The main method. |
524 | 523 |
* |
tmp/org.txm.core/src/java/org/txm/scripts/importer/ApplyXsl.groovy (revision 3170) | ||
---|---|---|
213 | 213 |
*/ |
214 | 214 |
public static void main(String[] args) |
215 | 215 |
{ |
216 |
String xslfile = "pathtoxslfile"; |
|
216 |
File xslfile = new File(System.getProperty("user.home"), "xml/xsltest/test.xsl") |
|
217 |
assert(xslfile.exists()) |
|
217 | 218 |
ApplyXsl a = new ApplyXsl(xslfile); |
218 | 219 |
|
219 |
File srcdirectory = new File("pathtodirectorytoprocess")
|
|
220 |
File srcdirectory = new File(System.getProperty("user.home"), "xml/xsltest")
|
|
220 | 221 |
assert(srcdirectory.exists()) |
221 | 222 |
assert(srcdirectory.isDirectory()) |
222 | 223 |
assert(srcdirectory.canRead()) |
... | ... | |
227 | 228 |
files = files.findAll{item-> item.getName().endsWith(".xml")} |
228 | 229 |
|
229 | 230 |
long bigstart = System.currentTimeMillis() |
230 |
for(File infile : files) |
|
231 |
{ |
|
231 |
for (File infile : files) { |
|
232 | 232 |
String outfile = infile.getAbsolutePath()+".out" |
233 |
if(infile.canRead()) |
|
234 |
{ |
|
233 |
if (infile.canRead()) { |
|
235 | 234 |
long start = System.currentTimeMillis() |
236 | 235 |
println "Process : "+infile.getName() |
237 | 236 |
// String[] params = ["pbval1",1,"pbval2",2]; |
tmp/org.txm.core/src/java/org/txm/core/preferences/TBXPreferences.java (revision 3170) | ||
---|---|---|
200 | 200 |
|
201 | 201 |
// FIXME |
202 | 202 |
preferences.putBoolean(TBXPreferences.ADD_TECH_LOGS, true); |
203 |
preferences.putBoolean(TBXPreferences.LOG_STACKTRACE, true);
|
|
203 |
preferences.putBoolean(TBXPreferences.LOG_STACKTRACE, false);
|
|
204 | 204 |
preferences.putBoolean(TBXPreferences.LOG_IN_FILE, false); |
205 | 205 |
preferences.put(TBXPreferences.LOG_LEVEL, "INFO"); //$NON-NLS-1$ |
206 | 206 |
|
tmp/org.txm.core/src/java/org/txm/objects/Edition.java (revision 3170) | ||
---|---|---|
285 | 285 |
*/ |
286 | 286 |
public Page getPage(int n) { |
287 | 287 |
if (n >= 0 && pPageNames.size() > n) { |
288 |
return new Page(this, pPageNames.get(n), pPageFirstWordIds.get(n), n); |
|
288 |
String wId = "w_0"; // default word id |
|
289 |
if (pPageFirstWordIds.size() > n) { |
|
290 |
wId = pPageFirstWordIds.get(n); |
|
291 |
} |
|
292 |
return new Page(this, pPageNames.get(n), wId, n); |
|
289 | 293 |
} |
290 | 294 |
else { |
291 | 295 |
return null; |
tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/toolbar/UnitToolbar.java (revision 3170) | ||
---|---|---|
314 | 314 |
|
315 | 315 |
boolean dblClick = false; |
316 | 316 |
|
317 |
boolean debug = false;
|
|
317 |
boolean debug = Log.isLoggingFineLevel();
|
|
318 | 318 |
|
319 | 319 |
private int t, x, y; |
320 | 320 |
|
... | ... | |
670 | 670 |
*/ |
671 | 671 |
protected void highlightType() { |
672 | 672 |
if (unites == null) return; |
673 |
if (editor.getEditionPanels().size() == 0) return; |
|
673 | 674 |
|
674 | 675 |
try { |
675 | 676 |
Page page = editor.getEditionPanel(0).getCurrentPage(); |
676 | 677 |
Edition e = page.getEdition(); |
677 | 678 |
Page next = e.getNextPage(page); |
678 |
String id = page.getWordId();
|
|
679 |
if (id == null || id.length() == 0) return;
|
|
679 |
String currentPageWordID = page.getWordId();
|
|
680 |
if (currentPageWordID == null || currentPageWordID.length() == 0) return;
|
|
680 | 681 |
|
681 | 682 |
String qid = maincorpus.getProperty("id").getQualifiedName(); |
682 |
int first_ids[] = CQPSearchEngine.getCqiClient().str2Id(qid, new String[] { id });
|
|
683 |
int first_ids[] = CQPSearchEngine.getCqiClient().str2Id(qid, new String[] { currentPageWordID });
|
|
683 | 684 |
|
684 | 685 |
if (first_ids.length == 0) return; |
686 |
|
|
685 | 687 |
int first_id = first_ids[0]; |
686 |
if (first_id == -1) return;
|
|
688 |
if (first_id < 0) return;
|
|
687 | 689 |
|
688 | 690 |
int last_ids[] = null; |
689 | 691 |
if (next != null && next != page) { |
690 |
String next_id = next.getWordId();
|
|
691 |
last_ids = CQPSearchEngine.getCqiClient().str2Id(qid, new String[] { next_id });
|
|
692 |
String nextPageWordID = next.getWordId();
|
|
693 |
last_ids = CQPSearchEngine.getCqiClient().str2Id(qid, new String[] { nextPageWordID });
|
|
692 | 694 |
} |
693 | 695 |
|
694 | 696 |
int first_pos = CQPSearchEngine.getCqiClient().id2Cpos(qid, first_id)[0]; |
... | ... | |
697 | 699 |
last_pos = CQPSearchEngine.getCqiClient().id2Cpos(qid, last_ids[0])[0]; |
698 | 700 |
} |
699 | 701 |
|
700 |
int n2 = 0; |
|
702 |
int n2 = 0; // first loop to determine the allpositions array length
|
|
701 | 703 |
for (int i = 0; i < unites.length; i++) { |
702 | 704 |
for (int p = unites[i].getDeb(); p <= unites[i].getFin(); p++) { |
703 | 705 |
if (p >= first_pos && p <= last_pos) { |
... | ... | |
832 | 834 |
// drop_b.setEnabled(true); |
833 | 835 |
// updatePropertiesView(unite, true); |
834 | 836 |
setFocusInPropertiesView(); |
835 |
this.extension.getSaveButton().setEnabled(true); |
|
836 |
editor.fireIsDirty(); |
|
837 |
fireIsDirty(); |
|
837 | 838 |
} |
838 | 839 |
|
839 | 840 |
if (e != null) editor.updateWordStyles(); |
... | ... | |
861 | 862 |
if (i > 0) { |
862 | 863 |
highlightType(); |
863 | 864 |
} |
864 |
this.extension.getSaveButton().setEnabled(true); |
|
865 |
editor.fireIsDirty(); |
|
865 |
fireIsDirty(); |
|
866 | 866 |
|
867 | 867 |
if (e != null) editor.updateWordStyles(); |
868 | 868 |
} |
... | ... | |
901 | 901 |
fixingAnnotationLimits = mode; |
902 | 902 |
} |
903 | 903 |
} |
904 |
this.extension.getSaveButton().setEnabled(true); |
|
905 |
editor.fireIsDirty(); |
|
904 |
fireIsDirty(); |
|
906 | 905 |
if (e != null) editor.updateWordStyles(); |
907 | 906 |
} |
908 | 907 |
|
tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/toolbar/URSAnnotationToolbar.java (revision 3170) | ||
---|---|---|
329 | 329 |
|
330 | 330 |
public void fireIsDirty() { |
331 | 331 |
editor.fireIsDirty(); |
332 |
this.extension.getSaveButton().setEnabled(true); |
|
332 | 333 |
} |
333 | 334 |
} |
tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/view/ElementPropertiesView.java (revision 3170) | ||
---|---|---|
1 | 1 |
package org.txm.annotation.urs.view; |
2 | 2 |
|
3 | 3 |
import java.text.Collator; |
4 |
import java.util.ArrayList; |
|
4 | 5 |
import java.util.Arrays; |
5 | 6 |
import java.util.LinkedHashMap; |
6 | 7 |
import java.util.Locale; |
... | ... | |
210 | 211 |
public void widgetDisposed(DisposeEvent e) { |
211 | 212 |
try { |
212 | 213 |
if (element != null) { // save previous unit changes |
213 |
for (Combo t : textWidgets.keySet()) {
|
|
214 |
for (Combo t : new ArrayList<Combo>(textWidgets.keySet())) {
|
|
214 | 215 |
if (!t.isDisposed()) { |
215 | 216 |
saveFieldValue(t); |
216 | 217 |
} |
... | ... | |
224 | 225 |
public void unloadElement(Corpus analecCorpus, URSAnnotationToolbar toolbar) { |
225 | 226 |
|
226 | 227 |
if (this.element != null) { // save previous unit changes |
227 |
for (Combo t : textWidgets.keySet()) {
|
|
228 |
for (Combo t : new ArrayList<Combo>(textWidgets.keySet())) {
|
|
228 | 229 |
if (!t.isDisposed()) { |
229 | 230 |
saveFieldValue(t); |
230 | 231 |
} |
... | ... | |
241 | 242 |
this.setContentDescription("No annotation selected"); |
242 | 243 |
} |
243 | 244 |
|
244 |
public void loadElement(org.txm.searchengine.cqp.corpus.CQPCorpus corpus, Corpus analecCorpus, Element newElement, URSAnnotationToolbar toolbar) { |
|
245 |
public synchronized void loadElement(org.txm.searchengine.cqp.corpus.CQPCorpus corpus, Corpus analecCorpus, Element newElement, URSAnnotationToolbar toolbar) {
|
|
245 | 246 |
|
246 | 247 |
if (this.element != null) { // save previous unit changes |
247 |
for (Combo t : textWidgets.keySet()) { |
|
248 |
ArrayList<Combo> widgets = new ArrayList<>(textWidgets.keySet()); // vue.setValue will modify this list if an Analec event is fired |
|
249 |
for (Combo t : widgets) { |
|
248 | 250 |
if (!t.isDisposed()) saveFieldValue(t); |
249 | 251 |
if (!t.isDisposed()) t.setText(""); |
250 | 252 |
} |
... | ... | |
320 | 322 |
Log.fine("Refreshing unit properties view with: "+newElement); |
321 | 323 |
this.toolbar = toolbar; |
322 | 324 |
this.element = newElement; |
323 |
for (Combo t : textWidgets.keySet()) {
|
|
325 |
for (Combo t : new ArrayList<Combo>(textWidgets.keySet())) {
|
|
324 | 326 |
if (newElement.getProps().get(textWidgets.get(t)) != null) { |
325 | 327 |
t.setText(newElement.getProps().get(textWidgets.get(t))); |
326 | 328 |
} |
... | ... | |
348 | 350 |
String v = ElementPropertiesView.this.vue.getValeurChamp(ElementPropertiesView.this.element, textWidgets.get(t)); |
349 | 351 |
if (!v.equals(newVal) && v != null) { |
350 | 352 |
ElementPropertiesView.this.vue.setValeurChamp(ElementPropertiesView.this.element, textWidgets.get(t), newVal); |
353 |
ElementPropertiesView.this.analecCorpus.isModifie(); |
|
351 | 354 |
if (toolbar != null && !toolbar.isDisposed()) this.toolbar.fireIsDirty(); |
352 | 355 |
} |
353 | 356 |
} |
tmp/org.txm.analec.rcp/src/visuAnalec/donnees/Corpus.java (revision 3170) | ||
---|---|---|
40 | 40 |
listeCorrespondants.remove(correspondant); |
41 | 41 |
} |
42 | 42 |
private void fireMessage(Message evt) { |
43 |
boolean newModifie = !EnumSet.of(TypeMessage.CLEAR_CORPUS, TypeMessage.NEW_CORPUS, TypeMessage.CORPUS_SAVED). |
|
44 |
contains(evt.getType()); |
|
43 |
TypeMessage type = evt.getType(); |
|
44 |
boolean newModifie = !(EnumSet.of(TypeMessage.CLEAR_CORPUS, TypeMessage.NEW_CORPUS, TypeMessage.CORPUS_SAVED). |
|
45 |
contains(type)); |
|
45 | 46 |
// if (!modifie && newModifie) { |
46 | 47 |
// System.out.println("corpus modified: "+evt); |
47 | 48 |
// } |
tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/rcp/TSMacrosMenuContribution.java (revision 3170) | ||
---|---|---|
1 |
package org.txm.tigersearch.rcp; |
|
2 |
|
|
3 |
import java.io.File; |
|
4 |
|
|
5 |
import org.txm.Toolbox; |
|
6 |
import org.txm.rcp.menu.MacrosMenuContribution; |
|
7 |
|
|
8 |
public class TSMacrosMenuContribution extends MacrosMenuContribution { |
|
9 |
|
|
10 |
public File getMacroDirectory() { |
|
11 |
//create the menu item |
|
12 |
String w = Toolbox.getTxmHomePath(); |
|
13 |
if (w == null || w.length() == 0) return null; |
|
14 |
|
|
15 |
return new File(w, "scripts/groovy/user/org/txm/macro/tiger"); |
|
16 |
} |
|
17 |
} |
|
0 | 18 |
tmp/org.txm.tigersearch.rcp/plugin.xml (revision 3170) | ||
---|---|---|
191 | 191 |
id="menu.tiger.tools" |
192 | 192 |
label="Tools"> |
193 | 193 |
<dynamic |
194 |
class="org.txm.rcp.menu.MacrosMenuContribution"
|
|
194 |
class="org.txm.tigersearch.rcp.TSMacrosMenuContribution"
|
|
195 | 195 |
id="org.txm.macro.tiger.exploit"> |
196 | 196 |
</dynamic> |
197 | 197 |
</menu> |
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/TXTQuery.java (revision 3170) | ||
---|---|---|
62 | 62 |
r = CQLQuery.addBackSlash(r); |
63 | 63 |
buffer.append("\"" + r.replace("\\*", ".*") + "\"%cd"); |
64 | 64 |
} |
65 |
System.out.println("QUERY=" + buffer.toString()); |
|
65 |
System.out.println("CQL QUERY=" + buffer.toString());
|
|
66 | 66 |
return new CQLQuery(buffer.toString()); |
67 | 67 |
} |
68 | 68 |
} |
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/ReferencePattern.java (revision 3170) | ||
---|---|---|
69 | 69 |
public static ReferencePattern stringToReferencePattern(CQPCorpus corpus, String v) { |
70 | 70 |
ReferencePattern ref = fromGSonString(corpus, v); |
71 | 71 |
if (ref == null) { |
72 |
ref = fromPatternString(corpus, v);
|
|
72 |
ref = fromNLSString(corpus, v);
|
|
73 | 73 |
} |
74 | 74 |
if (ref == null) { |
75 | 75 |
ref = fromTabulatedString(corpus, v); |
... | ... | |
83 | 83 |
* @param v |
84 | 84 |
* @return a list of word and structure properties read from a String |
85 | 85 |
*/ |
86 |
public static boolean isGsonString(String gsonString) { |
|
87 |
try { |
|
88 |
new Gson().fromJson(gsonString, HashMap.class); |
|
89 |
return true; |
|
90 |
} catch(Exception e) { |
|
91 |
return false; |
|
92 |
} |
|
93 |
} |
|
94 |
|
|
95 |
/** |
|
96 |
* |
|
97 |
* @param corpus |
|
98 |
* @param v |
|
99 |
* @return a list of word and structure properties read from a String |
|
100 |
*/ |
|
101 |
public static String fromGSonToPattern(String gsonString) { |
|
102 |
try { |
|
103 |
Gson gson = new Gson(); |
|
104 |
|
|
105 |
HashMap<?, ?> values = gson.fromJson(gsonString, HashMap.class); |
|
106 |
Object oFormat = values.get("format"); |
|
107 |
if (oFormat != null) { |
|
108 |
return oFormat.toString(); |
|
109 |
} |
|
110 |
|
|
111 |
} catch(Exception e) { |
|
112 |
e.printStackTrace(); |
|
113 |
} |
|
114 |
return ""; |
|
115 |
} |
|
116 |
|
|
117 |
/** |
|
118 |
* |
|
119 |
* @param corpus |
|
120 |
* @param v |
|
121 |
* @return a list of word and structure properties read from a String |
|
122 |
*/ |
|
123 |
public static List<String> fromGSonToPropertyNames(String gsonString) { |
|
124 |
ArrayList<String> props = new ArrayList<>(); |
|
125 |
try { |
|
126 |
Gson gson = new Gson(); |
|
127 |
|
|
128 |
HashMap<?, ?> values = gson.fromJson(gsonString, HashMap.class); |
|
129 |
Object oProperties = values.get("properties"); |
|
130 |
|
|
131 |
if (oProperties != null && oProperties instanceof List) { |
|
132 |
List<?> propertyNames = (List<?>) oProperties; |
|
133 |
for (Object o : propertyNames) { |
|
134 |
if (o == null) continue; |
|
135 |
String s = o.toString(); |
|
136 |
props.add(s); |
|
137 |
} |
|
138 |
} |
|
139 |
} |
|
140 |
catch (Exception e) { |
|
141 |
e.printStackTrace(); |
|
142 |
} |
|
143 |
return props; |
|
144 |
} |
|
145 |
|
|
146 |
/** |
|
147 |
* |
|
148 |
* @param corpus |
|
149 |
* @param v |
|
150 |
* @return a list of word and structure properties read from a String |
|
151 |
*/ |
|
86 | 152 |
@SuppressWarnings("unlikely-arg-type") |
87 | 153 |
public static ReferencePattern fromGSonString(CQPCorpus corpus, String v) { |
88 | 154 |
try { |
... | ... | |
130 | 196 |
} |
131 | 197 |
} |
132 | 198 |
|
199 |
|
|
200 |
|
|
133 | 201 |
/** |
134 | 202 |
* |
135 | 203 |
* @param corpus |
136 | 204 |
* @param v "${strct_prop} like string" |
137 | 205 |
* @return |
138 | 206 |
*/ |
139 |
protected static ReferencePattern fromPatternString(CQPCorpus corpus, String v) {
|
|
207 |
protected static ReferencePattern fromNLSString(CQPCorpus corpus, String v) {
|
|
140 | 208 |
try { |
141 | 209 |
ReferencePattern props = new ReferencePattern(); |
142 | 210 |
if (v == null) return props; |
... | ... | |
369 | 437 |
return title; |
370 | 438 |
} |
371 | 439 |
|
440 |
public static String referenceToString(List<String> names, String patternString) { |
|
441 |
Gson gson = new Gson(); |
|
442 |
HashMap<String, Object> values = new HashMap<>(); |
|
443 |
values.put("properties", names); |
|
444 |
values.put("format", patternString); |
|
445 |
return gson.toJson(values); |
|
446 |
} |
|
447 |
|
|
372 | 448 |
public static String referenceToString(ReferencePattern pattern) { |
373 | 449 |
ArrayList<String> names = new ArrayList<>(); |
374 | 450 |
for (Property p : pattern.getProperties()) { |
375 | 451 |
names.add(p.getFullName()); |
376 | 452 |
} |
377 | 453 |
|
378 |
Gson gson = new Gson(); |
|
379 |
HashMap<String, Object> values = new HashMap<>(); |
|
380 |
values.put("properties", names); |
|
381 |
values.put("format", pattern.getPattern()); |
|
382 |
return gson.toJson(values); |
|
454 |
return referenceToString(names, pattern.getPattern()); |
|
383 | 455 |
} |
384 | 456 |
|
385 | 457 |
public CQPCorpus getCorpus() { |
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xml/importer.groovy (revision 3170) | ||
---|---|---|
223 | 223 |
println("Failed to process "+f) |
224 | 224 |
new File(txmDir,txmfile).delete() |
225 | 225 |
} |
226 |
if (builder.getMissingWordIDS().size() > 0) { |
|
227 |
println "Warning: some words are missing IDs at : "+builder.getMissingWordIDS().join(", ") |
|
228 |
} |
|
226 | 229 |
} |
227 | 230 |
cpb.done() |
228 | 231 |
okfiles = txmDir.listFiles() |
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/importer.groovy (revision 3170) | ||
---|---|---|
246 | 246 |
println("Failed to process "+tfile) |
247 | 247 |
xmlfile.delete(); |
248 | 248 |
} |
249 |
|
|
250 |
if (builder.getMissingWordIDS().size() > 0) { |
|
251 |
println "Warning: some words are missing IDs at : "+builder.getMissingWordIDS().join(", ") |
|
252 |
} |
|
249 | 253 |
} |
250 | 254 |
|
251 | 255 |
if (project.getCleanAfterBuild()) { |
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZDefaultPagerStep.groovy (revision 3170) | ||
---|---|---|
157 | 157 |
// println "FILE ="+outfile |
158 | 158 |
if (firstWord) { // there was no words |
159 | 159 |
pagedWriter.writeCharacters(""); |
160 |
this.idxstart.add("${wordTag}_0")
|
|
161 |
pagedWriter.write("<span id=\"${wordTag}_0\"/>");
|
|
160 |
this.idxstart.add("w_0")
|
|
161 |
pagedWriter.write("<span id=\"w_0\"/>");
|
|
162 | 162 |
} |
163 | 163 |
pagedWriter.writeEndElements(); |
164 | 164 |
// write notes |
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZImporter.groovy (revision 3170) | ||
---|---|---|
490 | 490 |
println("Failed to process "+f); |
491 | 491 |
new File(outputDirectory,txmfile).delete(); |
492 | 492 |
} |
493 |
|
|
494 |
if (builder.getMissingWordIDS().size() > 0) { |
|
495 |
println "Warning: some words are missing IDs at : "+builder.getMissingWordIDS().join(", ") |
|
496 |
} |
|
493 | 497 |
} |
494 | 498 |
filesToProcess = outputDirectory.listFiles(); |
495 | 499 |
cpb.done(); |
tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java (revision 3170) | ||
---|---|---|
47 | 47 |
|
48 | 48 |
public class EditionPanel extends BrowserViewer implements ISelectionProvider { |
49 | 49 |
|
50 |
private ProgressListener progresslistener;
|
|
50 |
private ProgressListener progressListener;
|
|
51 | 51 |
|
52 | 52 |
// private List<String> wordids; |
53 | 53 |
// private List<String> lineids; |
... | ... | |
300 | 300 |
beforeHighlighListeners = new ArrayList<>(); |
301 | 301 |
afterHighlighListeners = new ArrayList<>(); |
302 | 302 |
|
303 |
progresslistener = new ProgressListener() {
|
|
303 |
progressListener = new ProgressListener() {
|
|
304 | 304 |
|
305 | 305 |
@Override |
306 | 306 |
public void changed(ProgressEvent event) {} |
... | ... | |
527 | 527 |
} |
528 | 528 |
} |
529 | 529 |
|
530 |
|
|
531 | 530 |
buffer = new StringBuilder(); |
532 | 531 |
|
533 | 532 |
if (highlightedAreas != null) { |
... | ... | |
627 | 626 |
getBrowser().setCapture(true); |
628 | 627 |
getBrowser().addKeyListener(kListener); |
629 | 628 |
|
630 |
getBrowser().addProgressListener(progresslistener);
|
|
629 |
getBrowser().addProgressListener(progressListener);
|
|
631 | 630 |
new CommandLink(synopticEditionEditor, getBrowser()); |
632 | 631 |
new EditionLink(synopticEditionEditor, getBrowser()); |
633 | 632 |
} |
... | ... | |
673 | 672 |
* Can be called to refresh the page word styles but only when the page is loaded |
674 | 673 |
*/ |
675 | 674 |
public void updateWordStyles() { |
676 |
progresslistener.completed(null);
|
|
675 |
progressListener.completed(null);
|
|
677 | 676 |
} |
678 | 677 |
|
679 | 678 |
public void addHighlightWordsById(RGBA color, Collection<String> wordids) { |
... | ... | |
752 | 751 |
return; |
753 | 752 |
} |
754 | 753 |
|
755 |
this.setURL(currentPage.toURL());
|
|
754 |
reloadPage();
|
|
756 | 755 |
|
757 | 756 |
// page_label.setText(makePageLabel()); |
758 | 757 |
} |
... | ... | |
775 | 774 |
} |
776 | 775 |
currentPage = currentEdition.getLastPage(); |
777 | 776 |
currentText = currentEdition.getText(); |
778 |
this.setURL(currentPage.toURL());
|
|
777 |
reloadPage();
|
|
779 | 778 |
} |
780 | 779 |
|
781 | 780 |
/** |
... | ... | |
791 | 790 |
} |
792 | 791 |
else { |
793 | 792 |
currentPage = previous; |
794 |
this.setURL(currentPage.toURL());
|
|
793 |
reloadPage();
|
|
795 | 794 |
} |
796 | 795 |
currentText = currentEdition.getText(); |
797 | 796 |
} |
... | ... | |
815 | 814 |
} |
816 | 815 |
else { |
817 | 816 |
currentPage = next; |
818 |
this.setURL(currentPage.toURL());
|
|
817 |
reloadPage();
|
|
819 | 818 |
} |
820 | 819 |
currentText = currentEdition.getText(); |
821 | 820 |
} |
... | ... | |
853 | 852 |
StatusLine.setMessage("No previous text"); //$NON-NLS-1$ |
854 | 853 |
return; |
855 | 854 |
} |
856 |
this.setURL(currentPage.toURL());
|
|
855 |
reloadPage();
|
|
857 | 856 |
} |
858 | 857 |
} |
859 | 858 |
|
... | ... | |
890 | 889 |
return; |
891 | 890 |
} |
892 | 891 |
|
893 |
this.setURL(currentPage.toURL());
|
|
892 |
reloadPage();
|
|
894 | 893 |
// page_label.setText(makePageLabel()); |
895 | 894 |
} |
896 | 895 |
// System.out.println("Next texts "+nextText); |
... | ... | |
945 | 944 |
StatusLine.setMessage("No previous text"); //$NON-NLS-1$ |
946 | 945 |
return; |
947 | 946 |
} |
948 |
this.setURL(currentPage.toURL());
|
|
947 |
reloadPage();
|
|
949 | 948 |
} |
950 | 949 |
// System.out.println("Previous texts "+previousText); |
951 | 950 |
} |
... | ... | |
992 | 991 |
return; |
993 | 992 |
} |
994 | 993 |
|
995 |
this.setURL(currentPage.toURL());
|
|
994 |
reloadPage();
|
|
996 | 995 |
// page_label.setText(makePageLabel()); |
997 | 996 |
} |
998 | 997 |
// System.out.println("Next texts "+nextText); |
... | ... | |
1016 | 1015 |
} |
1017 | 1016 |
|
1018 | 1017 |
if (refresh) { |
1019 |
this.setURL(currentPage.toURL());
|
|
1018 |
reloadPage();
|
|
1020 | 1019 |
} |
1021 | 1020 |
// page_label.setText(makePageLabel()); |
1022 | 1021 |
} |
... | ... | |
1058 | 1057 |
currentEdition = page.getEdition(); |
1059 | 1058 |
currentText = currentEdition.getText(); |
1060 | 1059 |
currentPage = page; |
1061 |
this.setURL(currentPage.toURL());
|
|
1060 |
reloadPage();
|
|
1062 | 1061 |
} |
1063 | 1062 |
|
1063 |
/** |
|
1064 |
* Reload the browser with the currentPage URL |
|
1065 |
*/ |
|
1064 | 1066 |
public void reloadPage() { |
1065 | 1067 |
this.setURL(currentPage.toURL()); |
1066 | 1068 |
} |
... | ... | |
1366 | 1368 |
// System.out.println(Messages.TxmBrowser_4+currentPage); |
1367 | 1369 |
if (next != null) { |
1368 | 1370 |
currentPage = next; |
1369 |
this.setURL(currentPage.toURL());
|
|
1371 |
reloadPage();
|
|
1370 | 1372 |
} |
1371 | 1373 |
else { |
1372 | 1374 |
System.out.println(EditionUIMessages.bind(EditionUIMessages.pageNotFoundP0, name)); |
tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SynopticEditionEditor.java (revision 3170) | ||
---|---|---|
74 | 74 |
import org.txm.core.messages.TXMCoreMessages; |
75 | 75 |
import org.txm.edition.rcp.messages.EditionUIMessages; |
76 | 76 |
import org.txm.objects.Edition; |
77 |
import org.txm.objects.Match; |
|
77 | 78 |
import org.txm.objects.Page; |
78 | 79 |
import org.txm.objects.Project; |
79 | 80 |
import org.txm.objects.Text; |
... | ... | |
1103 | 1104 |
} |
1104 | 1105 |
return arguments; |
1105 | 1106 |
} |
1107 |
|
|
1108 |
public LinkedHashMap<String, EditionPanel> getEditionPanels() { |
|
1109 |
return editionPanels; |
|
1110 |
} |
|
1106 | 1111 |
} |
tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/SetContextSize.java (revision 3170) | ||
---|---|---|
169 | 169 |
rightContextSize = rightSpinner.getSelection(); |
170 | 170 |
super.okPressed(); |
171 | 171 |
} |
172 |
|
|
173 | 172 |
} |
174 | 173 |
} |
tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java (revision 3170) | ||
---|---|---|
1627 | 1627 |
|
1628 | 1628 |
concordance.setLeftContextSize(leftContextSize); |
1629 | 1629 |
concordance.setRightContextSize(rightContextSize); |
1630 |
this.rightSizeSpinner.setSelection(rightContextSize); |
|
1631 |
this.leftSizeSpinner.setSelection(leftContextSize); |
|
1630 | 1632 |
fillDisplayArea(false); // we return to the previously |
1631 | 1633 |
resetColumnWidths(); |
1632 | 1634 |
} |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/UISection.java (revision 3170) | ||
---|---|---|
1 |
package org.txm.rcp.editors.imports.sections; |
|
2 |
|
|
3 |
import org.eclipse.swt.SWT; |
|
4 |
import org.eclipse.swt.widgets.Composite; |
|
5 |
import org.eclipse.swt.widgets.Label; |
|
6 |
import org.eclipse.swt.widgets.Text; |
|
7 |
import org.eclipse.ui.forms.events.ExpansionAdapter; |
|
8 |
import org.eclipse.ui.forms.events.ExpansionEvent; |
|
9 |
import org.eclipse.ui.forms.widgets.FormToolkit; |
|
10 |
import org.eclipse.ui.forms.widgets.ScrolledForm; |
|
11 |
import org.eclipse.ui.forms.widgets.TableWrapData; |
|
12 |
import org.eclipse.ui.forms.widgets.TableWrapLayout; |
|
13 |
import org.txm.objects.CorpusCommandPreferences; |
|
14 |
import org.txm.objects.Project; |
|
15 |
import org.txm.rcp.messages.TXMUIMessages; |
|
16 |
|
|
17 |
public class UISection extends ImportEditorSection { |
|
18 |
|
|
19 |
private static final int SECTION_SIZE = 1; |
|
20 |
|
|
21 |
private Text structLimitsText; |
|
22 |
|
|
23 |
private Text referencePatternText; |
|
24 |
|
|
25 |
public UISection(FormToolkit toolkit2, ScrolledForm form2, Composite parent, int style) { |
|
26 |
super(toolkit2, form2, parent, style, "commands"); |
|
27 |
|
|
28 |
this.section.setText(TXMUIMessages.commands); |
|
29 |
TableWrapLayout layout = new TableWrapLayout(); |
|
30 |
layout.makeColumnsEqualWidth = true; |
|
31 |
this.section.setLayout(layout); |
|
32 |
this.section.setLayoutData(getSectionGridData(SECTION_SIZE)); |
|
33 |
this.section.setEnabled(false); |
|
34 |
this.section.addExpansionListener(new ExpansionAdapter() { |
|
35 |
|
|
36 |
@Override |
|
37 |
public void expansionStateChanged(ExpansionEvent e) { |
|
38 |
form.layout(true); |
|
39 |
} |
|
40 |
}); |
|
41 |
|
|
42 |
Composite sectionClient = toolkit.createComposite(this.section); |
|
43 |
TableWrapLayout slayout = new TableWrapLayout(); |
|
44 |
slayout.makeColumnsEqualWidth = false; |
|
45 |
slayout.numColumns = 2; |
|
46 |
sectionClient.setLayout(slayout); |
|
47 |
this.section.setClient(sectionClient); |
|
48 |
|
|
49 |
Label sep = toolkit.createLabel(sectionClient, "Concordances"); |
|
50 |
sep.setToolTipText("Concordance sub-section"); |
|
51 |
sep.setLayoutData(getSectionGridData(2)); |
|
52 |
|
|
53 |
Label tmpLabel = toolkit.createLabel(sectionClient, TXMUIMessages.concordanceContextStructureLimits); |
|
54 |
tmpLabel.setToolTipText(TXMUIMessages.concordanceContextStructureLimits); |
|
55 |
tmpLabel.setLayoutData(getLabelGridData()); |
|
56 |
|
|
57 |
structLimitsText = toolkit.createText(sectionClient, "text", SWT.BORDER); //$NON-NLS-1$ |
|
58 |
structLimitsText.setToolTipText(TXMUIMessages.concordanceContextStructureLimits); |
|
59 |
TableWrapData gdata = getTextGridData(); |
|
60 |
structLimitsText.setLayoutData(gdata); |
|
61 |
|
|
62 |
Label tmp2Label = toolkit.createLabel(sectionClient, "Reference pattern"); |
|
63 |
tmp2Label.setToolTipText("Reference pattern string. Properties must be wrapped in the '${}' tags. eg 'text id = ${text_id} and word = ${word}'"); |
|
64 |
tmp2Label.setLayoutData(getLabelGridData()); |
|
65 |
|
|
66 |
referencePatternText = toolkit.createText(sectionClient, "", SWT.BORDER); //$NON-NLS-1$ |
|
67 |
referencePatternText.setToolTipText("Reference pattern string. Properties must be wrapped in the '${}' tags. eg 'text id = ${text_id} and word = ${word}'"); |
|
68 |
TableWrapData gdata2 = getTextGridData(); |
|
69 |
referencePatternText.setLayoutData(gdata2); |
|
70 |
} |
|
71 |
|
|
72 |
@Override |
|
73 |
public void update(Project project) { |
|
74 |
CorpusCommandPreferences concPrefs = project.getCommandPreferences("concordance"); |
|
75 |
if (concPrefs.get("context_limits") != null) { |
|
76 |
structLimitsText.setText(concPrefs.get("context_limits")); |
|
77 |
} |
|
78 |
else { |
|
79 |
structLimitsText.setText(""); |
|
80 |
} |
|
81 |
if (concPrefs.get("view_reference_pattern") != null) { |
|
82 |
referencePatternText.setText(concPrefs.get("view_reference_pattern")); |
|
83 |
} |
|
84 |
else { |
|
85 |
referencePatternText.setText(""); |
|
86 |
} |
|
87 |
} |
|
88 |
|
|
89 |
@Override |
|
90 |
public boolean save(Project project) { |
|
91 |
if (this.section != null && !section.isDisposed()) { |
|
92 |
CorpusCommandPreferences concPrefs = project.getCommandPreferences("concordance"); |
|
93 |
concPrefs.set("context_limits_type", "list"); |
|
94 |
concPrefs.set("view_reference_pattern", referencePatternText.getText()); |
|
95 |
} |
|
96 |
|
|
97 |
return true; |
|
98 |
} |
|
99 |
|
|
100 |
@Override |
|
101 |
public boolean checkFields() { |
|
102 |
return true; |
|
103 |
} |
|
104 |
|
|
105 |
@Override |
|
106 |
public int getSectionSize() { |
|
107 |
return SECTION_SIZE; |
|
108 |
} |
|
109 |
} |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/CommandsSection.java (revision 3170) | ||
---|---|---|
1 |
package org.txm.rcp.editors.imports.sections; |
|
2 |
|
|
3 |
import java.util.Arrays; |
|
4 |
|
|
5 |
import org.apache.commons.lang.StringUtils; |
|
6 |
import org.eclipse.jface.resource.FontDescriptor; |
|
7 |
import org.eclipse.swt.SWT; |
|
8 |
import org.eclipse.swt.graphics.Font; |
|
9 |
import org.eclipse.swt.graphics.FontData; |
|
10 |
import org.eclipse.swt.widgets.Composite; |
|
11 |
import org.eclipse.swt.widgets.Label; |
|
12 |
import org.eclipse.swt.widgets.Text; |
|
13 |
import org.eclipse.ui.forms.events.ExpansionAdapter; |
|
14 |
import org.eclipse.ui.forms.events.ExpansionEvent; |
|
15 |
import org.eclipse.ui.forms.widgets.FormToolkit; |
|
16 |
import org.eclipse.ui.forms.widgets.ScrolledForm; |
|
17 |
import org.eclipse.ui.forms.widgets.TableWrapData; |
|
18 |
import org.eclipse.ui.forms.widgets.TableWrapLayout; |
|
19 |
import org.txm.objects.CorpusCommandPreferences; |
|
20 |
import org.txm.objects.Project; |
|
21 |
import org.txm.rcp.messages.TXMUIMessages; |
|
22 |
import org.txm.searchengine.cqp.ReferencePattern; |
|
23 |
|
|
24 |
/** |
|
25 |
* Regroup import preferences concerning TXM commands |
|
26 |
* TODO: split the section for each command |
|
27 |
* |
|
28 |
* @author mdecorde |
|
29 |
* |
|
30 |
*/ |
|
31 |
public class CommandsSection extends ImportEditorSection { |
|
32 |
|
|
33 |
private static final int SECTION_SIZE = 1; |
|
34 |
|
|
35 |
private Text structLimitsText; |
|
36 |
|
|
37 |
private Text referencePatternText; |
|
38 |
|
|
39 |
private Text referencePatternProperties; |
|
40 |
|
|
41 |
public CommandsSection(FormToolkit toolkit2, ScrolledForm form2, Composite parent, int style) { |
|
42 |
super(toolkit2, form2, parent, style, "commands"); |
|
43 |
|
|
44 |
this.section.setText(TXMUIMessages.commands); |
|
45 |
TableWrapLayout layout = new TableWrapLayout(); |
|
46 |
layout.makeColumnsEqualWidth = true; |
|
47 |
this.section.setLayout(layout); |
|
48 |
this.section.setLayoutData(getSectionGridData(SECTION_SIZE)); |
|
49 |
this.section.setEnabled(false); |
|
50 |
this.section.addExpansionListener(new ExpansionAdapter() { |
|
51 |
|
|
52 |
@Override |
|
53 |
public void expansionStateChanged(ExpansionEvent e) { |
|
54 |
form.layout(true); |
|
55 |
} |
|
56 |
}); |
|
57 |
|
|
58 |
Composite sectionClient = toolkit.createComposite(this.section); |
|
59 |
TableWrapLayout slayout = new TableWrapLayout(); |
|
60 |
slayout.makeColumnsEqualWidth = false; |
|
61 |
slayout.numColumns = 2; |
|
62 |
sectionClient.setLayout(slayout); |
|
63 |
this.section.setClient(sectionClient); |
|
64 |
|
|
65 |
Label sep = toolkit.createLabel(sectionClient, "Concordances"); |
|
66 |
sep.setToolTipText("Concordance sub-section"); |
|
67 |
sep.setLayoutData(getSectionGridData(2)); |
|
68 |
sep.setFont(FontDescriptor.createFrom(sep.getFont()).setStyle(SWT.BOLD).createFont(sep.getDisplay())); |
|
69 |
|
|
70 |
Label tmpLabel = toolkit.createLabel(sectionClient, TXMUIMessages.concordanceContextStructureLimits); |
|
71 |
tmpLabel.setToolTipText(TXMUIMessages.concordanceContextStructureLimits); |
|
72 |
tmpLabel.setLayoutData(getLabelGridData()); |
|
73 |
|
|
74 |
structLimitsText = toolkit.createText(sectionClient, "text", SWT.BORDER); //$NON-NLS-1$ |
|
75 |
structLimitsText.setToolTipText(TXMUIMessages.concordanceContextStructureLimits); |
|
76 |
TableWrapData gdata = getTextGridData(); |
|
77 |
structLimitsText.setLayoutData(gdata); |
|
78 |
|
|
79 |
Label tmp2Label = toolkit.createLabel(sectionClient, "Default References"); |
|
80 |
tmp2Label.setToolTipText("The default references displayed in the References column."); |
|
81 |
tmp2Label.setLayoutData(getSectionGridData(2)); |
|
82 |
|
|
83 |
Label tmp3Label = toolkit.createLabel(sectionClient, " Pattern"); |
|
84 |
tmp3Label.setToolTipText("Reference pattern string in the printf format with '%s' markers."); |
|
85 |
tmp3Label.setLayoutData(getLabelGridData()); |
|
86 |
|
|
87 |
referencePatternText = toolkit.createText(sectionClient, "", SWT.BORDER); //$NON-NLS-1$ |
|
88 |
referencePatternText.setToolTipText("Reference pattern string in the printf format with '%s' markers."); |
|
89 |
TableWrapData gdata2 = getTextGridData(); |
|
90 |
referencePatternText.setLayoutData(gdata2); |
|
91 |
|
|
92 |
Label tmp4Label = toolkit.createLabel(sectionClient, " Properties"); |
|
93 |
tmp4Label.setToolTipText("Comma separated list of CQP word properties or structures properties."); |
|
94 |
tmp4Label.setLayoutData(getLabelGridData()); |
|
95 |
|
|
96 |
referencePatternProperties = toolkit.createText(sectionClient, "", SWT.BORDER); //$NON-NLS-1$ |
|
97 |
referencePatternProperties.setToolTipText("Comma separated list of CQP word properties or structures properties."); |
|
98 |
TableWrapData gdata3 = getTextGridData(); |
|
99 |
referencePatternProperties.setLayoutData(gdata3); |
|
100 |
} |
|
101 |
|
|
102 |
@Override |
|
103 |
public void update(Project project) { |
|
104 |
CorpusCommandPreferences concPrefs = project.getCommandPreferences("concordance"); |
|
105 |
if (concPrefs.get("context_limits") != null) { |
|
106 |
structLimitsText.setText(concPrefs.get("context_limits")); |
|
107 |
} |
|
108 |
else { |
|
109 |
structLimitsText.setText(""); |
|
110 |
} |
|
111 |
if (concPrefs.get("view_reference_pattern") != null) { |
|
112 |
String gsonString = concPrefs.get("view_reference_pattern"); |
|
113 |
if (ReferencePattern.isGsonString(gsonString)) { |
|
114 |
referencePatternText.setText(ReferencePattern.fromGSonToPattern(gsonString)); |
|
115 |
referencePatternProperties.setText(StringUtils.join(ReferencePattern.fromGSonToPropertyNames(gsonString), ",")); |
|
116 |
} else if(gsonString.contains("{0}")) { |
|
117 |
System.out.println("WARNING: experimental reference pattern format found: "+gsonString); |
|
118 |
} else { |
|
119 |
referencePatternText.setText(""); |
|
120 |
referencePatternProperties.setText(StringUtils.join(gsonString.split("\t"), ",")); |
|
121 |
} |
|
122 |
} |
|
123 |
else { |
|
124 |
referencePatternText.setText(""); |
|
125 |
referencePatternProperties.setText(""); |
|
126 |
} |
|
127 |
} |
|
128 |
|
|
129 |
@Override |
|
130 |
public boolean save(Project project) { |
|
131 |
if (this.section != null && !section.isDisposed()) { |
|
132 |
CorpusCommandPreferences concPrefs = project.getCommandPreferences("concordance"); |
|
133 |
concPrefs.set("context_limits_type", "list"); |
|
134 |
|
|
135 |
concPrefs.set("view_reference_pattern", |
|
136 |
ReferencePattern.referenceToString( |
|
137 |
Arrays.asList(referencePatternProperties.getText().trim().split(",")), |
|
138 |
referencePatternText.getText()) |
|
139 |
); |
|
140 |
} |
|
141 |
|
|
142 |
return true; |
|
143 |
} |
|
144 |
|
|
145 |
@Override |
|
146 |
public boolean checkFields() { |
|
147 |
return true; |
|
148 |
} |
|
149 |
|
|
150 |
@Override |
|
151 |
public int getSectionSize() { |
|
152 |
return SECTION_SIZE; |
|
153 |
} |
|
154 |
} |
|
0 | 155 |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/CorpusPage.java (revision 3170) | ||
---|---|---|
76 | 76 |
import org.txm.rcp.editors.imports.sections.OptionsSection; |
77 | 77 |
import org.txm.rcp.editors.imports.sections.TextualPlansSection; |
78 | 78 |
import org.txm.rcp.editors.imports.sections.TokenizerSection; |
79 |
import org.txm.rcp.editors.imports.sections.UISection;
|
|
79 |
import org.txm.rcp.editors.imports.sections.CommandsSection;
|
|
80 | 80 |
import org.txm.rcp.handlers.results.DeleteObject; |
81 | 81 |
import org.txm.rcp.handlers.scripts.ExecuteImportScript; |
82 | 82 |
import org.txm.rcp.messages.TXMUIMessages; |
... | ... | |
831 | 831 |
} |
832 | 832 |
|
833 | 833 |
private int createUIsSection() { |
834 |
uiSection = new UISection(toolkit, form, form.getBody(), ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE);
|
|
834 |
uiSection = new CommandsSection(toolkit, form, form.getBody(), ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE);
|
|
835 | 835 |
return uiSection.getSectionSize(); |
836 | 836 |
} |
837 | 837 |
|
tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/QueryAssistDialog.java (revision 3170) | ||
---|---|---|
583 | 583 |
propertiesFieldComposite.getLayout().numColumns = 2; |
584 | 584 |
|
585 | 585 |
allCriteriaButton = new Button(this, SWT.CHECK); |
586 |
allCriteriaButton.setToolTipText("All properties test are verified");
|
|
586 |
allCriteriaButton.setToolTipText("All property tests are verified");
|
|
587 | 587 |
|
588 | 588 |
targetButton = new Button(this, SWT.CHECK); |
589 | 589 |
targetButton.setToolTipText("Check to target the word in the query"); |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorpus.java (revision 3170) | ||
---|---|---|
363 | 363 |
File importXMLFile = new File(destDir, "import.xml"); |
364 | 364 |
File dotProjectFile = new File(destDir, ".project"); |
365 | 365 |
if (paramFile.exists() && paramFile.isDirectory() && dotProjectFile.exists() && dotProjectFile.isFile()) { |
366 |
Log.info(NLS.bind(TXMUIMessages.theP0BinaryCorpusVersionIsP1, destDir)); |
|
367 |
|
|
366 |
Log.info(NLS.bind(TXMUIMessages.theP0BinaryCorpusVersionIsP1, destDir, "0.8.0")); |
|
368 | 367 |
project = Load080BinaryCorpus.loadBinaryCorpusAsDirectory(destDir); |
369 | 368 |
} |
370 | 369 |
else if (importXMLFile.exists()) { |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java (revision 3170) | ||
---|---|---|
863 | 863 |
int n = 3; |
864 | 864 |
final ArrayList<Object> selectedCorporaDirs = new ArrayList<>(); |
865 | 865 |
selectedCorporaDirs.add(SAMPLES); |
866 |
selectedCorporaDirs.add(vCURRENT); |
|
867 | 866 |
|
868 | 867 |
if (corporaDir.exists() && corporaDir.listFiles(IOUtils.HIDDENFILE_FILTER).length > 0) selectedCorporaDirs.add(vCURRENT); |
869 | 868 |
|
tmp/org.txm.rcp/plugin.xml (revision 3170) | ||
---|---|---|
52 | 52 |
</property> |
53 | 53 |
<property |
54 | 54 |
name="aboutText" |
55 |
value="<TXM Software User Agreement>

TXM 0.8.2 Copyright © 2010-2021 ENS de Lyon, University of Franche-Comté, CNRS

<English version below>

EN ACCEPTANT CETTE MISE À JOUR ET EN UTILISANT TXM, VOUS VOUS ENGAGEZ À CITER L'ARTICLE DE RÉFÉRENCE DE LA PLATEFORME* DANS VOS PUBLICATIONS DE RÉSULTATS OBTENUS À PARTIR D'ELLE. CELA EST ESSENTIEL POUR NOUS PERMETTRE DE JUSTIFIER LE BESOIN DE PÉRENNISATION DE CET INSTRUMENT DE TRAVAIL POUR LA COMMUNAUTÉ SCIENTIFIQUE.

Le logiciel TXM est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier suivant les termes de la Licence publique générale GNU telle que publiée par la Free Software Foundation, soit la version 2 de cette License, soit une version ultérieure.

Le logiciel TXM est distribué dans l'espoir qu'il sera utile, mais sans aucune garantie, y compris mais non de façon limitative les garanties implicites de qualité marchande et de convenance à un usage particulier. Consultez la version 2 et la version 3 de la Licence publique générale GNU pour plus de détails.

Vous devriez avoir reçu une copie de la Licence publique générale GNU en accompagnement du logiciel TXM ; si ce n'est pas le cas, veuillez consulter la page http://www.gnu.org/licenses/gpl-2.0.html
_______________
* Serge Heiden, Jean-Philippe Magué, Bénédicte Pincemin.
TXM : Une plateforme logicielle open-source pour la textométrie - conception et développement. Sergio Bolasco, Isabella Chiari, Luca Giuliano. 10th International Conference on the Statistical Analysis of Textual Data - JADT 2010, Jun 2010, Rome, Italie.
Edizioni Universitarie di Lettere Economia Diritto, 2 (3), pp.1021-1032, 2010. <halshs-00549779>


ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH


By accepting this update and by using TXM, you agree to cite the TXM platform reference article** in your publications of results obtained from it. That is essential for us to justify the need for sustainability of this instrument for the scientific community.

The TXM platform is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

The TXM platform is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with the TXM platform. If not, see http://www.gnu.org/licenses/gpl-2.0.html
_______________
** Serge Heiden. The TXM Platform: Building Open-Source Textual
Analysis Software Compatible with the TEI Encoding Scheme. Ryo Otoguro, Kiyoshi Ishikawa, Hiroshi Umemoto, Kei Yoshimoto and Yasunari Harada. 24th Pacific Asia Conference on Language, Information and Computation, Nov 2010, Sendai, Japan. Institute for Digital Enhancement of Cognitive Development, Waseda University, pp.389-398, 2010. <halshs-00549764>">
|
|
55 |
value="<TXM Software User Agreement>

TXM 0.8.1 Copyright © 2010-2020 ENS de Lyon, University of Franche-Comté, CNRS

<English version below>

EN ACCEPTANT CETTE MISE À JOUR ET EN UTILISANT TXM, VOUS VOUS ENGAGEZ À CITER L'ARTICLE DE RÉFÉRENCE DE LA PLATEFORME* DANS VOS PUBLICATIONS DE RÉSULTATS OBTENUS À PARTIR D'ELLE. CELA EST ESSENTIEL POUR NOUS PERMETTRE DE JUSTIFIER LE BESOIN DE PÉRENNISATION DE CET INSTRUMENT DE TRAVAIL POUR LA COMMUNAUTÉ SCIENTIFIQUE.

Le logiciel TXM est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier suivant les termes de la Licence publique générale GNU telle que publiée par la Free Software Foundation, soit la version 2 de cette License, soit une version ultérieure.

Le logiciel TXM est distribué dans l'espoir qu'il sera utile, mais sans aucune garantie, y compris mais non de façon limitative les garanties implicites de qualité marchande et de convenance à un usage particulier. Consultez la version 2 et la version 3 de la Licence publique générale GNU pour plus de détails.

Vous devriez avoir reçu une copie de la Licence publique générale GNU en accompagnement du logiciel TXM ; si ce n'est pas le cas, veuillez consulter la page http://www.gnu.org/licenses/gpl-2.0.html
_______________
* Serge Heiden, Jean-Philippe Magué, Bénédicte Pincemin.
TXM : Une plateforme logicielle open-source pour la textométrie - conception et développement. Sergio Bolasco, Isabella Chiari, Luca Giuliano. 10th International Conference on the Statistical Analysis of Textual Data - JADT 2010, Jun 2010, Rome, Italie.
Edizioni Universitarie di Lettere Economia Diritto, 2 (3), pp.1021-1032, 2010. <halshs-00549779>


ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH ENGLISH


By accepting this update and by using TXM, you agree to cite the TXM platform reference article** in your publications of results obtained from it. That is essential for us to justify the need for sustainability of this instrument for the scientific community.

The TXM platform is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

The TXM platform is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with the TXM platform. If not, see http://www.gnu.org/licenses/gpl-2.0.html
_______________
** Serge Heiden. The TXM Platform: Building Open-Source Textual
Analysis Software Compatible with the TEI Encoding Scheme. Ryo Otoguro, Kiyoshi Ishikawa, Hiroshi Umemoto, Kei Yoshimoto and Yasunari Harada. 24th Pacific Asia Conference on Language, Information and Computation, Nov 2010, Sendai, Japan. Institute for Digital Enhancement of Cognitive Development, Waseda University, pp.389-398, 2010. <halshs-00549764>">
|
|
56 | 56 |
</property> |
57 | 57 |
<property |
58 | 58 |
name="startupProgressRect" |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RStatsEngine.java (revision 3170) | ||
---|---|---|
178 | 178 |
try { |
179 | 179 |
String execName = RPreferences.getInstance().getString(RPreferences.PATH_TO_EXECUTABLE); |
180 | 180 |
File f = new File(execName); |
181 |
String cmd = NLS.bind("taskkill /IM {0} /F", f.getName()); //$NON-NLS-1$ |
|
181 |
// only use taskkill if the process is running |
|
182 |
String cmd = NLS.bind("tasklist | find /i \""+f.getName()+"\" && taskkill /IM {0} /F", f.getName()); //$NON-NLS-1$ |
|
182 | 183 |
//String cmd = "cmd /c FOR /F \"tokens=5 delims= \" %P IN ('netstat -ano ^| findstr :6330 ^| findstr LISTENING') DO taskkill /F /PID %P"; //$NON-NLS-1$ |
183 | 184 |
Log.finest("Executing command: " + cmd); |
184 | 185 |
|
... | ... | |
193 | 194 |
p.waitFor(); |
194 | 195 |
started = false; |
195 | 196 |
} catch (IOException e) { |
196 |
Log.severe("Error: " + Log.toString(e));
|
|
197 |
Log.warning("Error: " + Log.toString(e));
|
|
197 | 198 |
try { |
198 | 199 |
|
199 | 200 |
String cmd = NLS.bind("cmd /c FOR /F \"tokens=5 delims= \" %P IN (''netstat -ano ^| findstr :{0} ^| findstr LISTENING'') DO tskill %P", RPreferences.getInstance().getInt(RPreferences.PORT)); //$NON-NLS-1$ |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RWorkspace.java (revision 3170) | ||
---|---|---|
516 | 516 |
// connection.close(); // No: invoquing "close()" make |
517 | 517 |
// "shutdown()" to throw a "not connected" exception. |
518 | 518 |
connection.shutdown(); |
519 |
// TODO test if Rserve connection is actually closed connection.isConnected(); |
Formats disponibles : Unified diff