Revision 479 tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/TextTranscription2TRS.groovy

TextTranscription2TRS.groovy (revision 479)
21 21

  
22 22
package org.txm.macro.transcription
23 23

  
24
import javax.xml.stream.*
25

  
26 24
import org.kohsuke.args4j.*
27
import org.txm.doc.*
28
import org.txm.importer.*
29
import org.txm.importer.filters.*
30
import org.txm.rcp.swt.widget.parameters.*
31 25

  
26
import groovy.transform.Field
27

  
28
import org.txm.rcpapplication.swt.widget.parameters.*
29
import org.txm.utils.xml.DomUtils;
30
import org.w3c.tidy.Tidy
31
import org.txm.doc.*;
32

  
33
import javax.xml.stream.*;
34

  
35
import java.util.HashMap;
36
import java.util.List;
37

  
38
import org.txm.importer.*;
39
import org.xml.sax.Attributes;
40
import org.txm.importer.filters.*;
41

  
42
import java.io.File;
43
import java.io.IOException;
44
import java.util.ArrayList;
45

  
46
import javax.xml.parsers.SAXParserFactory;
47
import javax.xml.parsers.ParserConfigurationException;
48
import javax.xml.parsers.SAXParser;
49

  
50
import java.net.URL;
51

  
52
import org.xml.sax.InputSource;
53
import org.xml.sax.helpers.DefaultHandler;
54

  
55
import java.text.DecimalFormat;
56
import java.text.ParseException;
57
import java.text.SimpleDateFormat;
58
import java.util.Date;
59

  
32 60
class TextTranscription2TRS {
33 61
	boolean debug = false;
34 62
	boolean isDirectory = false;
......
103 131
		int delta = work / 5
104 132
		println "** Processing $docFile file"
105 133
		String filename = docFile.getName()
106
		int idx = filename.indexOf(".")
134
		int idx = filename.lastIndexOf(".")
107 135
		if (idx < 0) return false;
108 136
		String ext = filename.substring(idx)
109 137
		filename = filename.substring(0, idx)
......
129 157
			}
130 158
			if (!ret) return ret;
131 159
		} else { // the document is already a TXT file
132
			org.txm.utils.io.FileCopy.copy(docFile, txtFile)
160
			org.txm.utils.FileCopy.copy(docFile, txtFile)
133 161
			ret = true
134 162
		}
135 163

  

Also available in: Unified diff