Révision 1558
| tmp/org.txm.treetagger.core/src/org/txm/treetagger/core/TreeTaggerEngine.java (revision 1558) | ||
|---|---|---|
| 4 | 4 |
import java.util.HashMap; |
| 5 | 5 |
|
| 6 | 6 |
import org.eclipse.core.runtime.IProgressMonitor; |
| 7 |
import org.eclipse.osgi.util.NLS; |
|
| 7 | 8 |
import org.txm.annotation.core.AnnotationEngine; |
| 8 | 9 |
import org.txm.core.results.TXMResult; |
| 9 | 10 |
import org.txm.importer.xmltxm.Annotate; |
| 10 |
import org.txm.objects.Project; |
|
| 11 | 11 |
import org.txm.treetagger.core.preferences.TreeTaggerPreferences; |
| 12 |
import org.txm.utils.DeleteDir;
|
|
| 12 |
import org.txm.utils.logger.Log;
|
|
| 13 | 13 |
import org.txm.utils.treetagger.TreeTagger; |
| 14 | 14 |
|
| 15 | 15 |
public class TreeTaggerEngine extends AnnotationEngine {
|
| ... | ... | |
| 25 | 25 |
|
| 26 | 26 |
ttBinaryDirectory = new File(TreeTaggerPreferences.getInstance().getString(TreeTaggerPreferences.INSTALL_PATH)+"/bin/"); |
| 27 | 27 |
if (!ttBinaryDirectory.exists()) {
|
| 28 |
System.out.println("Error: path to TreeTagger is wrong: "+ttBinaryDirectory);
|
|
| 28 |
System.out.println(NLS.bind("** Error: path to TreeTagger software is wrong: {0}.", ttBinaryDirectory));
|
|
| 29 | 29 |
return false; |
| 30 | 30 |
} |
| 31 | 31 |
|
| 32 | 32 |
ttModelsDirectory = new File(TreeTaggerPreferences.getInstance().getString(TreeTaggerPreferences.MODELS_PATH)); |
| 33 | 33 |
if (!ttModelsDirectory.exists()) {
|
| 34 |
System.out.println("Error: path to TreeTagger path is wrong: "+ttModelsDirectory);
|
|
| 34 |
System.out.println(NLS.bind("** Error: path to TreeTagger models directory is wrong: {0}.", ttModelsDirectory));
|
|
| 35 | 35 |
return false; |
| 36 | 36 |
} |
| 37 | 37 |
|
| ... | ... | |
| 80 | 80 |
Annotate annotate = new Annotate(); |
| 81 | 81 |
Object p = parameters.get("lang");
|
| 82 | 82 |
if (p == null) {
|
| 83 |
System.out.println("Error: no 'lang' parameter given. Aborting TreeTagger annotation.");
|
|
| 83 |
System.out.println(NLS.bind("** Error: no 'lang' parameter given: {0}. Aborting TreeTagger annotation.", parameters));
|
|
| 84 | 84 |
return false; |
| 85 | 85 |
} |
| 86 | 86 |
String lang = p.toString(); |
| 87 |
|
|
| 87 |
if (!canAnnotateLang(lang)) {
|
|
| 88 |
return false; |
|
| 89 |
} |
|
| 88 | 90 |
return annotate.run(xmlFile, lang, binaryCorpusDirectory, xmlFile.getParentFile()); |
| 89 | 91 |
} |
| 90 | 92 |
|
| ... | ... | |
| 96 | 98 |
public boolean processDirectory(File xmlFilesDirectory, File binaryCorpusDirectory, HashMap<String, Object> parameters) {
|
| 97 | 99 |
Object p = parameters.get("langs");
|
| 98 | 100 |
if (p != null && p instanceof HashMap<?,?>) {
|
| 101 |
|
|
| 102 |
|
|
| 99 | 103 |
Annotate annotate = new Annotate(); |
| 100 | 104 |
HashMap<String, String> langs = (HashMap<String, String>) p; |
| 101 | 105 |
return annotate.run(binaryCorpusDirectory, new File(binaryCorpusDirectory, "txm"), langs); |
| 102 | 106 |
} else {
|
| 107 |
p = parameters.get("lang");
|
|
| 108 |
if (p == null) {
|
|
| 109 |
Log.severe(NLS.bind("** Error: no annotation language set to annotate the {0} directory.", xmlFilesDirectory));
|
|
| 110 |
return false; |
|
| 111 |
} |
|
| 112 |
String lang = p.toString(); |
|
| 113 |
if (!canAnnotateLang(lang)) {
|
|
| 114 |
return false; |
|
| 115 |
} |
|
| 103 | 116 |
return super.processDirectory(xmlFilesDirectory, binaryCorpusDirectory, parameters); |
| 104 | 117 |
} |
| 105 | 118 |
} |
| 106 | 119 |
|
| 120 |
public static boolean canAnnotateLang(String lang) {
|
|
| 121 |
|
|
| 122 |
File ttInstallDirectory = new File(TreeTaggerPreferences.getInstance().getString(TreeTaggerPreferences.INSTALL_PATH)); // default models directory is set in the Toolbox |
|
| 123 |
if (!ttInstallDirectory.exists()) {
|
|
| 124 |
System.out.println(NLS.bind("** Error: TreeTagger install directory not found at {0}", ttInstallDirectory));
|
|
| 125 |
return false; |
|
| 126 |
} |
|
| 127 |
File modelsDirectory = new File(TreeTaggerPreferences.getInstance().getString(TreeTaggerPreferences.MODELS_PATH)); // default models directory is set in the Toolbox |
|
| 128 |
File modelfile = new File(modelsDirectory, lang+".par"); |
|
| 129 |
if (!modelfile.exists()) {
|
|
| 130 |
System.out.println(NLS.bind("** Error: no {0} model file found for the {1} lang.", modelfile, lang));
|
|
| 131 |
return false; |
|
| 132 |
} |
|
| 133 |
return true; |
|
| 134 |
} |
|
| 135 |
|
|
| 107 | 136 |
@Override |
| 108 | 137 |
public boolean isAutomatic() {
|
| 109 | 138 |
return true; |
| ... | ... | |
| 115 | 144 |
|
| 116 | 145 |
@Override |
| 117 | 146 |
public String getDetails() {
|
| 118 |
return "binaries="+ttBinaryDirectory+" models="+ttModelsDirectory+" instances="+instances.toString();
|
|
| 147 |
return "TreeTagger files: binaries="+ttBinaryDirectory+" models="+ttModelsDirectory+" current instances="+instances.toString();
|
|
| 119 | 148 |
} |
| 120 | 149 |
} |
| tmp/org.txm.treetagger.core/src/org/txm/treetagger/core/preferences/TreeTaggerPreferences.java (revision 1558) | ||
|---|---|---|
| 12 | 12 |
import org.txm.core.preferences.TXMPreferences; |
| 13 | 13 |
import org.txm.utils.BundleUtils; |
| 14 | 14 |
import org.txm.utils.io.IOUtils; |
| 15 |
import org.txm.utils.logger.Log; |
|
| 15 | 16 |
|
| 16 | 17 |
/** |
| 17 | 18 |
* Default preferences initializer. |
| ... | ... | |
| 31 | 32 |
* contains the last bundle version setting the TreeTagger models directory |
| 32 | 33 |
*/ |
| 33 | 34 |
public static final String INSTALLED_MODELS_VERSION = "installed_models_version"; //$NON-NLS-1$ |
| 34 |
|
|
| 35 |
|
|
| 35 | 36 |
/** |
| 36 | 37 |
* Installation path. |
| 37 | 38 |
*/ |
| ... | ... | |
| 41 | 42 |
* Models path. |
| 42 | 43 |
*/ |
| 43 | 44 |
public static final String MODELS_PATH = "models_path"; //$NON-NLS-1$ |
| 44 |
|
|
| 45 |
|
|
| 45 | 46 |
//public static final String OPTIONS = "options"; //$NON-NLS-1$ |
| 46 |
|
|
| 47 |
|
|
| 47 | 48 |
public static final String OPTIONS_LEX = "lex"; //$NON-NLS-1$ |
| 48 | 49 |
public static final String OPTIONS_WC = "wc"; //$NON-NLS-1$ |
| 49 | 50 |
public static final String OPTIONS_UNKNOWN = "unknown"; //$NON-NLS-1$ |
| ... | ... | |
| 57 | 58 |
public static final String OPTIONS_ATG = "atg"; |
| 58 | 59 |
public static final String OPTIONS_ECW = "ecw"; |
| 59 | 60 |
public static final String OPTIONS_LT = "lt"; |
| 60 |
|
|
| 61 |
|
|
| 61 | 62 |
public static final String FIX_APOSTROPHES = "fix_apostrophes"; //$NON-NLS-1$ |
| 62 |
|
|
| 63 | 63 |
|
| 64 |
|
|
| 64 |
|
|
| 65 |
|
|
| 65 | 66 |
/** |
| 66 | 67 |
* Gets the instance. |
| 67 | 68 |
* @return the instance |
| ... | ... | |
| 73 | 74 |
return TXMPreferences.instances.get(TreeTaggerPreferences.class); |
| 74 | 75 |
} |
| 75 | 76 |
|
| 76 |
|
|
| 77 |
|
|
| 77 | 78 |
@Override |
| 78 | 79 |
public void initializeDefaultPreferences() {
|
| 79 | 80 |
super.initializeDefaultPreferences(); |
| 80 |
|
|
| 81 |
|
|
| 81 | 82 |
// Default preferences if no org.txm.treetagger.core fragment is found |
| 82 | 83 |
Preferences preferences = this.getDefaultPreferencesNode(); |
| 83 |
|
|
| 84 |
|
|
| 84 | 85 |
String installPath = "/usr/lib/treetagger"; //"System.getProperty("osgi.user.area") + "/TXM/treetagger"; //$NON-NLS-1$ //$NON-NLS-2$
|
| 85 | 86 |
if (System.getProperty("os.name").contains("Windows")) {
|
| 86 | 87 |
installPath = "C:/Program Files/TreeTagger"; |
| 87 | 88 |
} else if (System.getProperty("os.name").contains("Mac")) {
|
| 88 | 89 |
installPath = "/Applications/TreeTagger"; |
| 89 | 90 |
} |
| 90 |
|
|
| 91 |
|
|
| 91 | 92 |
preferences.put(INSTALL_PATH, installPath); |
| 92 | 93 |
preferences.put(MODELS_PATH, installPath + "/models"); //$NON-NLS-1$ |
| 93 | 94 |
preferences.putBoolean(FIX_APOSTROPHES, false); |
| 94 |
|
|
| 95 |
|
|
| 95 | 96 |
preferences.putBoolean(OPTIONS_DEBUG, false); |
| 96 | 97 |
preferences.putBoolean(OPTIONS_CAPHEURISTIC, false); |
| 97 | 98 |
preferences.putBoolean(OPTIONS_HYPHENHEURISTIC, false); |
| 98 | 99 |
preferences.putBoolean(OPTIONS_UNKNOWN, true); |
| 99 | 100 |
preferences.putBoolean(OPTIONS_PROB, false); |
| 100 |
|
|
| 101 |
|
|
| 101 | 102 |
// FIXME: need to validate this code + need to check if it's still useful |
| 102 | 103 |
String bversion = TreeTaggerPreferences.getInstance().getString(INSTALLED_BINARIES_VERSION); |
| 103 | 104 |
String mversion = TreeTaggerPreferences.getInstance().getString(INSTALLED_MODELS_VERSION); |
| 104 |
|
|
| 105 |
|
|
| 105 | 106 |
// if TXM is launch for the first time bversion and mversion valus are empty |
| 106 | 107 |
if (bversion == null || bversion.equals("") || mversion == null || mversion.equals("")) {
|
| 107 |
|
|
| 108 |
|
|
| 108 | 109 |
// Restore previous TreeTagger preferences |
| 109 | 110 |
File previousPreferenceFile = new File(System.getProperty("java.io.tmpdir"), "org.txm.rcp.prefs"); //$NON-NLS-1$ //$NON-NLS-2$
|
| 110 | 111 |
|
| ... | ... | |
| 118 | 119 |
Properties previousProperties = new Properties(); |
| 119 | 120 |
BufferedReader reader = IOUtils.getReader(previousPreferenceFile, "ISO-8859-1"); //$NON-NLS-1$ |
| 120 | 121 |
previousProperties.load(reader); |
| 121 |
|
|
| 122 |
|
|
| 122 | 123 |
String [] keys= {INSTALL_PATH, MODELS_PATH};
|
| 123 | 124 |
for (String k : keys) {
|
| 124 | 125 |
if (previousProperties.getProperty(previousProperties.getProperty(k)) != null) {
|
| ... | ... | |
| 126 | 127 |
TreeTaggerPreferences.getInstance().put(k, previousProperties.getProperty(k)); |
| 127 | 128 |
} |
| 128 | 129 |
} |
| 129 |
} |
|
| 130 |
catch (Exception e) {
|
|
| 130 |
} catch (Exception e) {
|
|
| 131 | 131 |
e.printStackTrace(); |
| 132 | 132 |
} |
| 133 | 133 |
} |
| 134 |
|
|
| 134 |
|
|
| 135 | 135 |
TreeTaggerPreferences.getInstance().put(INSTALLED_BINARIES_VERSION, "0.0.0"); |
| 136 | 136 |
TreeTaggerPreferences.getInstance().put(INSTALLED_MODELS_VERSION, "0.0.0"); |
| 137 |
|
|
| 137 |
|
|
| 138 | 138 |
bversion = TreeTaggerPreferences.getInstance().getString(INSTALLED_BINARIES_VERSION); |
| 139 | 139 |
mversion = TreeTaggerPreferences.getInstance().getString(INSTALLED_MODELS_VERSION); |
| 140 | 140 |
} |
| 141 |
|
|
| 141 |
|
|
| 142 | 142 |
// look for org.txm.treetagger.core.<osname> fragment |
| 143 | 143 |
String mfragmentid = "org.txm.treetagger.core.models"; |
| 144 | 144 |
String bfragmentid = "org.txm.treetagger.core"; |
| ... | ... | |
| 151 | 151 |
osname = "linux"; |
| 152 | 152 |
} |
| 153 | 153 |
bfragmentid += "."+osname; |
| 154 |
|
|
| 154 |
|
|
| 155 | 155 |
Version currentBVersion = new Version(bversion); |
| 156 | 156 |
Version currentMVersion = new Version(mversion); |
| 157 | 157 |
Version binariesFragmentVersion = BundleUtils.getBundleVersion(bfragmentid); |
| 158 | 158 |
if (binariesFragmentVersion != null && binariesFragmentVersion.compareTo(currentBVersion) >= 0) { // udpate binaries path !
|
| 159 |
System.out.print("Updating TreeTagger binaries path...");
|
|
| 160 |
String path = BundleUtils.getBundleLocation(bfragmentid);
|
|
| 161 |
if (path.startsWith("file:")) path = path.substring(5);
|
|
| 162 |
File binariesDir = new File(path, "res/"+osname);
|
|
| 163 |
new File(binariesDir, "bin/separate-punctuation").setExecutable(true); // linux&mac
|
|
| 164 |
new File(binariesDir, "bin/tree-tagger").setExecutable(true); // linux&mac
|
|
| 165 |
new File(binariesDir, "bin/train-tree-tagger").setExecutable(true); // linux&mac
|
|
| 166 |
preferences.put(INSTALL_PATH, binariesDir.getAbsolutePath());
|
|
| 167 |
TreeTaggerPreferences.getInstance().put(INSTALLED_BINARIES_VERSION, binariesFragmentVersion.toString());
|
|
| 168 |
System.out.println("Done.");
|
|
| 159 |
Log.fine("Updating TreeTagger binaries path...");
|
|
| 160 |
String path = BundleUtils.getBundleLocation(bfragmentid); |
|
| 161 |
if (path.startsWith("file:")) path = path.substring(5);
|
|
| 162 |
File binariesDir = new File(path, "res/"+osname); |
|
| 163 |
new File(binariesDir, "bin/separate-punctuation").setExecutable(true); // linux&mac |
|
| 164 |
new File(binariesDir, "bin/tree-tagger").setExecutable(true); // linux&mac |
|
| 165 |
new File(binariesDir, "bin/train-tree-tagger").setExecutable(true); // linux&mac |
|
| 166 |
preferences.put(INSTALL_PATH, binariesDir.getAbsolutePath()); |
|
| 167 |
TreeTaggerPreferences.getInstance().put(INSTALLED_BINARIES_VERSION, binariesFragmentVersion.toString()); |
|
| 168 |
Log.fine("Done.");
|
|
| 169 | 169 |
} |
| 170 |
|
|
| 170 |
|
|
| 171 | 171 |
Version modelsFragmentVersion = BundleUtils.getBundleVersion(mfragmentid); |
| 172 | 172 |
if (modelsFragmentVersion != null && modelsFragmentVersion.compareTo(currentMVersion) >= 0) { // udpate models path!
|
| 173 |
System.out.print("Updating TreeTagger models path...");
|
|
| 174 |
String path = BundleUtils.getBundleLocation(mfragmentid);
|
|
| 175 |
if (path.startsWith("file:")) path = path.substring(5);
|
|
| 176 |
File modelsDir = new File(path, "res/models");
|
|
| 177 |
preferences.put(MODELS_PATH, modelsDir.getAbsolutePath()); //$NON-NLS-1$
|
|
| 178 |
TreeTaggerPreferences.getInstance().put(INSTALLED_MODELS_VERSION, modelsFragmentVersion.toString());
|
|
| 179 |
System.out.println("Done.");
|
|
| 173 |
Log.fine("Updating TreeTagger models path...");
|
|
| 174 |
String path = BundleUtils.getBundleLocation(mfragmentid); |
|
| 175 |
if (path.startsWith("file:")) path = path.substring(5);
|
|
| 176 |
File modelsDir = new File(path, "res/models"); |
|
| 177 |
preferences.put(MODELS_PATH, modelsDir.getAbsolutePath()); //$NON-NLS-1$ |
|
| 178 |
TreeTaggerPreferences.getInstance().put(INSTALLED_MODELS_VERSION, modelsFragmentVersion.toString()); |
|
| 179 |
Log.fine("Done.");
|
|
| 180 | 180 |
} |
| 181 | 181 |
} |
| 182 | 182 |
} |
| tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/KRAnnotation.java (revision 1558) | ||
|---|---|---|
| 684 | 684 |
if (concordance != null) {
|
| 685 | 685 |
try {
|
| 686 | 686 |
if (annotManager != null && annotManager.deleteAnnotations(type, matches, job)) {
|
| 687 |
if (Log.getLevel().intValue() < Level.WARNING.intValue()) annotManager.checkData();
|
|
| 687 |
if (Log.getLevel().intValue() < Level.INFO.intValue()) annotManager.checkData();
|
|
| 688 | 688 |
concordance.reloadLines(editor.getTopLine(), editor.getBottomLine()+1); |
| 689 | 689 |
} else {
|
| 690 | 690 |
return; |
| ... | ... | |
| 808 | 808 |
// if (history != null && !history.get(type).contains(value_to_add)) |
| 809 | 809 |
// history.get(type).add(value_to_add); |
| 810 | 810 |
|
| 811 |
if (Log.getLevel().intValue() < Level.WARNING.intValue() && annotManager != null) {
|
|
| 811 |
if (Log.getLevel().intValue() < Level.INFO.intValue() && annotManager != null) {
|
|
| 812 | 812 |
annotManager.checkData(); |
| 813 | 813 |
} |
| 814 | 814 |
concordance.reloadCurrentLines(); |
| tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/WordAnnotationToolbar.java (revision 1558) | ||
|---|---|---|
| 235 | 235 |
// if (history != null && !history.get(type).contains(value_to_add)) |
| 236 | 236 |
// history.get(type).add(value_to_add); |
| 237 | 237 |
|
| 238 |
if (Log.getLevel().intValue() < Level.WARNING.intValue() && annotManager != null) {
|
|
| 238 |
if (Log.getLevel().intValue() < Level.INFO.intValue() && annotManager != null) {
|
|
| 239 | 239 |
annotManager.checkData(); |
| 240 | 240 |
} |
| 241 | 241 |
concordance.reloadCurrentLines(); |
| ... | ... | |
| 271 | 271 |
|
| 272 | 272 |
try {
|
| 273 | 273 |
if (annotManager != null && annotManager.deleteAnnotations(type, matches, job)) {
|
| 274 |
if (Log.getLevel().intValue() < Level.WARNING.intValue()) annotManager.checkData();
|
|
| 274 |
if (Log.getLevel().intValue() < Level.INFO.intValue()) annotManager.checkData();
|
|
| 275 | 275 |
concordance.reloadLines(editor.getTopLine(), editor.getBottomLine()+1); |
| 276 | 276 |
} else {
|
| 277 | 277 |
return; |
| tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/SimpleKRAnnotation.java (revision 1558) | ||
|---|---|---|
| 471 | 471 |
|
| 472 | 472 |
try {
|
| 473 | 473 |
if (annotManager != null && annotManager.deleteAnnotations(type, matches, job)) {
|
| 474 |
if (Log.getLevel().intValue() < Level.WARNING.intValue()) annotManager.checkData();
|
|
| 474 |
if (Log.getLevel().intValue() < Level.INFO.intValue()) annotManager.checkData();
|
|
| 475 | 475 |
editor.refresh(false); |
| 476 | 476 |
} else {
|
| 477 | 477 |
return; |
| ... | ... | |
| 592 | 592 |
}); |
| 593 | 593 |
} |
| 594 | 594 |
|
| 595 |
if (Log.getLevel().intValue() < Level.WARNING.intValue() && annotManager != null) {
|
|
| 595 |
if (Log.getLevel().intValue() < Level.INFO.intValue() && annotManager != null) {
|
|
| 596 | 596 |
annotManager.checkData(); |
| 597 | 597 |
} |
| 598 | 598 |
} catch (Exception e1) {
|
| tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/AnnotationWriter.java (revision 1558) | ||
|---|---|---|
| 59 | 59 |
*/ |
| 60 | 60 |
protected boolean writeTextAnnotationToSyMoGIH(String textid, File currentXMLFile, File currentXMLStandoffFile, File xmlStandOffDirectory) throws IOException, CqiServerError, CqiClientException, InvalidCqpIdException, XMLStreamException{
|
| 61 | 61 |
System.out.println(" text="+textid);
|
| 62 |
boolean show_debug = Log.getLevel().intValue() < Level.WARNING.intValue();
|
|
| 62 |
boolean show_debug = Log.getLevel().intValue() < Level.INFO.intValue();
|
|
| 63 | 63 |
|
| 64 | 64 |
AnnotationSyMoGIHWriter annotationstdoff = new AnnotationSyMoGIHWriter(textid, currentXMLFile, xmlStandOffDirectory, types, show_debug); |
| 65 | 65 |
|
| ... | ... | |
| 243 | 243 |
System.out.println(segmentAnnotations); |
| 244 | 244 |
System.out.println(tokenAnnotations); |
| 245 | 245 |
|
| 246 |
boolean show_debug = Log.getLevel().intValue() < Level.WARNING.intValue();
|
|
| 246 |
boolean show_debug = Log.getLevel().intValue() < Level.INFO.intValue();
|
|
| 247 | 247 |
AnnotationInjector annotationInjector = new AnnotationInjector(xmlFile, segmentAnnotations, tokenAnnotations, text_start_position, show_debug); |
| 248 | 248 |
|
| 249 | 249 |
File tmpfile = new File(tmpXMLTXMDirectory, xmlFile.getName()); |
| tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/storage/temporary/TemporaryAnnotationManager.java (revision 1558) | ||
|---|---|---|
| 45 | 45 |
properties.put("javax.persistence.jdbc.driver", "org.hsqldb.jdbcDriver");
|
| 46 | 46 |
|
| 47 | 47 |
String urlProperty = "jdbc:hsqldb:file:"+path+";shutdown=true;hsqldb.write_delay=false;hsqldb.lock_file=false;"; |
| 48 |
if (Log.getLevel().intValue() < Level.WARNING.intValue()) {
|
|
| 48 |
if (Log.getLevel().intValue() < Level.INFO.intValue()) {
|
|
| 49 | 49 |
urlProperty += ""; |
| 50 | 50 |
} else {
|
| 51 | 51 |
urlProperty += "hsqldb.applog=0;hsqldb.sqllog=0"; |
| ... | ... | |
| 55 | 55 |
properties.put(PersistenceUnitProperties.DDL_GENERATION_MODE, "database"); |
| 56 | 56 |
properties.put(PersistenceUnitProperties.DDL_GENERATION, "create-or-extend-tables"); // create&update table if needed |
| 57 | 57 |
|
| 58 |
if (Log.getLevel().intValue() < Level.WARNING.intValue()) {
|
|
| 59 |
properties.put(PersistenceUnitProperties.LOGGING_LEVEL, "WARNING");
|
|
| 58 |
if (Log.getLevel().intValue() < Level.INFO.intValue()) {
|
|
| 59 |
properties.put(PersistenceUnitProperties.LOGGING_LEVEL, "INFO");
|
|
| 60 | 60 |
properties.put(PersistenceUnitProperties.LOGGING_PARAMETERS, "true"); |
| 61 | 61 |
} else {
|
| 62 | 62 |
properties.put(PersistenceUnitProperties.LOGGING_LEVEL, "OFF"); |
| tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/repository/KnowledgeRepository.java (revision 1558) | ||
|---|---|---|
| 82 | 82 |
//properties.put(PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML, "/home/mdecorde/workspace079/org.txm.annotation.core/META-INF"); |
| 83 | 83 |
// //properties.put("javax.persistence.jdbc.driver", "org.hsqldb.jdbcDriver");
|
| 84 | 84 |
String urlProperty = "jdbc:hsqldb:file:"+dbPath+"/db;shutdown=true;hsqldb.lock_file=false;"; |
| 85 |
if (Log.getLevel().intValue() < Level.WARNING.intValue()) {
|
|
| 85 |
if (Log.getLevel().intValue() < Level.INFO.intValue()) {
|
|
| 86 | 86 |
urlProperty += ""; |
| 87 | 87 |
} else {
|
| 88 | 88 |
urlProperty += "hsqldb.applog=0;hsqldb.sqllog=0"; |
| tmp/org.txm.annotation.core/src/org/txm/annotation/core/AnnotationEngine.java (revision 1558) | ||
|---|---|---|
| 5 | 5 |
import java.util.HashMap; |
| 6 | 6 |
|
| 7 | 7 |
import org.txm.core.engines.Engine; |
| 8 |
import org.txm.stat.utils.ConsoleProgressBar; |
|
| 8 | 9 |
|
| 9 | 10 |
public abstract class AnnotationEngine implements Engine {
|
| 10 | 11 |
|
| ... | ... | |
| 49 | 50 |
return false; |
| 50 | 51 |
} |
| 51 | 52 |
boolean ret = true; |
| 53 |
ConsoleProgressBar cpb = new ConsoleProgressBar(files.length); |
|
| 52 | 54 |
for (File xmlFile : files) {
|
| 53 | 55 |
ret = ret && processFile(xmlFile, binaryCorpusDirectory, parameters); |
| 56 |
cpb.tick(); |
|
| 54 | 57 |
} |
| 58 |
cpb.done(); |
|
| 55 | 59 |
return ret; |
| 56 | 60 |
} |
| 57 | 61 |
} |
| tmp/org.txm.treetagger.binaries.feature/feature.xml (revision 1558) | ||
|---|---|---|
| 1 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 | 2 |
<feature |
| 3 | 3 |
id="org.txm.treetagger.binaries.feature" |
| 4 |
label="TreeTagger" |
|
| 4 |
label="TreeTagger software"
|
|
| 5 | 5 |
version="1.0.0.qualifier" |
| 6 | 6 |
provider-name="Textometrie.org"> |
| 7 | 7 |
|
| 8 | 8 |
<description url="http://www.example.com/description"> |
| 9 |
Install TreeTagger / Installation TreeTagger
|
|
| 9 |
Install TreeTagger software / Installation du logiciel TreeTagger
|
|
| 10 | 10 |
</description> |
| 11 | 11 |
|
| 12 | 12 |
<copyright url="http://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/"> |
| tmp/org.txm.dictionary.rcp/src/org/txm/dictionary/functions/jpa/Dictionary.java (revision 1558) | ||
|---|---|---|
| 265 | 265 |
properties.put(PersistenceUnitProperties.CLASSLOADER, Toolbox.class.getClassLoader()); |
| 266 | 266 |
properties.put("javax.persistence.jdbc.driver", "org.hsqldb.jdbcDriver");
|
| 267 | 267 |
|
| 268 |
if (Log.getLevel().intValue() < Level.WARNING.intValue()) {
|
|
| 268 |
if (Log.getLevel().intValue() < Level.INFO.intValue()) {
|
|
| 269 | 269 |
properties.put(PersistenceUnitProperties.LOGGING_LEVEL, "WARNING"); |
| 270 | 270 |
properties.put(PersistenceUnitProperties.LOGGING_PARAMETERS, "true"); |
| 271 | 271 |
} else {
|
| ... | ... | |
| 275 | 275 |
|
| 276 | 276 |
|
| 277 | 277 |
String urlProperty = "jdbc:hsqldb:file:"+directory.getAbsolutePath()+"/"+name+";shutdown=true"; |
| 278 |
if (Log.getLevel().intValue() < Level.WARNING.intValue()) {
|
|
| 278 |
if (Log.getLevel().intValue() < Level.INFO.intValue()) {
|
|
| 279 | 279 |
urlProperty += ""; |
| 280 | 280 |
} else {
|
| 281 | 281 |
urlProperty += "hsqldb.applog=0;hsqldb.sqllog=0"; |
| tmp/org.txm.core/src/java/org/txm/importer/ApplyXsl2.java (revision 1558) | ||
|---|---|---|
| 397 | 397 |
outdir.mkdir(); |
| 398 | 398 |
if (xslFile.exists()) {
|
| 399 | 399 |
ApplyXsl2 builder = new ApplyXsl2(xslFile); |
| 400 |
boolean debug = Log.getLevel().intValue() < Level.WARNING.intValue();
|
|
| 400 |
boolean debug = Log.getLevel().intValue() < Level.INFO.intValue();
|
|
| 401 | 401 |
if (debug) {
|
| 402 | 402 |
builder.setDebug(true); |
| 403 | 403 |
System.out.println("Debug mode enabled.");
|
| tmp/org.txm.core/src/java/org/txm/importer/xtz/ImportModule.java (revision 1558) | ||
|---|---|---|
| 73 | 73 |
corpusName = project.getName(); |
| 74 | 74 |
//this.debug = "true".equals(project.getKeyValueParameters().get(ImportKeys.DEBUG)); |
| 75 | 75 |
|
| 76 |
if (Log.getLevel().intValue() < Level.WARNING.intValue()) {
|
|
| 76 |
if (Log.getLevel().intValue() < Level.INFO.intValue()) {
|
|
| 77 | 77 |
debug = true; |
| 78 | 78 |
} |
| 79 | 79 |
this.multithread = project.getDoMultiThread(); |
| tmp/org.txm.core/src/java/org/txm/stat/utils/ConsoleProgressBar.java (revision 1558) | ||
|---|---|---|
| 9 | 9 |
double progress_per_tick = 1.0d; |
| 10 | 10 |
int point_progress = 0; |
| 11 | 11 |
boolean done = false; |
| 12 |
String mode = "%"; |
|
| 12 |
String mode = "%%% ";
|
|
| 13 | 13 |
public ConsoleProgressBar(long amount) {
|
| 14 | 14 |
start(amount); |
| 15 | 15 |
} |
| ... | ... | |
| 21 | 21 |
progress_per_tick = 100f / amount; |
| 22 | 22 |
|
| 23 | 23 |
if (amount <= 100L) {
|
| 24 |
mode = " ";
|
|
| 24 |
mode = String.format("%03d ", amount);
|
|
| 25 | 25 |
progress_per_tick = 1; |
| 26 | 26 |
} |
| 27 | 27 |
} |
| tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyScriptedImportEngine.java (revision 1558) | ||
|---|---|---|
| 56 | 56 |
Log.severe("Error: TreeTagger annotation engine is not ready please check TXM > Advance > TAL > TreeTagger preferences. Aborting");
|
| 57 | 57 |
return Status.CANCEL_STATUS; |
| 58 | 58 |
} |
| 59 |
|
|
| 59 | 60 |
} |
| 60 | 61 |
|
| 61 | 62 |
if (project.getDoUpdate()) {
|
| ... | ... | |
| 103 | 104 |
binding.setProperty("projectBinding", project); //$NON-NLS-1$
|
| 104 | 105 |
binding.setProperty("monitor", new GroovyProgressMonitor(monitor)); //$NON-NLS-1$
|
| 105 | 106 |
|
| 106 |
boolean logLevel = Log.getLevel().intValue() < Level.WARNING.intValue();
|
|
| 107 |
boolean logLevel = Log.getLevel().intValue() < Level.INFO.intValue();
|
|
| 107 | 108 |
binding.setProperty("debug", logLevel); //$NON-NLS-1$
|
| 108 | 109 |
binding.setProperty("readyToLoad", Boolean.FALSE); //$NON-NLS-1$
|
| 109 | 110 |
//System.out.println("script="+script);
|
| tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/sql/HSQLFunctions.groovy (revision 1558) | ||
|---|---|---|
| 54 | 54 |
this.path = path; |
| 55 | 55 |
|
| 56 | 56 |
String urlProperty = "jdbc:hsqldb:file:"+path+"/db;shutdown=true;hsqldb.write_delay=false;" |
| 57 |
if (Log.getLevel().intValue() < Level.WARNING.intValue()) {
|
|
| 57 |
if (Log.getLevel().intValue() < Level.INFO.intValue()) {
|
|
| 58 | 58 |
urlProperty += ""; |
| 59 | 59 |
} else {
|
| 60 | 60 |
urlProperty += "hsqldb.applog=0;hsqldb.sqllog=0"; |
Formats disponibles : Unified diff