Révision 1371
tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/srcmf/srcmfLoader.groovy (revision 1371) | ||
---|---|---|
54 | 54 |
debug = true |
55 | 55 |
params = new BaseParameters(new File(userDir, "xml/slethgier/import.xml")) |
56 | 56 |
params.load() |
57 |
if (!org.txm.Toolbox.isInitialized()) { |
|
58 |
Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM")); |
|
59 |
Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger")); |
|
60 |
Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models")); |
|
61 |
Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8"); |
|
62 |
Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ","); |
|
63 |
Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\""); |
|
64 |
Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM")); |
|
65 |
} |
|
66 | 57 |
} |
67 | 58 |
if (params == null) { println "no parameters. Aborting"; return; } |
68 | 59 |
|
tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/tigersearch/tigersearchLoader.groovy (revision 1371) | ||
---|---|---|
52 | 52 |
debug = true |
53 | 53 |
params = new BaseParameters(new File(userDir, "xml/roland/import.xml")) |
54 | 54 |
params.load() |
55 |
if (!org.txm.Toolbox.isInitialized()) { |
|
56 |
|
|
57 |
TokenizerClasses.loadFromNode(params.getTokenizerElement(params.getCorpusElement())); |
|
58 |
Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM")); |
|
59 |
//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows |
|
60 |
Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger")); |
|
61 |
//Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File("C:\\Program Files\\treetagger"));//for Windows |
|
62 |
Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models")); |
|
63 |
Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8"); |
|
64 |
Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ","); |
|
65 |
Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\""); |
|
66 |
//Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File("C:\\Program Files\\treetagger\\models"));//for Windows |
|
67 |
Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM")); |
|
68 |
} |
|
69 | 55 |
} |
70 | 56 |
|
71 | 57 |
if (params == null) { println "no parameters. Aborting"; return; } |
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZImport.groovy (revision 1371) | ||
---|---|---|
116 | 116 |
} |
117 | 117 |
} |
118 | 118 |
} |
119 |
|
|
120 |
public static void main(String[] args) { |
|
121 |
|
|
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) |
|
153 |
} |
|
154 | 119 |
} |
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/teitxm/AnnotateWTC.groovy (revision 1371) | ||
---|---|---|
39 | 39 |
import org.txm.utils.DeleteDir; |
40 | 40 |
import org.txm.utils.LangDetector; |
41 | 41 |
import org.txm.utils.treetagger.TreeTagger |
42 |
import org.txm.treetagger.core.preferences.TreeTaggerPreferences |
|
42 | 43 |
|
43 |
// TODO: Auto-generated Javadoc |
|
44 | 44 |
/** |
45 | 45 |
* Annotate and replace the TEI-TXM files of the folder $rootDirFile/txm with TreeTagger. |
46 | 46 |
* creates $rootDirFile/interp and $rootDirFile/treetagger |
... | ... | |
107 | 107 |
if(debug) { |
108 | 108 |
println "rootDirFile "+binDir |
109 | 109 |
println "txmDir "+txmDir |
110 |
println "TREETAGGER INSTALL PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)
|
|
111 |
println "TREETAGGER MODELS PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH)
|
|
110 |
println "TREETAGGER INSTALL PATH : "+TreeTaggerPreferences.getInstance().getBoolean(TreeTaggerPreferences.INSTALL_PATH))
|
|
111 |
println "TREETAGGER MODELS PATH : "+TreeTaggerPreferences.getInstance().getBoolean(TreeTaggerPreferences.MODELS_PATH))
|
|
112 | 112 |
} |
113 | 113 |
|
114 | 114 |
//test if the Toolbox know TreeTagger |
115 |
if (!new File(Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/").exists())
|
|
115 |
if (!new File(TreeTaggerPreferences.getInstance().getBoolean(TreeTaggerPreferences.INSTALL_PATH), "bin/").exists())
|
|
116 | 116 |
{ |
117 |
println("Could not find TreeTagger binaries in "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/")
|
|
117 |
println("Could not find TreeTagger binaries in "+TreeTaggerPreferences.getInstance().getBoolean(TreeTaggerPreferences.INSTALL_PATH),"bin/")
|
|
118 | 118 |
return false; |
119 | 119 |
} |
120 | 120 |
|
... | ... | |
127 | 127 |
List<File> files = txmDir.listFiles() |
128 | 128 |
|
129 | 129 |
// get model file and check it |
130 |
File modelfile = new File(Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH), modelfilename);
|
|
130 |
File modelfile = new File(TreeTaggerPreferences.getInstance().getBoolean(TreeTaggerPreferences.MODELS_PATH), modelfilename);
|
|
131 | 131 |
if (debug) |
132 | 132 |
println "model file : "+modelfile; |
133 | 133 |
|
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/teitxm/Annotate.groovy (revision 1371) | ||
---|---|---|
108 | 108 |
File modelsDirectory; |
109 | 109 |
|
110 | 110 |
public Annotate() { |
111 |
modelsDirectory = new File(Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH)); // default models directory is set in the Toolbox
|
|
111 |
modelsDirectory = new File(TreeTaggerPreferences.getInstance().getBoolean(TreeTaggerPreferences.INSTALL_PATH)); // default models directory is set in the Toolbox
|
|
112 | 112 |
} |
113 | 113 |
|
114 | 114 |
/** |
... | ... | |
267 | 267 |
if (debug) { |
268 | 268 |
println "rootDirFile "+binDir |
269 | 269 |
println "txmDir "+txmDir |
270 |
println "TREETAGGER INSTALL PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)
|
|
271 |
println "TREETAGGER MODELS PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH)
|
|
270 |
println "TREETAGGER INSTALL PATH : "+TreeTaggerPreferences.getInstance().getBoolean(TreeTaggerPreferences.INSTALL_PATH)
|
|
271 |
println "TREETAGGER MODELS PATH : "+TreeTaggerPreferences.getInstance().getBoolean(TreeTaggerPreferences.MODELS_PATH)
|
|
272 | 272 |
} |
273 | 273 |
|
274 | 274 |
//test if the Toolbox know TreeTagger |
... | ... | |
310 | 310 |
|
311 | 311 |
if (cancelNow) return; |
312 | 312 |
|
313 |
File modelDirectory = new File(Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH));
|
|
313 |
File modelDirectory = new File(TreeTaggerPreferences.getInstance().getBoolean(TreeTaggerPreferences.MODELS_PATH));
|
|
314 | 314 |
if (!modelDirectory.exists()) { |
315 | 315 |
println "Skipping ANNOTATE: TreeTagger language model file directory not found: "+modelDirectory.getAbsolutePath(); |
316 | 316 |
return false; |
tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/AnnotateWTC.groovy (revision 1371) | ||
---|---|---|
36 | 36 |
import org.txm.importer.cwb.* |
37 | 37 |
import org.txm.objects.* |
38 | 38 |
import org.txm.stat.utils.ConsoleProgressBar |
39 |
import org.txm.treetagger.core.preferences.TreeTaggerPreferences |
|
39 | 40 |
import org.txm.utils.DeleteDir; |
40 | 41 |
import org.txm.utils.LangDetector; |
41 | 42 |
import org.txm.utils.io.IOUtils |
... | ... | |
108 | 109 |
if(debug) { |
109 | 110 |
println "rootDirFile "+binDir |
110 | 111 |
println "txmDir "+txmDir |
111 |
println "TREETAGGER INSTALL PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)
|
|
112 |
println "TREETAGGER MODELS PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH)
|
|
112 |
println "TREETAGGER INSTALL PATH : "+TreeTaggerPreferences.getInstance().getBoolean(TreeTaggerPreferences.INSTALL_PATH)
|
|
113 |
println "TREETAGGER MODELS PATH : "+TreeTaggerPreferences.getInstance().getBoolean(TreeTaggerPreferences.MODELS_PATH)
|
|
113 | 114 |
} |
114 | 115 |
|
115 | 116 |
//test if the Toolbox know TreeTagger |
... | ... | |
127 | 128 |
List<File> files = txmDir.listFiles(IOUtils.FILTER_HIDDEN) |
128 | 129 |
|
129 | 130 |
// get model file and check it |
130 |
File modelfile = new File(Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH), modelfilename);
|
|
131 |
File modelfile = new File(TreeTaggerPreferences.getInstance().getBoolean(TreeTaggerPreferences.MODELS_PATH), modelfilename);
|
|
131 | 132 |
if (debug) |
132 | 133 |
println "model file : "+modelfile; |
133 | 134 |
|
Formats disponibles : Unified diff