Revision 1137 tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZImport.groovy

XTZImport.groovy (revision 1137)
9 9
import org.eclipse.core.runtime.IProgressMonitor;
10 10
import org.txm.utils.xml.DomUtils;
11 11
import org.txm.metadatas.Metadatas
12
import org.txm.objects.BaseParameters
13 12
import org.txm.utils.io.FileCopy;
14 13
import org.txm.*
15 14
import org.txm.objects.*
......
120 119

  
121 120
	public static void main(String[] args) {
122 121

  
123
		long start = System.currentTimeMillis()
124

  
125
		String userDir = System.getProperty("user.home")
126
		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
127
		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
128
		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
129
		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
130
		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
131
		//Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File("C:\\Program Files\\treetagger\\models"));//for Windows
132
		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(userDir, "TXM"));
133

  
134
		//File importParametersFile = new File("/home/mdecorde/xml/brown-for-xtz/import.xml");
135
		//		File importParametersFile = new File("/home/mdecorde/xml/qgraalc/qgraal_cw/import.xml"); // new import
136
		//File importParametersFile = new File("/home/mdecorde/TXM/corpora/QGRAALXTZ/import.xml"); // corpus update
137
		//		File importParametersFile = new File("/home/mdecorde/xml/annotation/import.xml"); // new import
138
		//File importParametersFile = new File("/home/mdecorde/xml/baiptest/import.xml"); // new import
139
		//File importParametersFile = new File("/home/mdecorde/TXM/corpora/BAIP/import.xml"); // corpus update
140
		File importParametersFile = new File("/home/mdecorde/xml/xtzsmall/import.xml");
141
		BaseParameters b = new BaseParameters(importParametersFile);
142
		b.getKeyValueParameters().put(ImportKeys.CLEAN, "false")
143
		b.getKeyValueParameters().put(ImportKeys.MULTITHREAD, "false")
144
		b.getKeyValueParameters().put(ImportKeys.DEBUG, "true")
145
		b.getKeyValueParameters().put(ImportKeys.UPDATECORPUS, "false")
146

  
147
		XTZImport i = new XTZImport(b);
148
		i.start();
149
		
150
		println "Done: "+i.isSuccessful
151

  
152
		long end = System.currentTimeMillis()
153
		println "TIME: "+(end-start)
122
//		long start = System.currentTimeMillis()
123
//
124
//		String userDir = System.getProperty("user.home")
125
//		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
126
//		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
127
//		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
128
//		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
129
//		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
130
//		//Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File("C:\\Program Files\\treetagger\\models"));//for Windows
131
//		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(userDir, "TXM"));
132
//
133
//		//File importParametersFile = new File("/home/mdecorde/xml/brown-for-xtz/import.xml");
134
//		//		File importParametersFile = new File("/home/mdecorde/xml/qgraalc/qgraal_cw/import.xml"); // new import
135
//		//File importParametersFile = new File("/home/mdecorde/TXM/corpora/QGRAALXTZ/import.xml"); // corpus update
136
//		//		File importParametersFile = new File("/home/mdecorde/xml/annotation/import.xml"); // new import
137
//		//File importParametersFile = new File("/home/mdecorde/xml/baiptest/import.xml"); // new import
138
//		//File importParametersFile = new File("/home/mdecorde/TXM/corpora/BAIP/import.xml"); // corpus update
139
//		File importParametersFile = new File("/home/mdecorde/xml/xtzsmall/import.xml");
140
//		BaseParameters b = new BaseParameters(importParametersFile);
141
//		b.getKeyValueParameters().put(ImportKeys.CLEAN, "false")
142
//		b.getKeyValueParameters().put(ImportKeys.MULTITHREAD, "false")
143
//		b.getKeyValueParameters().put(ImportKeys.DEBUG, "true")
144
//		b.getKeyValueParameters().put(ImportKeys.UPDATECORPUS, "false")
145
//
146
//		XTZImport i = new XTZImport(b);
147
//		i.start();
148
//		
149
//		println "Done: "+i.isSuccessful
150
//
151
//		long end = System.currentTimeMillis()
152
//		println "TIME: "+(end-start)
154 153
	}
155 154
}

Also available in: Unified diff