Statistics
| Revision:

root / tmp / org.txm.core / src / groovy / org / txm / importer / transcriber / TRSTestWorkflow.groovy @ 187

History | View | Annotate | Download (1.5 kB)

1
package org.txm.importer.transcriber
2

    
3
import org.txm.utils.FileCopy;
4

    
5
/**
6
 * Test and Fix workflow for the STDDAD master corpus
7
 * @author mdecorde
8
 *
9
 */
10

    
11
File rootDir = new File("/home/mdecorde/xml/leman/")
12
if (!rootDir.exists()) println "Error rootDir: "+rootDir;
13

    
14
File dtdFile = new File(rootDir, "trans-14.dtd")
15
File renamedTRSDir = new File(rootDir, "final 2012-03-26")
16
File corrTRSDir = new File(rootDir, "corr")
17
File okTRSDir = new File(rootDir, "ready")
18

    
19
corrTRSDir.delete();
20
corrTRSDir.mkdir();
21
FileCopy.copy(dtdFile, new File(corrTRSDir, dtdFile.getName()));
22
//okTRSDir.delete();
23
okTRSDir.mkdir();
24
FileCopy.copy(dtdFile, new File(okTRSDir, dtdFile.getName()));
25

    
26
println "1- FixTimming"
27
def files = renamedTRSDir.listFiles();
28
files.sort()
29
for (File trsFile : files) {
30
        if (!trsFile.getName().endsWith(".trs")) continue;
31
        println "FIX: "+trsFile
32
        File newTRSFile = new File(corrTRSDir, trsFile.getName())
33
        new FixTiming().fixTRS(trsFile, newTRSFile);
34
}
35

    
36
println "2- Validate"
37
files = corrTRSDir.listFiles();
38
files.sort()
39
for(File trsFile : files) {
40
        if(!trsFile.getName().endsWith(".trs")) continue;
41
        File newTRSFile = new File(okTRSDir, trsFile.getName())
42
        println "VALIDATE: "+trsFile
43
        if(ValidateTRS.checkTRS(trsFile))
44
                FileCopy.copy(trsFile, newTRSFile);
45
}
46
/*
47
println "3- FINALLY"
48
if (renamedTRSDir.listFiles().size() != corrTRSDir.listFiles().size) {
49
        println "Missing corr transcriptions"
50
        return;
51
}
52

53
if (corrTRSDir.listFiles().size() != okTRSDir.listFiles().size) {
54
        println "Missing ok transcriptions"
55
        return;
56
}
57
*/