Révision 2554
tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyScriptedImportEngine.java (revision 2554) | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.io.File; |
4 | 4 |
import java.util.ArrayList; |
5 |
import java.util.Arrays; |
|
5 | 6 |
import java.util.Collection; |
6 | 7 |
import java.util.List; |
7 | 8 |
import java.util.logging.Level; |
... | ... | |
84 | 85 |
TXMResult child = project.getChildren().get(0); |
85 | 86 |
child.delete(); |
86 | 87 |
} |
88 |
System.out.println("TXM FILES: " + Arrays.asList(new File(project.getProjectDirectory(), "txm/" + project.getName()).list())); |
|
87 | 89 |
} |
88 | 90 |
|
89 | 91 |
// the binary directory which is going to be created |
... | ... | |
142 | 144 |
// Log.info(GroovyMessages.restartingToolboxSearchengines); |
143 | 145 |
// Toolbox.getEngineManager(EngineType.SEARCH).restartEngines(); |
144 | 146 |
if (project.getDoUpdate()) { |
145 |
Log.info(NLS.bind(TXMCoreMessages.corpusImportDoneInP0, ExecTimer.stop()));
|
|
147 |
Log.info(NLS.bind(TXMCoreMessages.corpusUpdateDoneInP0, ExecTimer.stop()));
|
|
146 | 148 |
} |
147 | 149 |
else { |
148 |
Log.info(NLS.bind(TXMCoreMessages.corpusUpdateDoneInP0, ExecTimer.stop()));
|
|
150 |
Log.info(NLS.bind(TXMCoreMessages.corpusImportDoneInP0, ExecTimer.stop()));
|
|
149 | 151 |
} |
150 | 152 |
|
151 | 153 |
} |
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xml/xmlLoader.groovy (revision 2554) | ||
---|---|---|
119 | 119 |
if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); } |
120 | 120 |
if (MONITOR != null) MONITOR.worked(1, "APPLYING XSL") |
121 | 121 |
if (xsl != null && xslParams != null && xsl.trim().length() > 0) { |
122 |
new File(binDir, "src").deleteDir() // remove old outputed files if any |
|
122 | 123 |
if (ApplyXsl2.processImportSources(new File(xsl), srcDir, new File(binDir, "src"), xslParams)) |
123 | 124 |
// return; // error during process |
124 | 125 |
srcDir = new File(binDir, "src"); |
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/importer.groovy (revision 2554) | ||
---|---|---|
176 | 176 |
//TOKENIZE |
177 | 177 |
println "Tokenizing "+files.length+" files from $txmDir" |
178 | 178 |
File tokenizedDir = new File(binDir, "tokenized") |
179 |
tokenizedDir.deleteDir() |
|
179 |
tokenizedDir.deleteDir() // delete previous outputed files
|
|
180 | 180 |
tokenizedDir.mkdir() |
181 | 181 |
cpb = new ConsoleProgressBar(files.length) |
182 | 182 |
for (File pfile : files) { |
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/transcriberLoader.groovy (revision 2554) | ||
---|---|---|
166 | 166 |
if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); } |
167 | 167 |
if (MONITOR != null) MONITOR.worked(1, "XSL") |
168 | 168 |
if (xsl != null && xsl.trim().length() > 0) { |
169 |
new File(binDir, "src").deleteDir() // delete previous outputed files |
|
169 | 170 |
if (ApplyXsl2.processImportSources(new File(xsl), srcDir, new File(binDir, "src"))) |
170 | 171 |
srcDir = new File(binDir, "src"); |
171 | 172 |
println "" |
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/txt/txtLoader.groovy (revision 2554) | ||
---|---|---|
165 | 165 |
Collections.sort(filelist); |
166 | 166 |
def second = 0 |
167 | 167 |
|
168 |
println "Paginating "+filelist.size()+" texts" |
|
169 | 168 |
ConsoleProgressBar cpb = new ConsoleProgressBar(filelist.size()); |
170 | 169 |
for (File srcfile : filelist) { |
171 | 170 |
cpb.tick() |
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/txt/compiler.groovy (revision 2554) | ||
---|---|---|
211 | 211 |
} |
212 | 212 |
|
213 | 213 |
//1- Transform into CQP file |
214 |
println("Compiling "+txmDir.listFiles().length+" files") |
|
215 | 214 |
XMLTXM2CQP cqpbuilder = null; |
216 | 215 |
cqpFile.delete() |
217 | 216 |
ArrayList<File> files = txmDir.listFiles(); |
... | ... | |
247 | 246 |
cwbEn.setDebug(debug); |
248 | 247 |
cwbMa.setDebug(debug); |
249 | 248 |
|
250 |
if(cqpbuilder == null)
|
|
249 |
if (cqpbuilder == null) {
|
|
251 | 250 |
return false; |
251 |
} |
|
252 | 252 |
|
253 | 253 |
List<String> pAttributesList = cqpbuilder.getpAttributs(); // use last text s and p attributes |
254 | 254 |
List<String> sAttributesList = cqpbuilder.getsAttributs(); |
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/txt/importer.groovy (revision 2554) | ||
---|---|---|
59 | 59 |
*/ |
60 | 60 |
public static boolean run(File srcDir, File binDir, File txmDir, String encoding, List<String> suffixes, String basename, String lang) |
61 | 61 |
{ |
62 |
|
|
62 |
|
|
63 |
File stokenizedDir = new File(binDir,"stokenized"); |
|
64 |
stokenizedDir.deleteDir(); |
|
65 |
stokenizedDir.mkdir(); |
|
63 | 66 |
File ptokenizedDir = new File(binDir,"ptokenized"); |
64 | 67 |
ptokenizedDir.deleteDir(); |
65 | 68 |
ptokenizedDir.mkdir(); |
Formats disponibles : Unified diff