Index: tmp/org.txm.analec.rcp/src/org/txm/analec/AnalecCorpora.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/AnalecCorpora.java	(revision 926)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/AnalecCorpora.java	(revision 927)
@@ -11,27 +11,27 @@
 import visuAnalec.vue.Vue;
 
 /**
- * Manages Analec corpus : the corpus are associated with TXM MainCorpus names
+ * Manages Analec corpus : the corpus are associated with TXM MainCorpus objects
  * 
  * @author mdecorde
  *
  */
 public class AnalecCorpora {
-	private static final HashMap<String, Corpus> corpora = new HashMap<String, Corpus>();
-	private static final HashMap<String, Vue> vues = new HashMap<String, Vue>();
+	private static final HashMap<MainCorpus, Corpus> corpora = new HashMap<MainCorpus, Corpus>();
+	private static final HashMap<MainCorpus, Vue> vues = new HashMap<MainCorpus, Vue>();
 
 	/**
 	 * Create the ec file if needed, store a reference to the corpus if not already done.
 	 * 
-	 * @param name
+	 * @param mcorpus
 	 * @return the Corpus loaded and stored
 	 */
-	public static Corpus getCorpus(String name) {
-		File fichierCorpus = new File(Toolbox.getTxmHomePath(), "corpora/"+name+"/analec/"+name+".ec"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		File fichierVue = new File(Toolbox.getTxmHomePath(), "corpora/"+name+"/analec/"+name+".ecv");
+	public static Corpus getCorpus(MainCorpus mcorpus) {
+		File fichierCorpus = new File(mcorpus.getBaseDirectory(), "analec/"+mcorpus+".ec"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		File fichierVue = new File(mcorpus.getBaseDirectory(), "analec/"+mcorpus+".ecv");
 		Corpus corpus = null;
-		if (AnalecCorpora.corpora.containsKey(name)) {
-			corpus = AnalecCorpora.corpora.get(name);
+		if (AnalecCorpora.corpora.containsKey(mcorpus)) {
+			corpus = AnalecCorpora.corpora.get(mcorpus);
 		} else {
 			corpus = new Corpus();
 			
@@ -49,9 +49,9 @@
 				}
 			}
 
-			AnalecCorpora.corpora.put(name, corpus);
+			AnalecCorpora.corpora.put(mcorpus, corpus);
 			
-			Vue vue = getVue(name);
+			Vue vue = getVue(mcorpus);
 			
 //TODO: does not work :( 
 			if (fichierVue.exists()) {
@@ -59,6 +59,10 @@
 					System.out.println("Warning: Fail to open corpus Vue file: "+fichierVue);
 					//return null;
 				}
+				String[] types = vue.getTypesUnitesAVoir();
+				if (types == null || types.length == 0) {
+					vue.retablirVueParDefaut();
+				}
 			} else {
 				if (!FichiersJava.enregistrerVue(vue, fichierVue)) {
 					System.out.println("Warning: Fail to create corpus Vue file: "+fichierVue);
@@ -70,10 +74,10 @@
 	}
 	
 	public static boolean isAnnotationStructureReady(org.txm.searchengine.cqp.corpus.Corpus corpus) {
-		return isAnnotationStructureReady(corpus.getName());
+		return isAnnotationStructureReady(corpus.getMainCorpus());
 	}
 	
-	public static boolean isAnnotationStructureReady(String name) {
+	public static boolean isAnnotationStructureReady(MainCorpus name) {
 		if (AnalecCorpora.corpora.containsKey(name)) {
 			return !AnalecCorpora.corpora.get(name).getStructure().isVide();
 		} else {
@@ -91,7 +95,7 @@
 	 * @param name
 	 * @return the corpus Vue
 	 */
-	public static Vue getVue(String name) {
+	public static Vue getVue(MainCorpus name) {
 		if (!vues.containsKey(name)) {
 			if (!corpora.containsKey(name)) {
 				getCorpus(name);
@@ -103,38 +107,39 @@
 		return vues.get(name);
 	}
 
-	public static boolean saveCorpus(String name) {
-		Corpus corpus = getCorpus(name);
-		Vue vue = getVue(name);
-		File dir = new File(Toolbox.getTxmHomePath(), "corpora/"+name+"/analec/"); //$NON-NLS-1$ //$NON-NLS-2$
+	public static boolean saveCorpus(MainCorpus mcorpus) {
+		Corpus corpus = getCorpus(mcorpus);
+		Vue vue = getVue(mcorpus);
+		File dir = new File(mcorpus.getBaseDirectory(), "analec/"); //$NON-NLS-1$ //$NON-NLS-2$
 		dir.mkdir();
-		File fichierCorpus = new File(dir,name+".ec"); //$NON-NLS-1$
-		File fichierVueCorpus = new File(dir,name+".ecv"); //$NON-NLS-1$
-		return FichiersJava.enregistrerCorpus(corpus, fichierCorpus) && FichiersJava.enregistrerVue(vue, fichierVueCorpus);
+		File fichierCorpus = new File(dir,mcorpus+".ec"); //$NON-NLS-1$
+		File fichierVueCorpus = new File(dir,mcorpus+".ecv"); //$NON-NLS-1$
+		return FichiersJava.enregistrerCorpus(corpus, fichierCorpus) 
+				&& FichiersJava.enregistrerVue(vue, fichierVueCorpus);
 	}
 
 	public static Vue getVue(Corpus corpus) {
-		for (String name : corpora.keySet()) {
-			if (corpora.get(name) == corpus) return vues.get(name);
+		for (MainCorpus mcorpus : corpora.keySet()) {
+			if (corpora.get(mcorpus) == corpus) return vues.get(mcorpus);
 		}
 		return null;
 	}
 
 	public static boolean saveCorpus(Corpus corpus) {
-		for (String name : corpora.keySet()) {
-			if (corpora.get(name) == corpus) return saveCorpus(name);
+		for (MainCorpus mcorpus : corpora.keySet()) {
+			if (corpora.get(mcorpus) == corpus) return saveCorpus(corpus);
 		}
 		return false;
 	}
 
-	public static void removeCorpus(String name) {
-		if (!vues.containsKey(name)) {vues.remove(name);}
-		if (!corpora.containsKey(name)) {corpora.remove(name);}
+	public static void removeCorpus(MainCorpus mcorpus) {
+		if (!vues.containsKey(mcorpus)) {vues.remove(mcorpus);}
+		if (!corpora.containsKey(mcorpus)) {corpora.remove(mcorpus);}
 	}
 
 	public static void revert(MainCorpus corpus) {
-		corpora.remove(corpus.getName());
-		vues.remove(corpus.getName());
+		corpora.remove(corpus);
+		vues.remove(corpus);
 		corpus.setIsModified(false);
 	}
 }
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/ImportGlozzAnnotations.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/ImportGlozzAnnotations.java	(revision 926)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/ImportGlozzAnnotations.java	(revision 927)
@@ -67,7 +67,7 @@
 		}
 		
 		MainCorpus mainCorpus = ((org.txm.searchengine.cqp.corpus.Corpus)first).getMainCorpus();
-		Corpus analecCorpus = AnalecCorpora.getCorpus(mainCorpus.getName());
+		Corpus analecCorpus = AnalecCorpora.getCorpus(mainCorpus);
 		analecCorpus.clearAll(); // remove all : annotations, structure
 		
 		System.out.println(Messages.ImportGlozzAnnotations_2+aamfile);
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveVue.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveVue.java	(revision 926)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveVue.java	(revision 927)
@@ -32,7 +32,7 @@
 		}
 		
 		MainCorpus mainCorpus = ((org.txm.searchengine.cqp.corpus.Corpus)first).getMainCorpus();
-		corpus = AnalecCorpora.getCorpus(mainCorpus.getName());
+		corpus = AnalecCorpora.getCorpus(mainCorpus);
 
 		File binaryCorpusDirectory = mainCorpus.getBaseDirectory();
 		File fichierVue = new File(binaryCorpusDirectory, "/analec/"+mainCorpus.getName()+".ecv"); //$NON-NLS-1$ //$NON-NLS-2$
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/ExportTEICorpus.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/ExportTEICorpus.java	(revision 926)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/ExportTEICorpus.java	(revision 927)
@@ -48,9 +48,8 @@
 			}
 			
 			final MainCorpus mainCorpus = ((org.txm.searchengine.cqp.corpus.Corpus)first).getMainCorpus();
-			final String name = mainCorpus.getName();
-			final Corpus analecCorpus = AnalecCorpora.getCorpus(name.toUpperCase());
-			final Vue vue = AnalecCorpora.getVue(name);
+			final Corpus analecCorpus = AnalecCorpora.getCorpus(mainCorpus);
+			final Vue vue = AnalecCorpora.getVue(mainCorpus);
 			outputDirectory.mkdirs();
 			JobHandler job = new JobHandler(mainCorpus.getName()+Messages.ExportTEICorpus_1) {
 				
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveStructure.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveStructure.java	(revision 926)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveStructure.java	(revision 927)
@@ -35,7 +35,7 @@
 	}
 	
 	public static boolean save(MainCorpus mainCorpus) {
-		Corpus corpus = AnalecCorpora.getCorpus(mainCorpus.getName());
+		Corpus corpus = AnalecCorpora.getCorpus(mainCorpus);
 
 		File binaryCorpusDirectory = mainCorpus.getBaseDirectory();
 		File fichierStructure = new File(binaryCorpusDirectory, "/analec/"+mainCorpus.getName()+".ecs"); //$NON-NLS-1$ //$NON-NLS-2$
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/ImportTEIAnnotations.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/ImportTEIAnnotations.java	(revision 926)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/ImportTEIAnnotations.java	(revision 927)
@@ -51,9 +51,8 @@
 			}
 			
 			final MainCorpus mainCorpus = ((org.txm.searchengine.cqp.corpus.Corpus)first).getMainCorpus();
-			final String name = mainCorpus.getName();
-			final Corpus analecCorpus = AnalecCorpora.getCorpus(name.toUpperCase());
-			final Vue vue = AnalecCorpora.getVue(name);
+			final Corpus analecCorpus = AnalecCorpora.getCorpus(mainCorpus);
+			final Vue vue = AnalecCorpora.getVue(mainCorpus);
 			
 			JobHandler job = new JobHandler(mainCorpus.getName()+Messages.ImportTEIAnnotations_1) {
 				
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveCorpus.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveCorpus.java	(revision 926)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveCorpus.java	(revision 927)
@@ -45,10 +45,9 @@
 	public static boolean save(final MainCorpus mainCorpus, ExecutionEvent event) {
 		File binaryCorpusDirectory = mainCorpus.getBaseDirectory();
 		File fichierCorpus = new File(binaryCorpusDirectory, "/analec/"+mainCorpus.getName()+".ec"); //$NON-NLS-1$ //$NON-NLS-2$
-		Corpus corpus = AnalecCorpora.getCorpus(mainCorpus.getName());
+		Corpus corpus = AnalecCorpora.getCorpus(mainCorpus);
 		System.out.println(Messages.SaveCorpus_3+corpus+Messages.SaveCorpus_1+fichierCorpus);
-
-		if (!FichiersJava.enregistrerCorpus(corpus, fichierCorpus)) {
+		if (!AnalecCorpora.saveCorpus(mainCorpus)) {
 			System.out.println(Messages.SaveCorpus_5);
 			return false;
 		}
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/ImportGlozzCorpus.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/ImportGlozzCorpus.java	(revision 926)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/ImportGlozzCorpus.java	(revision 927)
@@ -34,15 +34,15 @@
 
 
 
-//	@Option(name="aafile",usage="an example file", widget="File", required=true, def="text.aa")
-//	File aafile;
+	//	@Option(name="aafile",usage="an example file", widget="File", required=true, def="text.aa")
+	//	File aafile;
 
-//	@Option(name="acfile",usage="an example file", widget="File", required=true, def="annotations.ac")
-//	File acfile
-	
+	//	@Option(name="acfile",usage="an example file", widget="File", required=true, def="annotations.ac")
+	//	File acfile
+
 	@Option(name="glozzDirectory",usage="A folder containing the Glozz files: aa ac and aam", widget="Folder", required=true, def="glozz")
 	File glozzDirectory;
-	
+
 	@Option(name="aamfile",usage="The aam file to use", widget="File", required=true, def="model.aam")
 	File aamfile;
 	private String name;
@@ -75,12 +75,12 @@
 			DeleteDir.deleteDirectory(ecDir);
 			ecDir.mkdir();
 
-			
+
 			if (!srcDir.exists()) {
 				System.out.println(Messages.ImportGlozzCorpus_4);
 				return null;
 			}
-			
+
 			if (!ecDir.exists()) {
 				System.out.println(Messages.ImportGlozzCorpus_5);
 				return null;
@@ -112,7 +112,7 @@
 				System.out.println(Messages.ImportGlozzCorpus_10+glozzDirectory);
 				return false;
 			}
-			
+
 			System.out.println(Messages.ImportGlozzCorpus_11+glozzDirectory);
 			Arrays.sort(acFiles);
 			Arrays.sort(aaFiles);
@@ -122,34 +122,34 @@
 				String name = acFile.getName();
 				int idx = name.indexOf("."); //$NON-NLS-1$
 				if (idx > 0) name = name.substring(0, idx);
-				
+
 				File txtFile = new File(srcDir, name+".txt"); //$NON-NLS-1$
 				File ecFile = new File(ecDir, name+".ec"); //$NON-NLS-1$
 				Corpus tmpAnalecCorpus = new Corpus(); // need a temporary corpus
-				
+
 				if (!FichiersGlozz.importerGlozz(tmpAnalecCorpus, acFile, aaFile)) {
 					System.out.println(Messages.ImportGlozzCorpus_15);
 					return null;
 				}
-				
+
 				final String texte = tmpAnalecCorpus.getTexte();
-			    int debParag = 0;
-			    Integer[] finPars = tmpAnalecCorpus.getFinParagraphes();
-			    StringBuffer newTexte = new StringBuffer(texte.length() + finPars.length);
-			    for (int iParagraph = 0 ; iParagraph < finPars.length ; iParagraph++) {
-			    	newTexte.append(texte.substring(debParag, finPars[iParagraph])).append("\n"); //$NON-NLS-1$
-			    	debParag = finPars[iParagraph];
-			    }
-				
+				int debParag = 0;
+				Integer[] finPars = tmpAnalecCorpus.getFinParagraphes();
+				StringBuffer newTexte = new StringBuffer(texte.length() + finPars.length);
+				for (int iParagraph = 0 ; iParagraph < finPars.length ; iParagraph++) {
+					newTexte.append(texte.substring(debParag, finPars[iParagraph])).append("\n"); //$NON-NLS-1$
+					debParag = finPars[iParagraph];
+				}
+
 				IOUtils.write(txtFile, newTexte.toString()); // write the TXT file for TXM TXT import module
 				FichiersJava.enregistrerCorpus(tmpAnalecCorpus, ecFile); // write for later
-				
+
 				if (!txtFile.exists()) {
 					System.out.println(Messages.ImportGlozzCorpus_17);
 					return null;
 				}
 			}
-			
+
 			File paramFile = new File(srcDir, "import.xml"); //$NON-NLS-1$
 			BaseParameters.createEmptyParams(paramFile, name.toUpperCase());
 
@@ -177,54 +177,58 @@
 				return null;
 			}
 
-//			System.out.println("Waiting for import to finish...");
-//			job.join();
-//			System.out.println("Waiting for import done.");
-			
+			//			System.out.println("Waiting for import to finish...");
+			//			job.join();
+			//			System.out.println("Waiting for import done.");
+
 			JobHandler job2 = new JobHandler(Messages.ImportGlozzCorpus_24) {
-				
+
 				@Override
 				protected IStatus run(IProgressMonitor monitor) {
 					try {
-					Corpus analecCorpus = AnalecCorpora.getCorpus(name.toUpperCase());
-					analecCorpus.clearAll(); // remove all : annotations, structure
-					File[] ecFiles = ecDir.listFiles();
-					Arrays.sort(ecFiles);
-					for (File ecFile : ecFiles) {
-						FichiersJava.concatener(ecFile, analecCorpus);
-					}
-					
-					System.out.println(Messages.ImportGlozzCorpus_25+aamfile);
-					if (!FichiersGlozz.importerModeleGlozz(analecCorpus, aamfile)) {
-						System.out.println(Messages.ImportGlozzCorpus_26);
-						return null;
-					}
-//					
-//					System.out.println("Importing Glozz corpus from: "+acfile+" and "+aafile);
-//					if (!FichiersGlozz.importerGlozz(analecCorpus, acfile, aafile)) {
-//						System.out.println("Error while importing Glozz corpus.");
-//						return null;
-//					}
-					
-					System.out.println(Messages.ImportGlozzCorpus_27);
-					MainCorpus corpus = CorpusManager.getCorpusManager().getCorpus(name.toUpperCase());
-					AnalecCorpora.removeCorpus(corpus.getName()); // remove old corpus if any
-					
-					AnalecAnnotationReIndexer aari = new AnalecAnnotationReIndexer(corpus, analecCorpus);
-					if (!aari.process()) {
-						System.out.println(Messages.ImportGlozzCorpus_28);
-						return null;
-					}
-					
-					System.out.println(Messages.ImportGlozzCorpus_29);
-					AnalecCorpora.saveCorpus(analecCorpus);
-					AnalecCorpora.getVue(analecCorpus).retablirVueParDefaut();
-					System.out.println(Messages.ImportGlozzCorpus_30);
-					analecCorpus.setTexte(""); // free memory //$NON-NLS-1$
-					DeleteDir.deleteDirectory(ecDir); // cleaning
-					DeleteDir.deleteDirectory(srcDir); // cleaning
-					
-					return Status.OK_STATUS;
+						MainCorpus corpus = CorpusManager.getCorpusManager().getCorpus(name.toUpperCase());
+						if (corpus == null) {
+							System.out.println("The CQP corpus was not created. Aborting.");
+							return Status.CANCEL_STATUS;
+						}
+						Corpus analecCorpus = AnalecCorpora.getCorpus(corpus);
+						analecCorpus.clearAll(); // remove all : annotations, structure
+						File[] ecFiles = ecDir.listFiles();
+						Arrays.sort(ecFiles);
+						for (File ecFile : ecFiles) {
+							FichiersJava.concatener(ecFile, analecCorpus);
+						}
+
+						System.out.println(Messages.ImportGlozzCorpus_25+aamfile);
+						if (!FichiersGlozz.importerModeleGlozz(analecCorpus, aamfile)) {
+							System.out.println(Messages.ImportGlozzCorpus_26);
+							return Status.CANCEL_STATUS;
+						}
+						//					
+						//					System.out.println("Importing Glozz corpus from: "+acfile+" and "+aafile);
+						//					if (!FichiersGlozz.importerGlozz(analecCorpus, acfile, aafile)) {
+						//						System.out.println("Error while importing Glozz corpus.");
+						//						return null;
+						//					}
+
+						System.out.println(Messages.ImportGlozzCorpus_27);
+						AnalecCorpora.removeCorpus(corpus); // remove old corpus if any
+
+						AnalecAnnotationReIndexer aari = new AnalecAnnotationReIndexer(corpus, analecCorpus);
+						if (!aari.process()) {
+							System.out.println(Messages.ImportGlozzCorpus_28);
+							return Status.CANCEL_STATUS;
+						}
+
+						System.out.println(Messages.ImportGlozzCorpus_29);
+						AnalecCorpora.saveCorpus(analecCorpus);
+						AnalecCorpora.getVue(analecCorpus).retablirVueParDefaut();
+						System.out.println(Messages.ImportGlozzCorpus_30);
+						analecCorpus.setTexte(""); // free memory //$NON-NLS-1$
+						DeleteDir.deleteDirectory(ecDir); // cleaning
+						DeleteDir.deleteDirectory(srcDir); // cleaning
+
+						return Status.OK_STATUS;
 					} catch (Exception e) {
 						System.out.println(Messages.ImportGlozzCorpus_32+e.getLocalizedMessage());
 						Log.printStackTrace(e);
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/LoadVue.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/LoadVue.java	(revision 926)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/LoadVue.java	(revision 927)
@@ -44,7 +44,7 @@
 	
 	public boolean load(MainCorpus mainCorpus) {
 		System.out.println(Messages.LoadVue_1+mainCorpus.getName());
-		Vue vue = AnalecCorpora.getVue(mainCorpus.getName());
+		Vue vue = AnalecCorpora.getVue(mainCorpus);
 		if (!FichiersJava.ouvrirVue(vue)) {
 			System.out.println(Messages.LoadVue_2);
 			return false;
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/LoadStructure.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/LoadStructure.java	(revision 926)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/LoadStructure.java	(revision 927)
@@ -34,7 +34,7 @@
 		}
 		
 		MainCorpus mainCorpus = ((org.txm.searchengine.cqp.corpus.Corpus)first).getMainCorpus();
-		Corpus corpus = AnalecCorpora.getCorpus(mainCorpus.getName());
+		Corpus corpus = AnalecCorpora.getCorpus(mainCorpus);
 //		if (VisuStructure.isOpen()) {
 //			System.out.println("Structure de corpus en cours d'édition. Abandon.");
 //			return null;
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/EditVue.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/EditVue.java	(revision 926)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/EditVue.java	(revision 927)
@@ -36,7 +36,7 @@
 		}
 		
 		MainCorpus mainCorpus = ((org.txm.searchengine.cqp.corpus.Corpus)first).getMainCorpus();
-		Corpus corpus = AnalecCorpora.getCorpus(mainCorpus.getName());
+		Corpus corpus = AnalecCorpora.getCorpus(mainCorpus);
 		vue = AnalecCorpora.getVue(corpus);
 
 		javax.swing.SwingUtilities.invokeLater(new Runnable() {
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/EditStructure.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/EditStructure.java	(revision 926)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/EditStructure.java	(revision 927)
@@ -35,7 +35,7 @@
 		}
 		
 		MainCorpus mainCorpus = ((org.txm.searchengine.cqp.corpus.Corpus)first).getMainCorpus();
-		Corpus corpus = AnalecCorpora.getCorpus(mainCorpus.getName());
+		Corpus corpus = AnalecCorpora.getCorpus(mainCorpus);
 
 		//System.out.println("Editing structure for corpus="+corpus);
 
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/ImportTEICorpus.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/ImportTEICorpus.java	(revision 926)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/ImportTEICorpus.java	(revision 927)
@@ -127,7 +127,7 @@
 					MainCorpus corpus = CorpusManager.getCorpusManager().getCorpus(name.toUpperCase());
 					File analecDirectory = new File(corpus.getBaseDirectory(), "analec"); //$NON-NLS-1$
 					analecDirectory.mkdirs();
-					Corpus analecCorpus = AnalecCorpora.getCorpus(name.toUpperCase());
+					Corpus analecCorpus = AnalecCorpora.getCorpus(corpus);
 					analecCorpus.clearAll(); // remove all : annotations, structure
 					
 					System.out.println(Messages.ImportTEICorpus_18+xmlFile);
@@ -138,7 +138,7 @@
 				
 					System.out.println(Messages.ImportTEICorpus_20);
 					
-					AnalecCorpora.removeCorpus(corpus.getName()); // remove old corpus if any
+					AnalecCorpora.removeCorpus(corpus); // remove old corpus if any
 					
 					AnalecAnnotationReIndexer aari = new AnalecAnnotationReIndexer(corpus, analecCorpus);
 					if (!aari.process()) {
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveStructureAsGlozzModel.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveStructureAsGlozzModel.java	(revision 926)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveStructureAsGlozzModel.java	(revision 927)
@@ -26,7 +26,7 @@
 		
 		MainCorpus mainCorpus = ((org.txm.searchengine.cqp.corpus.Corpus)first).getMainCorpus();
 		
-		Corpus corpus = AnalecCorpora.getCorpus(mainCorpus.getName());
+		Corpus corpus = AnalecCorpora.getCorpus(mainCorpus);
 
 //		if (VisuStructure.isOpen()) {
 //			System.out.println("Structure de corpus en cours d'édition. Abandon.");
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/LoadStructureFromGlozz.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/LoadStructureFromGlozz.java	(revision 926)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/LoadStructureFromGlozz.java	(revision 927)
@@ -32,7 +32,7 @@
 		}
 		
 		MainCorpus mainCorpus = ((org.txm.searchengine.cqp.corpus.Corpus)first).getMainCorpus();
-		Corpus corpus = AnalecCorpora.getCorpus(mainCorpus.getName());
+		Corpus corpus = AnalecCorpora.getCorpus(mainCorpus);
 		
 //		if (VisuStructure.isOpen()) {
 //			System.out.println("Structure de corpus en cours d'édition. Abandon.");
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/LoadCorpus.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/LoadCorpus.java	(revision 926)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/LoadCorpus.java	(revision 927)
@@ -42,7 +42,7 @@
 		}
 		
 		MainCorpus mainCorpus = ((org.txm.searchengine.cqp.corpus.Corpus)first).getMainCorpus();
-		Corpus corpus = AnalecCorpora.getCorpus(mainCorpus.getName());
+		Corpus corpus = AnalecCorpora.getCorpus(mainCorpus);
 		
 		System.out.println(Messages.LoadCorpus_1);
 		
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/export/ExportToGlozzMacro.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/export/ExportToGlozzMacro.java	(revision 926)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/export/ExportToGlozzMacro.java	(revision 927)
@@ -94,7 +94,7 @@
 
 		// note that unit_type has been defined with an option of the dialog at
 		// the beginning
-		Corpus analecCorpus = AnalecCorpora.getCorpus(corpus.getName());
+		Corpus analecCorpus = AnalecCorpora.getCorpus(corpus);
 
 		// list of properties
 
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/toolbar/URSAnnotationToolbar.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/toolbar/URSAnnotationToolbar.java	(revision 926)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/toolbar/URSAnnotationToolbar.java	(revision 927)
@@ -69,8 +69,8 @@
 
 		this.editor = (SynopticEditionEditor) txmeditor;
 		this.maincorpus = (MainCorpus) this.editor.getCorpus();
-		analecCorpus = AnalecCorpora.getCorpus(maincorpus.getName());
-		vue = AnalecCorpora.getVue(maincorpus.getName());
+		analecCorpus = AnalecCorpora.getCorpus(maincorpus);
+		vue = AnalecCorpora.getVue(maincorpus);
 
 		annotationArea = new GLComposite(parent, SWT.NONE, "Unit annotation");
 
@@ -211,8 +211,8 @@
 	public boolean discardChanges() {
 		if (maincorpus.isModified()) {
 			AnalecCorpora.revert(maincorpus);
-			analecCorpus = AnalecCorpora.getCorpus(maincorpus.getName());
-			vue = AnalecCorpora.getVue(maincorpus.getName());
+			analecCorpus = AnalecCorpora.getCorpus(maincorpus);
+			vue = AnalecCorpora.getVue(maincorpus);
 			analecCorpus.removeEventListener(corpusListener);
 			CorporaView.refreshObject(maincorpus);
 		}
Index: tmp/TXMBetaPlugins.site/site.xml
===================================================================
--- tmp/TXMBetaPlugins.site/site.xml	(revision 926)
+++ tmp/TXMBetaPlugins.site/site.xml	(revision 927)
@@ -1,34 +1,34 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <site>
-   <feature url="features/org.txm.ahc.feature_1.0.0.qualifier.jar" id="org.txm.ahc.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.analec.feature_1.0.0.qualifier.jar" id="org.txm.analec.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.annotation.feature_1.0.0.qualifier.jar" id="org.txm.annotation.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.annotation.kr.feature_1.0.0.qualifier.jar" id="org.txm.annotation.kr.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.backtomedia.feature_1.0.0.qualifier.jar" id="org.txm.backtomedia.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.ca.feature_1.0.0.qualifier.jar" id="org.txm.ca.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.chartsengine.jfreechart.feature_1.0.0.qualifier.jar" id="org.txm.chartsengine.jfreechart.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.chartsengine.r.feature_1.0.0.qualifier.jar" id="org.txm.chartsengine.r.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.concordance.feature_1.0.0.qualifier.jar" id="org.txm.concordance.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.cooccurrence.feature_1.0.0.qualifier.jar" id="org.txm.cooccurrence.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.cql2lsa.feature_1.0.0.qualifier.jar" id="org.txm.cql2lsa.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.dictionary.feature_1.0.0.qualifier.jar" id="org.txm.dictionary.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.edition.feature_1.0.0.qualifier.jar" id="org.txm.edition.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.groovy.feature_1.0.0.qualifier.jar" id="org.txm.groovy.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.index.feature_1.0.0.qualifier.jar" id="org.txm.index.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.internalview.feature_1.0.0.qualifier.jar" id="org.txm.internalview.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.lexicaltable.feature_1.0.0.qualifier.jar" id="org.txm.lexicaltable.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.partition.feature_1.0.0.qualifier.jar" id="org.txm.partition.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.progression.feature_1.0.0.qualifier.jar" id="org.txm.progression.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.properties.feature_1.0.0.qualifier.jar" id="org.txm.properties.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.rcp.feature_1.0.0.qualifier.jar" id="org.txm.rcp.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.referencer.feature_1.0.0.qualifier.jar" id="org.txm.referencer.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.searchengine.cqp.feature_1.0.0.qualifier.jar" id="org.txm.searchengine.cqp.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.specificities.feature_1.0.0.qualifier.jar" id="org.txm.specificities.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.statsengine.r.feature_1.0.0.qualifier.jar" id="org.txm.statsengine.r.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.svn.feature_1.0.0.qualifier.jar" id="org.txm.svn.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.textbalance.feature_1.0.0.qualifier.jar" id="org.txm.textbalance.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.tigersearch.feature_1.0.0.qualifier.jar" id="org.txm.tigersearch.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.treetagger.feature_1.0.0.qualifier.jar" id="org.txm.treetagger.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.treetagger.files.feature_1.0.0.qualifier.jar" id="org.txm.treetagger.files.feature" version="1.0.0.qualifier"/>
-   <feature url="features/org.txm.wordcloud.feature_1.0.0.qualifier.jar" id="org.txm.wordcloud.feature" version="1.0.0.qualifier"/>
+   <feature url="features/org.txm.ahc.feature_1.0.0.201806251537.jar" id="org.txm.ahc.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.analec.feature_1.0.0.201806251537.jar" id="org.txm.analec.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.annotation.feature_1.0.0.201806251537.jar" id="org.txm.annotation.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.annotation.kr.feature_1.0.0.201806251537.jar" id="org.txm.annotation.kr.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.backtomedia.feature_1.0.0.201806251537.jar" id="org.txm.backtomedia.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.ca.feature_1.0.0.201806251537.jar" id="org.txm.ca.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.chartsengine.jfreechart.feature_1.0.0.201806251537.jar" id="org.txm.chartsengine.jfreechart.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.chartsengine.r.feature_1.0.0.201806251537.jar" id="org.txm.chartsengine.r.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.concordance.feature_1.0.0.201806251537.jar" id="org.txm.concordance.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.cooccurrence.feature_1.0.0.201806251537.jar" id="org.txm.cooccurrence.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.cql2lsa.feature_1.0.0.201806251537.jar" id="org.txm.cql2lsa.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.dictionary.feature_1.0.0.201806251537.jar" id="org.txm.dictionary.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.edition.feature_1.0.0.201806251537.jar" id="org.txm.edition.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.groovy.feature_1.0.0.201806251537.jar" id="org.txm.groovy.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.index.feature_1.0.0.201806251537.jar" id="org.txm.index.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.internalview.feature_1.0.0.201806251537.jar" id="org.txm.internalview.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.lexicaltable.feature_1.0.0.201806251537.jar" id="org.txm.lexicaltable.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.partition.feature_1.0.0.201806251537.jar" id="org.txm.partition.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.progression.feature_1.0.0.201806251537.jar" id="org.txm.progression.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.properties.feature_1.0.0.201806251537.jar" id="org.txm.properties.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.rcp.feature_1.0.0.201806251537.jar" id="org.txm.rcp.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.referencer.feature_1.0.0.201806251537.jar" id="org.txm.referencer.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.searchengine.cqp.feature_1.0.0.201806251537.jar" id="org.txm.searchengine.cqp.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.specificities.feature_1.0.0.201806251537.jar" id="org.txm.specificities.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.statsengine.r.feature_1.0.0.201806251537.jar" id="org.txm.statsengine.r.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.svn.feature_1.0.0.201806251537.jar" id="org.txm.svn.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.textbalance.feature_1.0.0.201806251537.jar" id="org.txm.textbalance.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.tigersearch.feature_1.0.0.201806251537.jar" id="org.txm.tigersearch.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.treetagger.feature_1.0.0.201806251537.jar" id="org.txm.treetagger.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.treetagger.files.feature_1.0.0.201806251537.jar" id="org.txm.treetagger.files.feature" version="1.0.0.201806251537"/>
+   <feature url="features/org.txm.wordcloud.feature_1.0.0.201806251537.jar" id="org.txm.wordcloud.feature" version="1.0.0.201806251537"/>
 </site>
Index: tmp/org.txm.treetagger.core/src/org/txm/treetagger/core/TreeTaggerEngine.java
===================================================================
--- tmp/org.txm.treetagger.core/src/org/txm/treetagger/core/TreeTaggerEngine.java	(revision 0)
+++ tmp/org.txm.treetagger.core/src/org/txm/treetagger/core/TreeTaggerEngine.java	(revision 927)
@@ -0,0 +1,108 @@
+package org.txm.treetagger.core;
+
+import java.io.File;
+import java.util.HashMap;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.txm.annotation.core.AnnotationEngine;
+import org.txm.importer.xmltxm.Annotate;
+import org.txm.treetagger.core.preferences.TreeTaggerPreferences;
+import org.txm.utils.treetagger.TreeTagger;
+
+public class TreeTaggerEngine extends AnnotationEngine {
+
+	private File ttModelsDirectory;
+	private File ttBinaryDirectory;
+
+	protected HashMap<File, TreeTagger> instances = new HashMap<File, TreeTagger>();
+	private String[] options;
+
+	@Override
+	public boolean isRunning() {
+		
+		ttBinaryDirectory = new File(TreeTaggerPreferences.getString(TreeTaggerPreferences.INSTALL_PATH, TreeTaggerPreferences.PREFERENCES_NODE)+"/bin/");
+		if (!ttBinaryDirectory.exists()) {
+			System.out.println("Error: path to TreeTagger is wrong: "+ttBinaryDirectory);
+			return false;
+		}
+		
+		ttModelsDirectory = new File(TreeTaggerPreferences.getString(TreeTaggerPreferences.MODELS_PATH, TreeTaggerPreferences.PREFERENCES_NODE));
+		if (!ttModelsDirectory.exists()) {
+			System.out.println("Error: path to TreeTagger path is wrong: "+ttModelsDirectory);
+			return false;
+		}
+		
+		options = TreeTaggerPreferences.getString(TreeTaggerPreferences.OPTIONS, TreeTaggerPreferences.PREFERENCES_NODE).split("  ");
+		
+		return ttBinaryDirectory != null && ttBinaryDirectory.exists() && ttModelsDirectory != null && ttModelsDirectory.exists();
+	}
+	
+	@Override
+	public boolean stop() throws Exception {
+		ttBinaryDirectory = null;
+		ttModelsDirectory = null;
+		for (TreeTagger tt : instances.values()) {
+			tt.kill();
+		}
+		instances.clear();
+		return false;
+	}
+
+	@Override
+	public String getName() {
+		return "TreeTagger";
+	}
+
+	@Override
+	public boolean initialize() {
+		return true;
+	}
+
+	@Override
+	public boolean start(IProgressMonitor monitor) {
+		return true;
+	}
+
+	public TreeTagger getInstance(File modelFile) {
+		if (!instances.containsKey(modelFile)) {
+			instances.put(modelFile, new TreeTagger(ttBinaryDirectory.getAbsolutePath(), options));
+		}
+		return instances.get(modelFile);
+	}
+
+	@Override
+	public boolean processFile(File xmlFile, File binaryCorpusDirectory, HashMap<String, Object> parameters) {
+		if (!isRunning()) return false;
+		
+		Annotate annotate = new Annotate();
+		Object p = parameters.get("lang");
+		if (p == null) {
+			System.out.println("Error: no 'lang' parameter given. Aborting TreeTagger annotation.");
+			return false;
+		}
+		String lang = p.toString();
+		
+		return annotate.run(xmlFile, lang, binaryCorpusDirectory, xmlFile.getParentFile());
+	}
+
+	/**
+	 * if the 'langs' HashMap<String=xml file path, String=lang code> parameter is set, then the Annotate class will do multi-threading to process the files
+	 * 
+	 * @return true if success
+	 */
+	public boolean processDirectory(File xmlFilesDirectory, File binaryCorpusDirectory, HashMap<String, Object> parameters) {
+		Object p = parameters.get("langs");
+		if (p != null && p instanceof HashMap<?,?>) {
+			Annotate annotate = new Annotate();
+			HashMap<String, String> langs = (HashMap<String, String>) p;
+			return annotate.run(binaryCorpusDirectory, new File(binaryCorpusDirectory, "txm"), langs);
+		} else {
+			return super.processDirectory(xmlFilesDirectory, binaryCorpusDirectory, parameters);
+		}
+	}
+	
+	@Override
+	public boolean isAutomatic() {
+		return true;
+	}
+}

Property changes on: tmp/org.txm.treetagger.core/src/org/txm/treetagger/core/TreeTaggerEngine.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/CSV2W_ANA.groovy
===================================================================
--- tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/CSV2W_ANA.groovy	(revision 0)
+++ tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/CSV2W_ANA.groovy	(revision 927)
@@ -0,0 +1,491 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2016-03-29 09:51:35 +0200 (mar. 29 mars 2016) $
+// $LastChangedRevision: 3185 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xmltxm
+
+import java.io.File;
+import java.io.Writer;
+
+import org.txm.importer.PersonalNamespaceContext;
+import org.txm.utils.treetagger.TreeTagger;
+import java.util.Iterator;
+
+import javax.xml.namespace.NamespaceContext;
+
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.nio.charset.Charset;
+import java.util.Iterator;
+
+import javax.xml.stream.*;
+// TODO: Auto-generated Javadoc
+/**  
+ * @author mdecorde  
+ * 
+ * Take a CVS file with columns [word, pos1, pos2, ...] Build xml-pos With given infos : - setAnnotationTypes( types, idform); - setResp( person, software, cmdLine);  types : list of type [pos1, pos2, ...] idform : the ___ of the words' id person : the resp software : the software which creates annotations cmdline : the used cmd line 
+ * 
+ */
+class CSV2W_ANA {
+	String encoding;
+
+	/** The target. */
+	String target = "" // ana file targeted
+
+	/** The distributor. */
+	String distributor= "";
+
+	/** The publi chat. */
+	String publiChat= "";
+
+	/** The source chat. */
+	String sourceChat= "";
+
+	/** The reportfile. */
+	File reportfile;
+
+	/** The resp person. */
+	String respPerson; // used for respStmt/resp/name(person)
+
+	/** The resp id. */
+	String respId;
+
+	/** The resp chat. */
+	String respChat;
+
+	/** The resp date. */
+	String respDate;
+
+	/** The resp when. */
+	String respWhen;
+
+	/** The app ident. */
+	String appIdent;
+
+	/** The app version. */
+	String appVersion;
+
+	/** The types. */
+	def types ;// used for linkGrp type
+
+	/** The types desc. */
+	def typesDesc ;// used for types' description
+
+	/** The types uri. */
+	def typesURI; // used for types' URI
+
+	/** The types web. */
+	def typesWEB;//used for types siteweb
+
+	/** The idform. */
+	String idform ="";
+
+	/** The writer. */
+	XMLOutputFactory factory = XMLOutputFactory.newInstance();
+	BufferedOutputStream output;
+	XMLStreamWriter writer;
+
+	public static String TXMNS = "http://textometrie.org/1.0";
+	public static String TEINS = "http://www.tei-c.org/ns/1.0";
+
+	/**
+	 * Process.
+	 *
+	 * @param TTrez the tt result file
+	 * @param xmlform the xmlform the standoff file created
+	 * @param encoding the encoding of the result file
+	 * @return true, if successful
+	 */
+	public boolean process(File TTrez,File xmlform, String encoding )
+	{
+		try {
+			this.encoding = encoding;
+			output = new BufferedOutputStream(new FileOutputStream(xmlform));
+			writer = factory.createXMLStreamWriter(output, "UTF-8"); // create a new file
+			writer.setNamespaceContext(new PersonalNamespaceContext());
+			writeHead();
+			writeBody(TTrez,encoding)
+			writeTail();
+			writer.close();
+			output.close();
+		} catch(Exception e) {
+			e.printStackTrace();
+			writer.close();
+			output.close();
+			return false;
+		}
+		return true;
+	}
+
+	/**
+	 * Write head.
+	 */
+	private void writeHead()
+	{
+		Charset UTF8 = Charset.forName("UTF8");
+		writer.writeStartDocument(encoding, "1.0");
+		writer.writeStartElement("TEI");
+		writer.writeDefaultNamespace(TEINS);
+		writer.writeNamespace("txm", TXMNS);
+		writer.writeStartElement("teiHeader");
+		writer.writeStartElement("fileDesc");
+		writer.writeStartElement("titleStmt");
+		writer.writeStartElement("title");
+		writer.writeCharacters("Standoff annotation file for "+target);
+		writer.writeEndElement(); // title
+		writer.writeStartElement("respStmt");
+		writer.writeAttribute("xml:id", respId);
+		writer.writeStartElement("resp");
+		writer.writeCharacters(respChat)
+		writer.writeStartElement("date");
+		writer.writeAttribute("when", respWhen);
+		writer.writeCharacters(respDate);
+		writer.writeEndElement(); // date
+		writer.writeEndElement(); // resp
+		writer.writeStartElement("name");
+		writer.writeAttribute("type", "person");
+		writer.writeCharacters(respPerson+"\n");
+		writer.writeEndElement(); // name
+		writer.writeEndElement(); // respStmt
+		writer.writeEndElement(); // titleStmt
+		writer.writeStartElement("publicationStmt")
+		writer.writeCharacters("\n");
+		writer.writeStartElement("distributor");
+		writer.writeCharacters("\n");
+		writer.flush();
+		output.write(distributor.getBytes(UTF8))
+		output.flush()
+		writer.writeEndElement(); // distributor
+		writer.writeCharacters("\n");
+		writer.flush();
+		output.write(publiChat.getBytes(UTF8));
+		output.flush()
+		writer.writeEndElement(); // publicationStmt
+		writer.writeStartElement("sourceDesc");
+		writer.writeCharacters("\n");
+		writer.flush();
+		output.write(sourceChat.getBytes(UTF8));
+		output.flush()
+		writer.writeEndElement(); // sourceDesc
+		writer.writeEndElement(); // fileDesc
+		writer.writeStartElement("encodingDesc");
+		writer.writeStartElement("appInfo");
+		writer.writeStartElement(TXMNS,"application");
+		writer.writeAttribute("ident",appIdent);
+		writer.writeAttribute("version", appVersion);
+		writer.writeAttribute("resp", respId);
+		writer.writeCharacters("\n");
+		writer.flush();
+		def report = this.reportfile;
+		if (report != null) {
+			//System.out.println("read report : "+report);
+			Reader reader = new FileReader(report);
+			String line = reader.readLine();
+			while (line != null) {
+				if (line.length() != 0)
+					output.write((line.replace("&","&amp;")+"\n").getBytes(UTF8));
+				line = reader.readLine();
+			}
+			reader.close();
+			output.flush()
+		} else {
+			writer.writeEmptyElement(TXMNS, "commandLine");
+			writer.writeCharacters("\n");
+		}
+
+		writer.writeStartElement("ab");
+		writer.writeAttribute("type", "annotation");
+		writer.writeCharacters("\n");
+		writer.writeStartElement("list");
+		writer.writeCharacters("\n");
+		for (int i = 0; i < types.size(); i++) {
+			writer.writeStartElement("item");
+			writer.writeEmptyElement("ref");
+			writer.writeAttribute("type", "tagset");
+			writer.writeAttribute("target","#"+types[i])
+			writer.writeEndElement(); // item
+			writer.writeCharacters("\n");
+		}
+		writer.writeEndElement(); // list
+		writer.writeEndElement(); // ab
+		writer.writeEndElement(); // txm:application
+		writer.writeEndElement(); // appInfo
+		writer.writeStartElement("classDecl");
+		for (int i = 0; i < types.size(); i++) {
+			writer.writeStartElement("taxonomy");
+			writer.writeAttribute("xml:id", types[i]);
+			writer.writeStartElement("bibl");
+			writer.writeStartElement("title");
+			writer.writeCharacters(typesDesc[i]);
+			writer.writeEndElement(); // title
+			if (!typesURI[i].equals("")) {
+				writer.writeEmptyElement("ref");
+				writer.writeAttribute("type", "tagset");
+				writer.writeAttribute("target", typesURI[i]);
+				writer.writeCharacters("\n");
+			}
+			if (!typesWEB[i].equals("")) {
+				writer.writeEmptyElement("ref");
+				writer.writeAttribute("type", "siteweb");
+				writer.writeAttribute("target", typesWEB[i]);
+				writer.writeCharacters("\n");
+			}
+			writer.writeEndElement(); // bibl
+			writer.writeCharacters("\n");
+			writer.writeEndElement(); // taxonomy
+			writer.writeCharacters("\n");
+		}
+		writer.writeEndElement(); // classDecl
+		writer.writeCharacters("\n");
+		writer.writeEndElement(); // encodingDesc
+		writer.writeCharacters("\n");
+		writer.writeEndElement(); // teiHeader
+
+		writer.writeStartElement("text");
+		writer.writeAttribute("type", "standoff");
+		writer.writeStartElement("body");
+		writer.writeCharacters("\n");
+		writer.writeStartElement("div");
+		writer.writeCharacters("");
+	}
+
+	/**
+	 * Write body.
+	 *
+	 * @param TTrez the tt result file
+	 * @param encoding the encoding
+	 * @return the java.lang. object
+	 */
+	private writeBody(File TTrez, String encoding) {
+		String tmp = "";
+		String targets= idform+"";
+
+		//def content = TTrez.getText(encoding)
+		//content = content.replace("&lt;", "<")
+
+		def separator= "\t"
+		def maxsize = types.size()+1;
+		for (int i = 0 ; i< types.size() ; i++) {
+			int id = 1;
+			//output.write("<linkGrp type=\""+types[i]+"\">\n");
+			writer.writeStartElement("linkGrp");
+			writer.writeAttribute("type", types[i]);
+			TTrez.eachLine("UTF-8") { line ->
+				line = line.replaceAll("&lt;", "<")
+				def fields = line.split(separator);
+				//content.splitEachLine(separator) {fields ->
+					if (fields.size() == maxsize)
+						if (!(fields[0].startsWith("<s>") || fields[0].startsWith("</s>")))// don't use the sentence tags
+					{
+						writer.writeEmptyElement("link");
+						writer.writeAttribute("targets", "#"+targets+id+" #"+ fields[i+1]);
+						id++;
+						writer.writeCharacters("\n");
+					}
+				//}
+			}
+			writer.writeEndElement(); // linkGrp
+		}
+	}
+
+	/**
+	 * Write tail.
+	 */
+	private void writeTail() {
+		writer.writeEndElement(); // div
+		writer.writeEndElement(); // body
+		writer.writeEndElement(); // text
+		writer.writeEndElement(); // TEI
+	}
+
+	/**
+	 * Sets the annotation types.
+	 *
+	 * @param types the types
+	 * @param typesDesc the types desc
+	 * @param typesURI the types uri
+	 * @param typesWEB the types web
+	 * @param idform the idform
+	 */
+	public void setAnnotationTypes(def types,def typesDesc,def typesURI,def typesWEB, String idform) {
+		this.types = types;
+		this.typesDesc = typesDesc;
+		this.typesURI = typesURI;
+		this.typesWEB = typesWEB;
+		this.idform = idform;
+	}
+
+	/**
+	 * Sets the resp.
+	 *
+	 * @param respId the resp id
+	 * @param respChat the resp chat
+	 * @param respDate the resp date
+	 * @param respPerson the resp person
+	 * @param respWhen the resp when
+	 */
+	public void setResp(respId, respChat,respDate, respPerson,respWhen) {
+		this.respId = respId;
+		this.respChat = respChat;
+		this.respDate = respDate
+		this.respPerson = respPerson;
+		this.respWhen = respWhen;
+	}
+
+	/**
+	 * Sets the target.
+	 *
+	 * @param target the target
+	 * @param reportFile the report file
+	 */
+	public void setTarget(target, reportFile) {
+		this.target = target;
+		this.reportfile = reportFile;
+	}
+
+	/**
+	 * Sets the app.
+	 *
+	 * @param appIdent the app ident
+	 * @param appVersion the app version
+	 */
+	public void setApp(String appIdent, String appVersion) {
+		this.appIdent = appIdent;
+		this.appVersion = appVersion;
+	}
+
+	/**
+	 * Sets the infos.
+	 *
+	 * @param distributor the distributor
+	 * @param publiChat the publi chat
+	 * @param sourceChat the source chat
+	 */
+	public void setInfos(distributor,  publiChat, sourceChat) {
+		this.distributor = distributor;
+		this.publiChat = publiChat;
+		this.sourceChat = sourceChat;
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+
+		String rootDir = "~/xml/rgaqcj/";
+		new File(rootDir,"proj").mkdir();
+
+		//targeted file for annotations
+		String target = "roland.xml"
+		//contains txm:application/txm:commandLine
+		File reportFile = new File("~/xml/rgaqcj/tt1_REPORT.xml");
+
+		String respPerson ="slh";
+		String respId = "TT1";
+		String respDesc = "NLP annotation tool";
+		String respDate = "Tue Mar  11 1:02:55 Paris, Madrid 2010";
+		String respWhen="2010-03-11"
+
+		String appIdent = "TreeTagger";
+		String appVersion = "3.2";
+
+		String distributor = "BFM project - http://bfm.ens-lsh.fr";
+		String publiStmt = """<availability>
+			  <p>(c) 2010 Projet BFM - CNRS/ENS-LSH.
+			  <hi>Conditions d'utilisation</hi> : 
+			  Sous licence <ref target="http://creativecommons.org/licenses/by-sa/2.0/fr/">Creative Commons</ref>.
+			  </p>
+			</availability>""";
+
+		String sourceStmt = """<p>Born digital: TXM project - http://textometrie.org</p>
+			<p>Automatically generated on <date when=" """+respWhen+"""">"""+respDate+"""</date>
+			from <ref target="#"""+respId+"""">Tree Tagger</ref> applied on the text roland-tt.
+			</p>""";
+
+		def types = ["CATTEX2009"];
+		def typesTITLE = ["CATTEX2009"];
+		def typesDesc = ["CATTEX2009 POS description"]
+		def typesTAGSET = ["http://bfm.ens-lsh.fr/IMG/xml/cattex2009.xml"]
+		def typesWEB = ["http://bfm.ens-lsh.fr/article.php3?id_article=176"]
+		String idform ="w_fro_";
+
+		File ttfile = new File(rootDir+"/proj/","rol_rga.tt");
+		File posfile = new File(rootDir+"/pos/","rolandTT1-w-ana.xml");
+		String encoding ="UTF-8";
+		println("Process file : "+ttfile+" to : "+posfile );
+
+		def transfo = new CSV2W_ANA();
+		transfo.setAnnotationTypes( types, typesDesc, typesTAGSET, typesWEB, idform);
+		transfo.setResp(respId, respDesc,respDate, respPerson, respWhen);
+		transfo.setApp(appIdent, appVersion);
+		transfo.setTarget(target, reportFile);
+		transfo.setInfos(distributor,  publiStmt, sourceStmt);
+		transfo.process( ttfile, posfile, encoding );
+
+		//create annotation file for afrpar on roalnd.xml
+		String infile = rootDir+"/ttsrc/roland-learn.tt";
+		String modelfile =  rootDir+"/models/afr.par";
+		String outfile = rootDir+"/proj/afr_rol.tt";
+
+		println("proj "+modelfile+ " on " +infile +" >> "+outfile);
+
+		TreeTagger tt = new TreeTagger("~/Bureau/treetagger/bin/");
+		tt.settoken();
+		tt.setquiet();
+		tt.setsgml();
+		tt.seteostag("<s>");
+		tt.treetagger( modelfile, infile, outfile)
+
+		reportFile = new File("~/xml/rgaqcj/tt2_REPORT.xml");
+		respPerson ="slh";
+		respId = "TT2";
+		respDesc = "NLP annotation tool";
+		respDate = "Tue Mar  15 1:02:55 Paris, Madrid 2010";
+		respWhen = "2010-03-15"
+
+		types = ["AFRPOS"];
+		typesDesc = ["AFRPOS description"]
+		typesWEB = ["http://www.uni-stuttgart.de/lingrom/stein/forschung/resource.html"]
+		typesTAGSET = [""]
+		idform ="w_fro_";
+
+		ttfile = new File(rootDir+"/proj/","afr_rol.tt");
+		posfile = new File(rootDir+"/pos/","rolandTT2-w-ana.xml");
+		encoding ="UTF-8";
+		println("Process file : "+ttfile+" to : "+posfile );
+
+		transfo = new CSV2W_ANA();
+		transfo.setAnnotationTypes( types, typesDesc, typesTAGSET, typesWEB, idform);
+		transfo.setResp(respId, respDesc,respDate, respPerson,respWhen);
+		transfo.setTarget(target, reportFile);
+		transfo.setApp(appIdent, appVersion);
+		transfo.setInfos(distributor,  publiStmt, sourceStmt);
+		transfo.process( ttfile, posfile, encoding );
+	}
+}
\ No newline at end of file
Index: tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/AnnotateWTC.groovy
===================================================================
--- tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/AnnotateWTC.groovy	(revision 0)
+++ tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/AnnotateWTC.groovy	(revision 927)
@@ -0,0 +1,177 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2013-12-06 16:57:35 +0100 (Fri, 06 Dec 2013) $
+// $LastChangedRevision: 2583 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xmltxm
+
+import java.io.File
+import java.text.DateFormat
+import java.util.Date
+
+import org.txm.Toolbox
+import org.txm.importer.*
+import org.txm.importer.cwb.*
+import org.txm.objects.*
+import org.txm.stat.utils.ConsoleProgressBar
+import org.txm.utils.DeleteDir;
+import org.txm.utils.LangDetector;
+import org.txm.utils.treetagger.TreeTagger
+
+// TODO: Auto-generated Javadoc
+/**
+ * Annotate and replace the TEI-TXM files of the folder $rootDirFile/txm with TreeTagger.
+ * creates $rootDirFile/interp and $rootDirFile/treetagger
+ *
+ */
+class AnnotateCQP {
+
+	/** The debug. */
+	boolean debug = true;
+
+	/**
+	 * Sets the debug.
+	 */
+	public void setDebug() { debug=true; }
+
+	String id;
+
+	/**
+	 * Apply tt.
+	 *
+	 * @param ttsrcfile the ttsrcfile
+	 * @param ttoutfile the ttoutfile
+	 * @param modelfile the modelfile
+	 * @return true, if successful
+	 */
+	public boolean applyTT(File ttsrcfile, File ttoutfile, File modelfile)
+	{
+		try {
+			File infile = ttsrcfile;
+			File outfile = ttoutfile;
+
+			// TODO: why org.txm.utils.treetagger.TreeTagger tt = ..., throw IllegalAccessError ???
+			String opt = Toolbox.getPreference(Toolbox.TREETAGGER_OPTIONS);
+			if (opt == null) opt = "";
+			String[] options = opt.split("  ");
+			def tt = new TreeTagger(Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/", options);
+			tt.settoken();
+			tt.setlemma();
+			tt.setquiet();
+			tt.setsgml();
+			tt.setnounknown();
+			tt.seteostag("<s>");
+			tt.treetagger(modelfile.getAbsolutePath(), infile.getAbsolutePath(), outfile.getAbsolutePath())
+			//infile.delete();
+		}
+		catch(Exception e)
+		{
+			e.printStackTrace();
+			return false;
+		}
+		return true;
+	}
+
+	/**
+	 * Run.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param modelfilename the modelfilename
+	 * @return true, if successful
+	 */
+	public boolean run(File binDir, File txmDir,  String modelfilename)
+	{
+		//test if modelfile exists
+		if(debug) {
+			println "rootDirFile "+binDir
+			println "txmDir "+txmDir
+			println "TREETAGGER INSTALL PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)
+			println "TREETAGGER MODELS PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH)
+		}
+
+		//test if the Toolbox know TreeTagger
+		if (!new File(Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/").exists())
+		{
+			println("Could not find TreeTagger binaries in "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/")
+			return false;
+		}
+
+		//cleaning
+		File annotDir = new File(binDir, "annotations")
+		annotDir.mkdir();
+
+		//BUILD TT FILE READY TO BE TAGGED
+		List<File> files = txmDir.listFiles()
+
+		// get model file and check it
+		File modelfile = new File(Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH), modelfilename);
+		if (debug)
+			println "model file : "+modelfile;
+
+		if (!modelfile.exists()) {
+			println "Skipping ANNOTATE: Incorrect modelfile path: "+modelfile;
+			if(System.getProperty("os.name").startsWith("Windows"))
+				println "Windows users: Windows might be hiding files extension. To see them, in the explorer parameters."
+			return false;
+		}
+
+		//APPLY TREETAGGER
+		println("Applying $modelfilename TreeTagger model on dir: "+txmDir+ " ("+files.size()+" files)")
+		if (files == null || files.size() == 0)
+			return false;
+
+		ConsoleProgressBar cpb = new ConsoleProgressBar(files.size());
+		for (File f : files) {
+			cpb.tick();
+			
+			File infile = f;
+			File outfile = new File(new File(binDir, "annotations"), f.getName());
+			if (outfile.exists() && // outfile exists
+				outfile.lastModified() >= infile.lastModified() && // outfile is more recent 
+				outfile.length() > infile.length()) { // outfile is bigger
+				// skip
+			} else {
+				if (!applyTT(infile, outfile, modelfile)) {
+					System.out.println("Failed to apply treetagger on file "+f);
+					return false;
+				}
+			}
+		}
+		println("")
+
+//		if (DeleteDir.deleteDirectory(txmDir)) {
+//			if (annotDir.renameTo(txmDir)) {
+//
+//			} else {
+//				println "Could not rename  'annotations' directory to 'txm' directory"
+//				return false
+//			}
+//		} else {
+//			println "Could not delete txmDir: $txmDir (and could not copy 'annotations' directory"
+//		}
+
+		return true;
+	}
+}
\ No newline at end of file
Index: tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/Annotate.groovy
===================================================================
--- tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/Annotate.groovy	(revision 0)
+++ tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/Annotate.groovy	(revision 927)
@@ -0,0 +1,567 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2016-10-03 15:30:36 +0200 (lun. 03 oct. 2016) $
+// $LastChangedRevision: 3313 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xmltxm
+
+import java.io.File
+import java.text.DateFormat
+import java.util.Date
+import java.util.concurrent.*
+
+import org.txm.Toolbox
+import org.txm.importer.*
+import org.txm.importer.cwb.*
+import org.txm.objects.*
+import org.txm.stat.utils.ConsoleProgressBar;
+import org.txm.treetagger.core.preferences.TreeTaggerPreferences
+import org.txm.utils.LangDetector;
+import org.txm.utils.logger.Log;
+import org.txm.utils.treetagger.TreeTagger
+
+/**
+ * Annotate and replace the TEI-TXM files of the folder $rootDirFile/txm with TreeTagger.
+ * creates $rootDirFile/interp and $rootDirFile/treetagger
+ *
+ */
+class Annotate {
+	boolean cancelNow = false;
+
+	/** The report file. */
+	File reportFile;//contains the txm:application tag content
+
+	/** The resp person. */
+	String respPerson;
+
+	/** The resp id. */
+	String respId;
+
+	/** The resp desc. */
+	String respDesc;
+
+	/** The resp date. */
+	String respDate;
+
+	/** The resp when. */
+	String respWhen;
+
+	/** The app ident. */
+	String appIdent;
+
+	/** The app version. */
+	String appVersion;
+
+	/** The distributor. */
+	String distributor;
+
+	/** The publi stmt. */
+	String publiStmt;
+
+	/** The source stmt. */
+	String sourceStmt;
+
+	/** The types. */
+	def types;
+
+	/** The types title. */
+	def typesTITLE;
+
+	/** The types desc. */
+	def typesDesc;
+
+	/** The types tagset. */
+	def typesTAGSET;
+
+	/** The types web. */
+	def typesWEB;
+
+	/** The idform. */
+	String idform;
+
+	/** The debug. */
+	boolean debug = false;
+
+	File modelsDirectory;
+
+	public Annotate() {
+		modelsDirectory = new File(TreeTaggerPreferences.getString(TreeTaggerPreferences.MODELS_PATH, TreeTaggerPreferences.PREFERENCES_NODE)); // default models directory is set in the Toolbox
+	}
+
+	/**
+	 * Sets the debug.
+	 */
+	public void setDebug() {
+		debug = true;
+	}
+
+	String id;
+	/**
+	 * Inits the tt outfile infos.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param modelfile the modelfile
+	 */
+	public void initTTOutfileInfos(File rootDirFile, File modelfile, String modelfilename)
+	{
+		initTTOutfileInfos(rootDirFile, modelfile, modelfilename, null);
+	}
+
+	/**
+	 * Inits the tt outfile infos.
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param modelfile the modelfile
+	 * @param properties : 2 element array that contains the word properties to create. It can be null (the modelfilename will be used)
+	 */
+	public void initTTOutfileInfos(File rootDirFile, File modelfile, String modelfilename, String[] properties)
+	{
+		id = modelfilename;
+		String[] split = id.split("\\.");
+		if (split.length > 0) id = split[0];
+		if (id.equals("??")) id = "xx"
+
+		reportFile = new File(rootDirFile,"NLPToolsParameters.xml");
+
+		respPerson = System.getProperty("user.name");
+		respId = "txm";
+		respDesc = "NLP annotation tool";
+		respDate = DateFormat.getDateInstance(DateFormat.SHORT, Locale.UK).format(new Date());
+		respWhen = DateFormat.getDateInstance(DateFormat.FULL, Locale.UK).format(new Date());
+
+		appIdent = "TreeTagger";
+		appVersion = "3.2";
+
+		distributor = "";
+		publiStmt = """""";
+		sourceStmt = """""";
+
+		if (properties != null && properties.length == 2) {
+			types = [properties[0],properties[1]];
+			typesTITLE = [properties[0],properties[1]];
+		} else {
+			types = [id+"pos",id+"lemma"];
+			typesTITLE = [id+"pos",id+"lemma"];
+		}
+
+		//TODO: the tagset, website and description should be referenced in the model catalog
+		if(modelfile.getName() == "rgaqcj.par") {
+			typesDesc = ["CATTEX pos tagset built with BFM texts","fr lemma of the model "+modelfile+" - "]
+			typesTAGSET = ["http://bfm.ens-lyon.fr/IMG/pdf/Cattex2009_Manuel.pdf",""]
+			typesWEB = ["http://bfm.ens-lyon.fr/",""]
+		} else {
+			typesDesc = ["pos tagset built from model "+modelfile,id+" lemma of the model "+modelfile+" - "]
+			typesTAGSET = ["",""]
+			typesWEB = ["",""]
+		}
+
+		idform ="w";
+	}
+
+	/**
+	 * Apply tt.
+	 *
+	 * @param ttsrcfile the ttsrcfile
+	 * @param ttoutfile the ttoutfile
+	 * @param modelfile the modelfile
+	 * @return true, if successful
+	 */
+	public boolean applyTT(File ttsrcfile, File ttoutfile, File modelfile) {
+		applyTT(ttsrcfile, ttoutfile, modelfile, null)
+	}
+
+	/**
+	 * Apply tt.
+	 *
+	 * @param ttsrcfile the ttsrcfile
+	 * @param ttoutfile the ttoutfile
+	 * @param modelfile the modelfile
+	 * @param options, if null use value set in Toolbox preferences
+	 * @return true, if successful
+	 */
+	public boolean applyTT(File ttsrcfile, File ttoutfile, File modelfile, String[] options)
+	{
+		try {
+			File infile = ttsrcfile;
+			File outfile = ttoutfile;
+
+			// TODO: why org.txm.utils.treetagger.TreeTagger tt = ..., throw IllegalAccessError ???
+			String opt = TreeTaggerPreferences.getString(TreeTaggerPreferences.OPTIONS, TreeTaggerPreferences.PREFERENCES_NODE);
+			if (options == null) {
+				if (opt == null) opt = "";
+				options = opt.split("  ");
+			}
+
+			def tt = new TreeTagger(TreeTaggerPreferences.getString(TreeTaggerPreferences.INSTALL_PATH, TreeTaggerPreferences.PREFERENCES_NODE)+"/bin/", options);
+			tt.settoken();
+			tt.setlemma();
+			tt.setquiet();
+			tt.setsgml();
+			tt.setnounknown();
+			tt.seteostag("<s>");
+			tt.debug(debug);
+			tt.treetagger(modelfile.getAbsolutePath(), infile.getAbsolutePath(), outfile.getAbsolutePath())
+			infile.delete();
+		} catch(Exception e) {
+			Log.printStackTrace(e);
+			System.out.println("Failed to apply TreeTagger on $f input file with the $modelfile model file.");
+			return false;
+		}
+		return true;
+	}
+
+	/**
+	 * Write standoff file.
+	 *
+	 * @param ttoutfile the ttoutfile
+	 * @param posfile the posfile
+	 * @return true, if successful
+	 */
+	public boolean writeStandoffFile(File ttoutfile, File posfile)
+	{
+		def encoding ="UTF-8";
+		def transfo = new CSV2W_ANA();
+		//println("build w-interp "+ttfile.getName()+ ">>"+posfile.getName())
+		transfo.setAnnotationTypes( types, typesDesc, typesTAGSET, typesWEB, idform);
+		transfo.setResp(respId, respDesc, respDate, respPerson, respWhen);
+		transfo.setApp(appIdent, appVersion);
+		transfo.setTarget(ttoutfile.getAbsolutePath(), reportFile);
+		transfo.setInfos(distributor,  publiStmt, sourceStmt);
+		return transfo.process( ttoutfile, posfile, encoding );
+	}
+
+	/**
+	 * Run step by step : build TT src files, run TT, build xml-standoff files, inject standoff annotations
+	 *
+	 * @param rootDirFile the root dir file
+	 * @param modelfilename the modelfilename
+	 * @return true, if successful
+	 */
+	public boolean run(File binDir, File txmDir,  String modelfilename)
+	{
+		//test if modelfile exists
+		if (debug) {
+			println "rootDirFile "+binDir
+			println "txmDir "+txmDir
+			println "TREETAGGER INSTALL PATH : "+TreeTaggerPreferences.getString(TreeTaggerPreferences.INSTALL_PATH, TreeTaggerPreferences.PREFERENCES_NODE);
+			println "TREETAGGER MODELS PATH : "+TreeTaggerPreferences.getString(TreeTaggerPreferences.MODELS_PATH, TreeTaggerPreferences.PREFERENCES_NODE)
+		}
+
+		//test if the Toolbox know TreeTagger
+		if (!new File(TreeTaggerPreferences.getString(TreeTaggerPreferences.INSTALL_PATH, TreeTaggerPreferences.PREFERENCES_NODE)+"/bin/").exists()) {
+			println("Could not find TreeTagger binaries in "+TreeTaggerPreferences.getString(TreeTaggerPreferences.INSTALL_PATH, TreeTaggerPreferences.PREFERENCES_NODE)+"/bin/")
+			return false;
+		}
+		String langAll = null
+		String lang;
+		if (modelfilename.startsWith("??")) {
+			langAll = new LangDetector(binDir).getLang();
+			println "General lang $langAll"
+		}
+
+		//cleaning
+		new File(binDir, "annotations").deleteDir();
+		new File(binDir, "annotations").mkdir();
+		new File(binDir, "treetagger").deleteDir();
+		new File(binDir, "treetagger").mkdir();
+
+		ArrayList<String> milestones = [];
+
+		//BUILD TT FILE READY TO BE TAGGED
+		List<File> files = txmDir.listFiles()
+
+		println("Building TT source files ("+files.size()+") from directory "+txmDir)
+		ConsoleProgressBar cpb = new ConsoleProgressBar(files.size())
+		for (File f : files) {
+			cpb.tick()
+			File srcfile = f;
+			File resultfile = new File(binDir, "treetagger/"+f.getName()+".tt");
+			if(debug)
+				println "build tt src : "+srcfile+" >> "+resultfile
+			def ttsrcbuilder = new BuildTTSrc(srcfile.toURI().toURL())
+			if (!ttsrcbuilder.process(resultfile, null))
+				System.out.println("Failed to build tt src file of "+srcfile);
+		}
+
+		if (cancelNow) return;
+
+		File modelDirectory = new File(TreeTaggerPreferences.getString(TreeTaggerPreferences.MODELS_PATH, TreeTaggerPreferences.PREFERENCES_NODE));
+		if (!modelDirectory.exists()) {
+			println "Skipping ANNOTATE: TreeTagger language model file directory not found: "+modelDirectory.getAbsolutePath();
+			return false;
+		} else 	if (!modelDirectory.canRead()) {
+			println "Skipping ANNOTATE: impossible to access the TreeTagger language model file directory: "+modelDirectory.getAbsolutePath();
+			return false;
+		}
+		println("")
+		//Convert encoding if needed
+
+		//APPLY TREETAGGER
+		files = new File(binDir, "treetagger").listFiles()
+		println("Applying $modelfilename TreeTagger model on dir: "+new File(binDir, "treetagger")+ " ("+files.size()+" files)")
+		if (files == null || files.size() == 0)
+			return false;
+		File modelfile;
+		cpb = new ConsoleProgressBar(files.size())
+		for (File f : files) {
+			String tmpModelFileName = modelfilename
+			if (modelfilename.startsWith("??")) {
+				lang = langAll;
+				if (f.length() > LangDetector.MINIMALSIZE) {
+					lang = new LangDetector(f).getLang();
+					//println "guessing lang $f : $lang"
+				}
+				tmpModelFileName = lang+".par"
+			}
+			modelfile = new File(modelsDirectory, tmpModelFileName);
+			if (debug)
+				println "model file : "+modelfile;
+
+			File
+
+			if (!modelfile.exists()) {
+				println "Skipping ANNOTATE: '$modelfile' TreeTagger language model file not found."
+				if(System.getProperty("os.name").startsWith("Windows") || System.getProperty("os.name").startsWith("Mac"))
+					println "Windows&Mac users: the operating system might be hiding file extensions. Use your file explorer to check the file name."
+				return false;
+			} else if (!modelfile.canRead()) {
+				println "Skipping ANNOTATE: impossible to access the '$modelfile' TreeTagger language model file."
+				return false;
+			}
+
+			//			if (modelfile.getName().equals("sp.par")) {//UTF >> Latin1
+			//				if(debug)
+			//					println "fix encoding for model "+modelfile
+			//				new EncodingConverter(f, "UTF-8", "ISO-8859-1")
+			//			}
+
+			cpb.tick()
+			File infile = f;
+			File outfile = new File(f.getParent(),f.getName()+"-out.tt");
+			if (!applyTT(infile, outfile, modelfile)) {
+				return false;
+			}
+
+			//			//Reconvert encoding if needed
+			//			if (modelfile.getName().equals("sp.par")) {
+			//				if(debug)
+			//					println "convert "+f+" latin1 >> UTF-8"
+			//				new EncodingConverter(f, "ISO-8859-1", "UTF-8")
+			//			}
+		}
+		println("")
+
+		if (cancelNow) return;
+
+		//BUILD STAND-OFF FILES
+		if (modelfile == null) {
+			println "no model applied"
+			return false;
+		}
+
+		initTTOutfileInfos(binDir, modelfile, modelfilename);
+		files = new File(binDir, "treetagger").listFiles()// now contains the result files of TT
+		println "Building stdoff files ("+files.size()+") from dir:"+new File(binDir, "treetagger")+" to "+new File(binDir, "annotations");
+		if (files == null || files.size() == 0)
+			return false;
+		cpb = new ConsoleProgressBar(files.size())
+		for (File ttrezfile : files) {
+			cpb.tick()
+			File annotfile = new File(binDir, "annotations/"+ttrezfile.getName()+"-STOFF.xml");
+			if (!writeStandoffFile(ttrezfile, annotfile))
+				println("Failed to build standoff file of "+ttrezfile);
+		}
+		println("")
+
+		if (cancelNow) return;
+
+		//INJECT ANNOTATIONS
+		List<File> interpfiles = new File(binDir, "annotations").listFiles();
+		List<File> txmfiles = txmDir.listFiles();
+		if (txmfiles == null) {
+			println "No file to annotate in "+txmDir.getAbsolutePath()
+			return false;
+		}
+		interpfiles.sort(); // same order
+		txmfiles.sort(); //same order
+		println "Injecting stdoff files ("+interpfiles.size()+") data from "+new File(binDir, "annotations")+ " to xml-txm files of "+txmDir;
+		if (interpfiles == null || interpfiles.size() == 0)
+			return false;
+		cpb = new ConsoleProgressBar(interpfiles.size())
+		for (int i = 0 ; i < interpfiles.size() ; i++) {
+			cpb.tick()
+			File srcfile = txmfiles.get(i);
+			File pos1file = interpfiles.get(i);
+			File temp = File.createTempFile("Annotate", "temp", srcfile.getParentFile());
+			def builder = new AnnotationInjection(srcfile.toURI().toURL(), pos1file.toURI().toURL());
+			if (!builder.process(temp)) {
+				return false;
+			}
+			builder = null;
+
+			//println "renaming files..."
+			if (!(srcfile.delete() && temp.renameTo(srcfile)))
+				println "Warning can't rename file "+temp+" to "+srcfile
+		}
+		println("")
+		return true;
+	}
+
+	public void setModelsDirectory(File modelsDirectory) {
+		this.modelsDirectory = modelsDirectory;
+	}
+
+	/**
+	 * Run file by file. Allow to have one different lang per file. Default behavior add new word properties
+	 *
+	 * @param binDir
+	 * @param txmDir
+	 * @param lang associate a file name with a model filename
+	 * @return true, if successful
+	 */
+	public boolean run(File binDir, File txmDir, HashMap<String, String> langs)
+	{
+		return run(binDir, txmDir, langs, false, new String[0], new String[0]);
+	}
+
+	/**
+	 * Run file by file. Allow to have one different lang per file
+	 *
+	 * @param binDir 
+	 * @param txmDir
+	 * @param lang associate a file name with a model filename
+	 * @param replace, replace or create a word property
+	 * @return true, if successful
+	 */
+	public boolean run(File binDir, File txmDir, HashMap<String, String> langs, boolean replace, String[] properties, String[] options)
+	{
+		if (!new File(TreeTaggerPreferences.getString(TreeTaggerPreferences.INSTALL_PATH, TreeTaggerPreferences.PREFERENCES_NODE)+"/bin/").exists()) {
+			println("Path to TreeTagger is wrong "+TreeTaggerPreferences.getString(TreeTaggerPreferences.INSTALL_PATH, TreeTaggerPreferences.PREFERENCES_NODE)+"/bin/")
+			return true;
+		}
+
+		List<File> listfiles = txmDir.listFiles();
+
+		//cleaning
+		File annotDir = new File(binDir,"annotations");
+		annotDir.deleteDir();
+		annotDir.mkdir();
+		File ptreetaggerDir = new File(binDir,"ptreetagger");
+		ptreetaggerDir.deleteDir();
+		ptreetaggerDir.mkdir();
+		File treetaggerDir = new File(binDir,"treetagger");
+		treetaggerDir.deleteDir();
+		treetaggerDir.mkdir();
+
+		int cores = Runtime.getRuntime().availableProcessors()
+		int coresToUse = Math.max(1.0, cores * 0.7)
+		ExecutorService pool = Executors.newFixedThreadPool(coresToUse)
+
+		def files = txmDir.listFiles()
+		ConsoleProgressBar cpb = new ConsoleProgressBar(files.size())
+		for (File teiFile : files) {
+			int counter = 1;
+			ThreadFile t = new ThreadFile("TT_"+counter++, teiFile) {
+
+						public void run() {
+
+							if (cancelNow) return;
+							if (langs.get(f.getName()) == null) {
+								println "Error: no lang defined for file $f"
+								return;
+							}
+
+							String lang = langs.get(f.getName());
+							run(f, lang, binDir, txmDir, replace, properties, options, annotDir, ptreetaggerDir, treetaggerDir)
+
+							cpb.tick();
+						}
+					};
+
+			pool.execute(t)
+		}
+
+		pool.shutdown()
+		pool.awaitTermination(10, TimeUnit.HOURS)
+		println ""
+		return true;
+	}
+	public boolean run(File f, String lang, File binDir, File txmDir) {
+
+		File annotDir = new File(binDir,"annotations");
+		annotDir.mkdir();
+		File ptreetaggerDir = new File(binDir,"ptreetagger");
+		ptreetaggerDir.mkdir();
+		File treetaggerDir = new File(binDir,"treetagger");
+		treetaggerDir.mkdir();
+
+		return run(f, lang, binDir, txmDir, false, new String[0], new String[0], annotDir, ptreetaggerDir, treetaggerDir)
+	}
+
+
+	public boolean run(File f, String lang, File binDir, File txmDir, boolean replace, String[] properties, String[] options, File annotDir, File ptreetaggerDir, File treetaggerDir) {
+
+		File modelfile = new File(modelsDirectory, lang+".par");
+		if (!modelfile.exists()) {
+			println "Error: No Modelfile available for lang "+modelfile+". Continue import process ";
+			return false;
+		}
+		File annotfile = new File(annotDir, f.getName()+"-STDOFF.xml");
+		File ttsrcfile = new File(ptreetaggerDir, f.getName()+"-src.tt");
+		File ttrezfile = new File(treetaggerDir, f.getName()+"-out.tt");
+		//println ("TT with $model "+f+"+"+annotfile+" > "+ttsrcfile+" > "+ttrezfile);
+
+		//BUILD TT FILE READY TO BE TAGGED
+		def builder = new BuildTTSrc(f.toURL());
+		builder.process(ttsrcfile, null);
+
+		//Apply TT
+		applyTT(ttsrcfile, ttrezfile, modelfile, options);
+
+		//CREATE STANDOFF FILES
+		initTTOutfileInfos(binDir, modelfile, lang, properties);
+		writeStandoffFile(ttrezfile, annotfile)
+
+		//INJECT ANNOTATIONS
+		File tmpFile = new File(txmDir, "temp_"+f.getName())
+		builder = new AnnotationInjection(f.toURL(), annotfile.toURL(), replace);
+		builder.process(tmpFile);
+		if (!(f.delete() && tmpFile.renameTo(f))) println "Warning can't rename file "+tmpFile+" to "+f
+
+		return f.exists();
+	}
+
+	public void setCancelNow() {
+		cancelNow = true;
+	}
+
+	public class ThreadFile extends Thread {
+		File f;
+		public ThreadFile(String name, File f) {
+			this.setName(name)
+			this.f = f;
+		}
+	}
+}
\ No newline at end of file
Index: tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/AnnotationInjectionFromTTOutput.groovy
===================================================================
--- tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/AnnotationInjectionFromTTOutput.groovy	(revision 0)
+++ tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/AnnotationInjectionFromTTOutput.groovy	(revision 927)
@@ -0,0 +1,360 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2016-03-02 14:17:06 +0100 (mer., 02 mars 2016) $
+// $LastChangedRevision: 3134 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.xmltxm
+import javax.xml.stream.*
+
+import org.txm.importer.StaxIdentityParser
+import org.txm.importer.filters.*
+import org.txm.importer.PersonalNamespaceContext
+
+/**
+ * The Class AnnotationInjection.
+ *
+ * @author mdecorde
+ * 
+ * inject annotation from a stand-off file into a xml-tei-txm file
+ */
+
+public class AnnotationInjectionFromTTOutput extends StaxIdentityParser {
+
+	public static String TXMNS = "http://textometrie.org/1.0"
+
+	/** The xml reader factory. */
+	private def factory;
+
+	/** The links. */
+	private List<String> links;
+
+	/** The linkparsers. key=type*/
+	private HashMap<String, XMLStreamReader> linkparsers;
+
+	/** The anaurl. */
+	private def anaurl;
+
+	/** The anainput data. */
+	private def anainputData;
+
+	/** The anafactory. */
+	private XMLInputFactory anafactory = XMLInputFactory.newInstance();
+
+	/** The anaparser. */
+	private XMLStreamReader anaparser;
+	private XMLStreamReader headerparser;
+
+	/** The resp stmt id. */
+	String respStmtID = "";
+
+	/** The present taxonomies. */
+	ArrayList<String> presentTaxonomies = new ArrayList();
+
+	/**
+	 * Instantiates a new annotation injection.
+	 *
+	 * @param url the xml-tei-txm file
+	 * @param anaurl the stand-off file
+	 */
+	public AnnotationInjectionFromTTOutput(URL url, URL anaurl) {
+		super(url); // init reader and writer
+		try {
+			this.anaurl = anaurl;
+			factory = XMLInputFactory.newInstance();
+			this.buildLinkParsers();// build a parser per linkgroup
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		} catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+
+	private void getHeaderInfos(String containertag, boolean captureTheTag)
+	{
+		anainputData = new BufferedInputStream(anaurl.openStream());
+		headerparser = anafactory.createXMLStreamReader(anainputData);
+		boolean start = false;
+		String localname;
+		for (int event = headerparser.next(); event != XMLStreamConstants.END_DOCUMENT; event = headerparser.next())
+		{
+			//String prefix = headerparser.getNamespaceURI();
+			if (event == XMLStreamConstants.START_ELEMENT) {
+				localname = headerparser.getLocalName();
+				if (captureTheTag && localname == containertag) // start copy  after the tag
+					start = true;
+				if (start) { // copy header
+					String prefix = headerparser.getPrefix();
+					if (prefix.length() > 0)
+						writer.writeStartElement(Nscontext.getNamespaceURI(prefix), localname)
+					else
+						writer.writeStartElement(localname);
+					for (int i = 0 ; i < headerparser.getNamespaceCount(); i++)
+						writer.writeNamespace(headerparser.getNamespacePrefix(i), headerparser.getNamespaceURI(i));
+					for (int i = 0 ; i < headerparser.getAttributeCount(); i++)
+						writer.writeAttribute(headerparser.getAttributeLocalName(i), headerparser.getAttributeValue(i));
+				}
+				if (!captureTheTag && localname == containertag) // start copy  after the tag
+					start = true;
+			} else if (event == XMLStreamConstants.END_ELEMENT) {
+				localname = headerparser.getLocalName();
+				if (!captureTheTag && localname == containertag)
+					break;// stop looping
+
+				if (start)
+					writer.writeEndElement();
+
+				if (captureTheTag && localname == containertag)
+					break;// stop looping
+			} else if (event == XMLStreamConstants.CHARACTERS) {
+				if (start)
+					writer.writeCharacters(headerparser.getText());
+			} else if (event == XMLStreamConstants.COMMENT) {
+				if (start)
+					writer.writeComment(headerparser.getText());
+			}
+		}
+		headerparser.close();
+	}
+
+	/**
+	 * find all refs.
+	 *
+	 * @return the list of link parser
+	 */
+	private List<String> findGrpLink()
+	{
+		ArrayList<String> links = new ArrayList<String>();
+		anainputData = anaurl.openStream();
+		anaparser = anafactory.createXMLStreamReader(anainputData);
+
+		for (int event = anaparser.next(); event != XMLStreamConstants.END_DOCUMENT; event = anaparser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) {
+				if (anaparser.getLocalName().matches("linkGrp")) {
+					String targetsvalue = anaparser.getAttributeValue(0)
+
+					if (links.contains(targetsvalue)) {
+						System.err.println("Warning: Multiple group declaration : "+targetsvalue+" has already been added, the first one will be used")
+					} else {
+						links.add(targetsvalue); // add the taxonomy type
+					}
+				} else if (anaparser.getLocalName().matches("respStmt")) {
+					respStmtID = anaparser.getAttributeValue(0); // one attribute (id) only
+				}
+			}
+		}
+		anaparser.close();
+		return links;
+	}
+
+	/**
+	 * Builds the link parsers.
+	 * I need to know what groups exists to build a parser per taxonomy and go to the first link element
+	 */
+	private void buildLinkParsers()
+	{
+		// link group of the standoff file
+		links = findGrpLink();
+		linkparsers = new HashMap<String, XMLStreamReader>();
+
+		// build one parser per link group
+		for (String link : links) { // build a parser per group
+			anainputData = new BufferedInputStream(anaurl.openStream());
+			linkparsers.put(link, anafactory.createXMLStreamReader(anainputData));
+		}
+
+		//for each parser
+		for (String link : links) {
+			anaparser = linkparsers.get(link);
+			for (int event = anaparser.next(); event != XMLStreamConstants.END_DOCUMENT; event = anaparser.next()) {
+				if (event == XMLStreamConstants.START_ELEMENT) {
+					if (anaparser.getLocalName().equals("linkGrp")) { // position the parser to the right group
+						String targetsvalue = anaparser.getAttributeValue(0)
+						if (targetsvalue.equals(link))
+							break; // next element is a link start tag
+					}
+				}
+			}
+		}
+	}
+
+	/**
+	 * get the next tei:link value of a tei:LinkGrp.
+	 *
+	 * @param link the link
+	 * @return the next ana
+	 */
+	private String getNextAnaValue(String link, String wordId)
+	{
+		anaparser = linkparsers.get(link);
+		def m;
+		for (int event = anaparser.next(); event != XMLStreamConstants.END_DOCUMENT; event = anaparser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) {
+				if (anaparser.getLocalName().matches("link")) {
+					String targetsvalue = anaparser.getAttributeValue(0)
+					if ((m = targetsvalue =~ /#(.*) #(.*)/)) { // balise externe
+						def g1 = m[0][1];
+						def g2 = m[0][2];
+
+						String anavalue = g2;
+						anavalue = anavalue.replace("&lt;", "<")
+						return anavalue;
+					} else {
+						System.err.println("Error: getNextAna(): link target is not well formed:  = "+anaparser.getAttributeValue(0));
+					}
+				}
+			}
+		}
+		return "";
+	}
+
+	/**
+	 * build the ana tags of a word.
+	 *
+	 * @param wordId the word id
+	 * @return the ana tag
+	 */
+	private void writeAnaTag(String wordId)
+	{
+		String anabalises ="\n";
+		for (String link : links) {
+			writer.writeStartElement(TXMNS, "ana");
+			writer.writeAttribute("resp", "#"+respStmtID);
+			writer.writeAttribute("type", "#"+link);
+			writer.writeCharacters(getNextAnaValue(link, wordId));
+			writer.writeEndElement(); // txm:ana
+		}
+	}
+
+	String wordId;
+	boolean flagSourceDesc = false;
+	protected void processStartElement()
+	{
+		if (parser.getLocalName().matches("taxonomy")) {
+			String taxo = parser.getAttributeValue(0) // taxonomy type
+			presentTaxonomies.add(taxo);
+		}
+
+		for (int i= 0 ; i < parser.getAttributeCount() ;i++ ) {
+			if (parser.getAttributeLocalName(i) == "id") {
+				wordId = parser.getAttributeValue(i);
+				break
+			}
+		}
+		super.processStartElement();
+	}
+
+	boolean applicationWritten = false;
+	boolean taxonomiesWritten = false;
+	protected void processEndElement() {
+		switch (parser.getLocalName()) {
+			case "w":
+				writeAnaTag(wordId);
+				break;
+
+			case "appInfo":
+				applicationWritten = true;
+				getHeaderInfos("appInfo", false);
+				break;
+
+			case "classDecl":
+				taxonomiesWritten = true;
+				getHeaderInfos("classDecl", false);
+				break;
+
+			case "encodingDesc":
+				if (!applicationWritten) {
+					writer.writeStartElement("appInfo");
+					getHeaderInfos("appInfo", false);
+					writer.writeEndElement(); // appInfo
+				}
+				if (!taxonomiesWritten) {
+					writer.writeStartElement("classDecl");
+					getHeaderInfos("classDecl", false);
+					writer.writeEndElement(); // classDecl
+				}
+				break;
+
+			case "titleStmt":
+				if (flagSourceDesc) {
+					//output.write(this.respStmt+"\n")
+					getHeaderInfos("respStmt", true);
+					flagSourceDesc = false;
+					break;
+				}
+				break;
+		}
+		super.processEndElement();
+	}
+
+	/** The declarenamespace. */
+	boolean declarenamespace = false;
+
+	/**
+	 * Declare namespace.
+	 *
+	 * @return the java.lang. object
+	 */
+	private declareNamespace() {
+		if (!declarenamespace) {
+			writer.writeDefaultNamespace("http://www.tei-c.org/ns/1.0");
+			writer.writeNamespace("txm", TXMNS);
+			declarenamespace = true;
+		}
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+
+		String rootDir = "~/xml/rgaqcj/";
+		new File(rootDir + "/injection/").mkdir();
+
+		def milestones = [
+			"tagUsage",
+			"pb",
+			"lb",
+			"catRef"]// the tags who
+		File srcfile = new File(rootDir, "/anainline/", "roland.xml");
+		File pos1file = new File(rootDir, "/pos/", "rolandTT1-w-ana.xml");
+
+		File src2file = new File(rootDir, "/injection/", "roland.xml");
+		File pos2file = new File(rootDir, "/pos/", "rolandTT2-w-ana.xml");
+
+		println("process file : " + srcfile + " with : " + pos1file);
+		def builder = new AnnotationInjectionFromTTOutput(srcfile.toURI().toURL(),
+				pos1file.toURI().toURL(), milestones);
+		builder.transfomFile(new File(rootDir + "/injection/", "roland.xml"));
+
+		println("process file : " + src2file + " with : " + pos1file);
+		builder = new AnnotationInjectionFromTTOutput(src2file.toURI().toURL(), pos2file.toURI().toURL(),
+				milestones);
+		builder.transfomFile(rootDir + "/injection/", "roland-FINAL.xml");
+
+		return;
+	}
+}
Index: tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/package.html
===================================================================
--- tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/package.html	(revision 0)
+++ tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/package.html	(revision 927)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<p>Manages xml-tei-txm files</p>
+</body>
+</html>
\ No newline at end of file

Property changes on: tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/BuildTTSrc.groovy
===================================================================
--- tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/BuildTTSrc.groovy	(revision 0)
+++ tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/BuildTTSrc.groovy	(revision 927)
@@ -0,0 +1,218 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar. 24 janv. 2017) $
+// $LastChangedRevision: 3400 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.importer.xmltxm
+
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.ArrayList;
+import javax.xml.stream.*;
+import java.net.URL;
+
+import org.txm.Toolbox;
+import org.txm.importer.filters.*;
+import org.txm.treetagger.core.preferences.TreeTaggerPreferences
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class BuildTTSrc.
+ *
+ * @author mdecorde
+ * build the TT source for tigerSearch
+ */
+
+public class BuildTTSrc {
+	
+	/** The url. */
+	private def url;
+	
+	/** The input data. */
+	private def inputData;
+	
+	/** The factory. */
+	private def factory;
+	
+	/** The parser. */
+	private XMLStreamReader parser;
+	
+	/** The output. */
+	private BufferedWriter output;
+	
+	/**
+	 * Instantiates a new builds the tt src.
+	 * uses XML-TXM V2
+	 *
+	 * @param url the url of the file to process
+	 */
+	public BuildTTSrc(URL url) {
+		try {
+			this.url = url;
+			inputData = url.openStream();
+			factory = XMLInputFactory.newInstance();
+			parser = factory.createXMLStreamReader(inputData);
+			
+		} catch (XMLStreamException ex) {
+			System.out.println(ex);
+		} catch (IOException ex) {
+			System.out.println("IOException while parsing ");
+		}
+	}
+	
+	/**
+	 * Creates the output.
+	 *
+	 * @param outfile the outfile
+	 * @return true, if successful
+	 */
+	private boolean createOutput(File outfile) {
+		try {
+			File f = outfile;
+			output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile),
+					"UTF-8"));
+			return true;
+		} catch (Exception e) {
+			System.out.println(e.getLocalizedMessage());
+			return false;
+		}
+	}
+	
+	/**
+	 * Process.
+	 *
+	 * @param outfile the outfile
+     * @param formtype, if multiple form, use this param to choose the correct one, if null takes the first form found
+	 * @return true, if successful
+	 */
+	public boolean process(File outfile, String formtype) {
+		if (!createOutput(outfile))
+			return false;
+		
+		boolean flagform = false; // to catch the content of the form tag
+		boolean firstform = false; // to know if its the first form of the w element
+		String form = ""; // the content of the form tag
+		String lastopenlocalname = "";
+		String localname = "";
+		StringBuffer buffer = new StringBuffer();
+		try {
+			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+				switch (event) {
+					case XMLStreamConstants.START_ELEMENT:
+						localname = parser.getLocalName();
+						switch (localname) {
+							case "w":
+								//firstform = true;
+								break;
+							case "form":
+//								if (firstform) {
+//									if (formtype != null) {
+//										if(parser.getAttributeCount() > 0 
+//											&& parser.getAttributeValue(0).equals(formtype)) // only one attribute in form, type
+//											flagform = true;
+//									}
+//									else
+									flagform = true;
+									form = "";
+									firstform = false;
+								//}
+								break;
+							case "s": // TreeTagger can use s tags
+								buffer.append("<s>\n");
+								break;
+						}
+						break;
+					case XMLStreamConstants.END_ELEMENT:
+						localname = parser.getLocalName();
+						switch (localname) {
+							case "form":
+								flagform = false;
+								form = form.trim()
+								if (form.length() == 0) buffer.append("__EMPTY__\n");
+								else buffer.append(form.replace("\n", "").replace("<", "&lt;")+ "\n");
+								//buffer.append(form+ "\n"); // its a txt file no need to use entities
+								break;
+							
+							case "s":
+								buffer.append("</s>\n");
+								break;
+						}
+						break;
+					
+					case XMLStreamConstants.CHARACTERS:
+						if (flagform) {
+							if (parser.getText().length() > 0)
+								form += parser.getText();
+						}
+						break;
+				}
+			}
+
+			String str = buffer.toString()
+			if ("false".equals(TreeTaggerPreferences.getString(TreeTaggerPreferences.FIX_APOSTROPHES, TreeTaggerPreferences.PREFERENCES_NODE))) {
+				str = str.replace("’", "'").replace("‘", "'");
+			}
+			output.write(str)
+			output.close();
+			parser.close();
+			inputData.close();
+		} catch (Exception ex) {
+			System.out.println(ex);
+			return false;
+		} 
+		
+		return true;
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+		
+		String rootDir = "~/xml/rgaqcj/";
+		// new File(rootDir+"/identity/").mkdir();
+		
+		ArrayList<String> milestones = new ArrayList<String>();// the tags who
+		// you want them
+		// to stay
+		// milestones
+		milestones.add("tagUsage");
+		milestones.add("pb");
+		milestones.add("lb");
+		milestones.add("catRef");
+		
+		File srcfile = new File(rootDir + "anainline/", "roland-p5.xml");
+		File resultfile = new File(rootDir + "ttsrc/", "roland-p5.tt");
+		println("build ttsrc file : " + srcfile + " to : " + resultfile);
+		
+		def builder = new BuildTTSrc(srcfile.toURL(), milestones);
+		builder.process(resultfile);
+		
+		return;
+	}
+	
+}
Index: tmp/org.txm.treetagger.core/plugin.xml
===================================================================
--- tmp/org.txm.treetagger.core/plugin.xml	(revision 926)
+++ tmp/org.txm.treetagger.core/plugin.xml	(revision 927)
@@ -7,5 +7,12 @@
             class="org.txm.treetagger.core.preferences.TreeTaggerPreferences">
       </initializer>
    </extension>
+   <extension
+         point="org.txm.annotation.core.AnnotationEngine">
+      <AnnotationEngine
+            class="org.txm.treetagger.core.TreeTaggerEngine"
+            description="Call TreeTagger treetagger train processus to annotate corpus">
+      </AnnotationEngine>
+   </extension>
 
 </plugin>
Index: tmp/org.txm.treetagger.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- tmp/org.txm.treetagger.core/.settings/org.eclipse.jdt.core.prefs	(revision 926)
+++ tmp/org.txm.treetagger.core/.settings/org.eclipse.jdt.core.prefs	(revision 927)
@@ -1,7 +1,12 @@
 eclipse.preferences.version=1
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
 org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
 org.eclipse.jdt.core.compiler.source=1.6
Index: tmp/org.txm.treetagger.core/.settings/org.eclipse.jdt.groovy.core.prefs
===================================================================
--- tmp/org.txm.treetagger.core/.settings/org.eclipse.jdt.groovy.core.prefs	(revision 0)
+++ tmp/org.txm.treetagger.core/.settings/org.eclipse.jdt.groovy.core.prefs	(revision 927)
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+groovy.compiler.level=25
+groovy.script.filters=**/*.dsld,y,**/*.gradle,n

Property changes on: tmp/org.txm.treetagger.core/.settings/org.eclipse.jdt.groovy.core.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.treetagger.core/.classpath
===================================================================
--- tmp/org.txm.treetagger.core/.classpath	(revision 926)
+++ tmp/org.txm.treetagger.core/.classpath	(revision 927)
@@ -7,5 +7,7 @@
 		</accessrules>
 	</classpathentry>
 	<classpathentry kind="src" path="src"/>
+	<classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/>
+	<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: tmp/org.txm.treetagger.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.treetagger.core/META-INF/MANIFEST.MF	(revision 926)
+++ tmp/org.txm.treetagger.core/META-INF/MANIFEST.MF	(revision 927)
@@ -1,6 +1,7 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.core;bundle-version="0.8.0";visibility:=reexport
-Export-Package: org.txm.treetagger.core.preferences
+Require-Bundle: org.txm.annotation.core;visibility:=reexport
+Export-Package: org.txm.treetagger.core,
+ org.txm.treetagger.core.preferences
 Bundle-ActivationPolicy: lazy
 Bundle-Version: 1.0.0.qualifier
 Bundle-Name: TreeTagger Core
Index: tmp/org.txm.treetagger.core/.project
===================================================================
--- tmp/org.txm.treetagger.core/.project	(revision 926)
+++ tmp/org.txm.treetagger.core/.project	(revision 927)
@@ -22,6 +22,7 @@
 		</buildCommand>
 	</buildSpec>
 	<natures>
+		<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
 		<nature>org.eclipse.pde.PluginNature</nature>
 		<nature>org.eclipse.jdt.core.javanature</nature>
 	</natures>
Index: tmp/TXMReleasePlugins.site/site.xml
===================================================================
--- tmp/TXMReleasePlugins.site/site.xml	(revision 926)
+++ tmp/TXMReleasePlugins.site/site.xml	(revision 927)
@@ -8,4 +8,5 @@
    <feature url="features/org.txm.backtomedia.feature_1.0.0.201806251508.jar" id="org.txm.backtomedia.feature" version="1.0.0.201806251508"/>
    <feature url="features/org.txm.textbalance.feature_1.0.0.201806251508.jar" id="org.txm.textbalance.feature" version="1.0.0.201806251508"/>
    <feature url="features/org.txm.wordcloud.feature_1.0.0.201806251508.jar" id="org.txm.wordcloud.feature" version="1.0.0.201806251508"/>
+   <feature url="features/org.txm.rcp.feature_1.0.0.qualifier.jar" id="org.txm.rcp.feature" version="1.0.0.qualifier"/>
 </site>
Index: tmp/org.txm.libs.groovy-all/lib/groovy-all-2.3.7.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: tmp/org.txm.libs.groovy-all/lib/groovy-test-junit5-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-test-junit5-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-datetime-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-datetime-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-jmx-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-jmx-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-templates-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-templates-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-sql-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-sql-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-xml-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-xml-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-macro-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-macro-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-console-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-console-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-testng-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-testng-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-json-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-json-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-bsf-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-bsf-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-dateutil-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-dateutil-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-groovydoc-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-groovydoc-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-docgenerator-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-docgenerator-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-test-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-test-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-cli-commons-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-cli-commons-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-groovysh-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-groovysh-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-json-direct-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-json-direct-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-ant-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-ant-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-servlet-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-servlet-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-nio-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-nio-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-jsr223-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-jsr223-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-swing-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-swing-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/lib/groovy-cli-picocli-2.5.0-indy.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.libs.groovy-all/lib/groovy-cli-picocli-2.5.0-indy.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.libs.groovy-all/build.properties
===================================================================
--- tmp/org.txm.libs.groovy-all/build.properties	(revision 926)
+++ tmp/org.txm.libs.groovy-all/build.properties	(revision 927)
@@ -1,4 +1,27 @@
 bin.includes = META-INF/,\
-               lib/,\
-               lib/groovy-all-2.3.7.jar,\
-               .
+               .,\
+               lib/groovy-2.5.0-indy.jar,\
+               lib/groovy-ant-2.5.0-indy.jar,\
+               lib/groovy-bsf-2.5.0-indy.jar,\
+               lib/groovy-cli-commons-2.5.0-indy.jar,\
+               lib/groovy-cli-picocli-2.5.0-indy.jar,\
+               lib/groovy-console-2.5.0-indy.jar,\
+               lib/groovy-datetime-2.5.0-indy.jar,\
+               lib/groovy-dateutil-2.5.0-indy.jar,\
+               lib/groovy-docgenerator-2.5.0-indy.jar,\
+               lib/groovy-groovydoc-2.5.0-indy.jar,\
+               lib/groovy-groovysh-2.5.0-indy.jar,\
+               lib/groovy-jmx-2.5.0-indy.jar,\
+               lib/groovy-json-2.5.0-indy.jar,\
+               lib/groovy-json-direct-2.5.0-indy.jar,\
+               lib/groovy-jsr223-2.5.0-indy.jar,\
+               lib/groovy-macro-2.5.0-indy.jar,\
+               lib/groovy-nio-2.5.0-indy.jar,\
+               lib/groovy-servlet-2.5.0-indy.jar,\
+               lib/groovy-sql-2.5.0-indy.jar,\
+               lib/groovy-swing-2.5.0-indy.jar,\
+               lib/groovy-templates-2.5.0-indy.jar,\
+               lib/groovy-test-2.5.0-indy.jar,\
+               lib/groovy-test-junit5-2.5.0-indy.jar,\
+               lib/groovy-testng-2.5.0-indy.jar,\
+               lib/groovy-xml-2.5.0-indy.jar
Index: tmp/org.txm.libs.groovy-all/.classpath
===================================================================
--- tmp/org.txm.libs.groovy-all/.classpath	(revision 926)
+++ tmp/org.txm.libs.groovy-all/.classpath	(revision 927)
@@ -2,6 +2,30 @@
 <classpath>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry exported="true" kind="lib" path="lib/groovy-all-2.3.7.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-ant-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-bsf-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-cli-commons-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-cli-picocli-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-console-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-datetime-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-dateutil-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-docgenerator-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-groovydoc-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-groovysh-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-jmx-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-json-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-json-direct-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-jsr223-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-macro-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-nio-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-servlet-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-sql-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-swing-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-templates-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-test-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-test-junit5-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-testng-2.5.0-indy.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/groovy-xml-2.5.0-indy.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: tmp/org.txm.libs.groovy-all/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.libs.groovy-all/META-INF/MANIFEST.MF	(revision 926)
+++ tmp/org.txm.libs.groovy-all/META-INF/MANIFEST.MF	(revision 927)
@@ -3,14 +3,44 @@
 Bundle-Name: Groovy-all
 Bundle-SymbolicName: org.txm.libs.groovy-all
 Bundle-Version: 2.3.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-ClassPath: .,
+ lib/groovy-xml-2.5.0-indy.jar,
+ lib/groovy-2.5.0-indy.jar,
+ lib/groovy-ant-2.5.0-indy.jar,
+ lib/groovy-bsf-2.5.0-indy.jar,
+ lib/groovy-cli-commons-2.5.0-indy.jar,
+ lib/groovy-cli-picocli-2.5.0-indy.jar,
+ lib/groovy-console-2.5.0-indy.jar,
+ lib/groovy-datetime-2.5.0-indy.jar,
+ lib/groovy-dateutil-2.5.0-indy.jar,
+ lib/groovy-docgenerator-2.5.0-indy.jar,
+ lib/groovy-groovydoc-2.5.0-indy.jar,
+ lib/groovy-groovysh-2.5.0-indy.jar,
+ lib/groovy-jmx-2.5.0-indy.jar,
+ lib/groovy-json-2.5.0-indy.jar,
+ lib/groovy-json-direct-2.5.0-indy.jar,
+ lib/groovy-jsr223-2.5.0-indy.jar,
+ lib/groovy-macro-2.5.0-indy.jar,
+ lib/groovy-nio-2.5.0-indy.jar,
+ lib/groovy-servlet-2.5.0-indy.jar,
+ lib/groovy-sql-2.5.0-indy.jar,
+ lib/groovy-swing-2.5.0-indy.jar,
+ lib/groovy-templates-2.5.0-indy.jar,
+ lib/groovy-test-2.5.0-indy.jar,
+ lib/groovy-test-junit5-2.5.0-indy.jar,
+ lib/groovy-testng-2.5.0-indy.jar
 Export-Package: groovy.beans,
+ groovy.cli,
+ groovy.cli.commons,
+ groovy.cli.picocli,
  groovy.grape,
  groovy.inspect,
  groovy.inspect.swingui,
  groovy.io,
  groovy.jmx.builder,
  groovy.json,
- groovy.json.internal,
+ groovy.junit5.plugin,
  groovy.lang,
  groovy.mock.interceptor,
  groovy.model,
@@ -27,8 +57,10 @@
  groovy.time,
  groovy.transform,
  groovy.transform.builder,
+ groovy.transform.options,
  groovy.transform.stc,
  groovy.ui,
+ groovy.ui.icons,
  groovy.ui.text,
  groovy.ui.view,
  groovy.util,
@@ -36,6 +68,7 @@
  groovy.util.slurpersupport,
  groovy.xml,
  groovy.xml.dom,
+ groovy.xml.jaxb,
  groovy.xml.streamingmarkupsupport,
  groovyjarjarantlr,
  groovyjarjarantlr.ASdebug,
@@ -55,6 +88,25 @@
  groovyjarjarasm.asm.tree,
  groovyjarjarasm.asm.util,
  groovyjarjarcommonscli,
+ groovyjarjarpicocli,
+ groovyjarjarpicocli.groovy,
+ org.apache.groovy.ast.tools,
+ org.apache.groovy.datetime.extensions,
+ org.apache.groovy.dateutil.extensions,
+ org.apache.groovy.docgenerator,
+ org.apache.groovy.internal.metaclass,
+ org.apache.groovy.internal.util,
+ org.apache.groovy.io,
+ org.apache.groovy.json,
+ org.apache.groovy.json.internal,
+ org.apache.groovy.jsondirect,
+ org.apache.groovy.lang.annotation,
+ org.apache.groovy.metaclass,
+ org.apache.groovy.plugin,
+ org.apache.groovy.plugin.testng,
+ org.apache.groovy.sql.extensions,
+ org.apache.groovy.util,
+ org.apache.groovy.util.concurrentlinkedhashmap,
  org.codehaus.groovy,
  org.codehaus.groovy.ant,
  org.codehaus.groovy.antlr,
@@ -63,6 +115,7 @@
  org.codehaus.groovy.antlr.treewalker,
  org.codehaus.groovy.ast,
  org.codehaus.groovy.ast.builder,
+ org.codehaus.groovy.ast.decompiled,
  org.codehaus.groovy.ast.expr,
  org.codehaus.groovy.ast.stmt,
  org.codehaus.groovy.ast.tools,
@@ -70,8 +123,10 @@
  org.codehaus.groovy.bsf,
  org.codehaus.groovy.classgen,
  org.codehaus.groovy.classgen.asm,
+ org.codehaus.groovy.classgen.asm.indy,
+ org.codehaus.groovy.classgen.asm.indy.sc,
  org.codehaus.groovy.classgen.asm.sc,
- org.codehaus.groovy.cli,
+ org.codehaus.groovy.classgen.asm.util,
  org.codehaus.groovy.control,
  org.codehaus.groovy.control.customizers,
  org.codehaus.groovy.control.customizers.builder,
@@ -79,9 +134,16 @@
  org.codehaus.groovy.control.messages,
  org.codehaus.groovy.groovydoc,
  org.codehaus.groovy.jsr223,
+ org.codehaus.groovy.macro.matcher,
+ org.codehaus.groovy.macro.matcher.internal,
+ org.codehaus.groovy.macro.methods,
+ org.codehaus.groovy.macro.runtime,
+ org.codehaus.groovy.macro.transform,
  org.codehaus.groovy.plugin,
  org.codehaus.groovy.reflection,
+ org.codehaus.groovy.reflection.android,
  org.codehaus.groovy.reflection.stdclasses,
+ org.codehaus.groovy.reflection.v7,
  org.codehaus.groovy.runtime,
  org.codehaus.groovy.runtime.callsite,
  org.codehaus.groovy.runtime.dgmimpl,
@@ -98,6 +160,9 @@
  org.codehaus.groovy.tools.ast,
  org.codehaus.groovy.tools.groovydoc,
  org.codehaus.groovy.tools.groovydoc.gstringTemplates,
+ org.codehaus.groovy.tools.groovydoc.gstringTemplates.classLevel,
+ org.codehaus.groovy.tools.groovydoc.gstringTemplates.packageLevel,
+ org.codehaus.groovy.tools.groovydoc.gstringTemplates.topLevel,
  org.codehaus.groovy.tools.gse,
  org.codehaus.groovy.tools.javac,
  org.codehaus.groovy.tools.shell,
@@ -114,7 +179,6 @@
  org.codehaus.groovy.util,
  org.codehaus.groovy.vmplugin,
  org.codehaus.groovy.vmplugin.v5,
- org.codehaus.groovy.vmplugin.v6
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
-Bundle-ClassPath: .,
- lib/groovy-all-2.3.7.jar
+ org.codehaus.groovy.vmplugin.v6,
+ org.codehaus.groovy.vmplugin.v7,
+ org.codehaus.groovy.vmplugin.v8
Index: tmp/org.txm.tigersearch.rcp/.settings/org.eclipse.jdt.groovy.core.prefs
===================================================================
--- tmp/org.txm.tigersearch.rcp/.settings/org.eclipse.jdt.groovy.core.prefs	(revision 926)
+++ tmp/org.txm.tigersearch.rcp/.settings/org.eclipse.jdt.groovy.core.prefs	(revision 927)
@@ -1,3 +1,3 @@
 eclipse.preferences.version=1
-groovy.compiler.level=-1
+groovy.compiler.level=25
 groovy.script.filters=**/*.dsld,y,**/*.gradle,n
Index: tmp/org.txm.tigersearch.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.tigersearch.rcp/META-INF/MANIFEST.MF	(revision 926)
+++ tmp/org.txm.tigersearch.rcp/META-INF/MANIFEST.MF	(revision 927)
@@ -1,17 +1,6 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.rcp;bundle-version="0.7.8";visibility:=reexpor
- t,org.txm.core;bundle-version="0.7.0";visibility:=reexport,org.eclips
- e.ui;visibility:=reexport,org.eclipse.core.runtime;visibility:=reexpo
- rt,org.eclipse.ui.editors;bundle-version="3.8.200";visibility:=reexpo
- rt,org.eclipse.swt;visibility:=reexport,org.txm.searchengine.core;bun
- dle-version="1.0.0";visibility:=reexport,org.txm.searchengine.cqp.cor
- e;bundle-version="1.1.0";visibility:=reexport,org.txm.statsengine.cor
- e;bundle-version="1.0.0";visibility:=reexport,org.txm.statsengine.r.c
- ore;bundle-version="1.0.0";visibility:=reexport,org.txm.statsengine.r
- .rcp;bundle-version="1.0.0";visibility:=reexport,org.txm.index.core;b
- undle-version="1.0.0";visibility:=reexport,org.txm.index.rcp;bundle-v
- ersion="1.0.0";visibility:=reexport,org.txm.utils;visibility:=reexpor
- t,org.txm.groovy.core;bundle-version="1.0.0";visibility:=reexport
+Require-Bundle: org.txm.index.rcp;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.groovy.core;bundle-version="1.0.0";visibility:=reexport
 Export-Package: .,com.sun.java.help.impl,com.sun.java.help.search,com.
  sun.msv.datatype,com.sun.msv.datatype.xsd,com.sun.msv.datatype.xsd.da
  tetime,com.sun.msv.datatype.xsd.ngimpl,com.sun.msv.driver.textui,com.
Index: tmp/org.txm.tigersearch.rcp/groovy/org/txm/importer/srcmf/srcmfLoader.groovy
===================================================================
--- tmp/org.txm.tigersearch.rcp/groovy/org/txm/importer/srcmf/srcmfLoader.groovy	(revision 926)
+++ tmp/org.txm.tigersearch.rcp/groovy/org/txm/importer/srcmf/srcmfLoader.groovy	(revision 927)
@@ -34,9 +34,10 @@
 import org.txm.importer.xmltxm.compiler;
 import org.txm.importer.xml.pager;
 import org.txm.objects.*;
-import org.txm.utils.*;
+import org.txm.utils.*
+import org.txm.utils.io.;
 import org.txm.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.metadatas.*;
 import org.txm.utils.i18n.*;
 import org.w3c.dom.Element
@@ -226,4 +227,4 @@
 catch (IOException e) { System.out.println("IO: "+e.getMessage()); }
 catch (SAXException e) { System.out.println("SAX: "+e.getMessage()); }
 
-tigerXmlAll.delete()
+tigerXmlAll.delete()
\ No newline at end of file
Index: tmp/org.txm.tigersearch.rcp/groovy/org/txm/importer/tigersearch/tigersearchLoader.groovy
===================================================================
--- tmp/org.txm.tigersearch.rcp/groovy/org/txm/importer/tigersearch/tigersearchLoader.groovy	(revision 926)
+++ tmp/org.txm.tigersearch.rcp/groovy/org/txm/importer/tigersearch/tigersearchLoader.groovy	(revision 927)
@@ -34,7 +34,7 @@
 import org.txm.tokenizer.TokenizerClasses;
 import org.txm.utils.*;
 import org.txm.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.i18n.*;
 import org.txm.metadatas.*;
 import javax.xml.stream.*;
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/commands/DoInstall.java
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/commands/DoInstall.java	(revision 926)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/commands/DoInstall.java	(revision 927)
@@ -14,6 +14,6 @@
 	{
 		File outputDirectory = new File(Toolbox.getTxmHomePath(), "scripts/import");
 		outputDirectory.mkdirs();
-		BundleUtils.copyFiles("TIGERSearchRCP", "src", "org/txm/importer/tigersearch", "tigersearchLoader.groovy", outputDirectory);
+		BundleUtils.copyFiles("org.txm.tigersearch.rcp", "groovy", "org/txm/importer/tigersearch", "tigersearchLoader.groovy", outputDirectory);
 	}
 }
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/export/ts/MatchInject.groovy
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/export/ts/MatchInject.groovy	(revision 926)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/export/ts/MatchInject.groovy	(revision 927)
@@ -3,8 +3,10 @@
 
 import org.xml.sax.XMLReader;
 import org.xml.sax.helpers.XMLReaderFactory;
-import groovy.util.slurpersupport.NodeChild
+import groovy.util.*
 
+//import groovy.util.slurpersupport.NodeChild
+
 /*
  * The script takes the <matches/> elements from file "Tiger_match.xml"
  * and inserts them at the end of the <s/> element bearing the same ID.
Index: tmp/org.txm.tigersearch.rcp/build.properties
===================================================================
--- tmp/org.txm.tigersearch.rcp/build.properties	(revision 926)
+++ tmp/org.txm.tigersearch.rcp/build.properties	(revision 927)
@@ -7,4 +7,5 @@
                lib/,\
                lib/dom4j-1.6.1.jar,\
                lib/log4j-1.2.12.jar,\
-               lib/TigerSearch.jar
+               lib/TigerSearch.jar,\
+               groovy/org/
Index: tmp/org.txm.annotation.core/src/org/txm/annotation/core/AnnotationEngine.java
===================================================================
--- tmp/org.txm.annotation.core/src/org/txm/annotation/core/AnnotationEngine.java	(revision 926)
+++ tmp/org.txm.annotation.core/src/org/txm/annotation/core/AnnotationEngine.java	(revision 927)
@@ -1,12 +1,49 @@
 package org.txm.annotation.core;
 
+import java.io.File;
+import java.io.FileFilter;
+import java.util.HashMap;
+
 import org.txm.core.engines.Engine;
 
-//FIXME: useless class
 public abstract class AnnotationEngine implements Engine {
 
 	public static final String EXTENSION_POINT_ID = AnnotationEngine.class.getCanonicalName();
 
 	@Override
 	public abstract String getName();
+	
+	/**
+	 * 
+	 * @return true if the Annotation Engine can be used in the "importer" step of import modules
+	 */
+	public abstract boolean isAutomatic();
+	
+	public abstract boolean processFile(File xmlFile, File binaryCorpusDirectory, HashMap<String, Object> parameters);
+	
+	/**
+	 * 
+	 * @param xmlFilesDirectory contains the *.xml files to process
+	 * @param binaryCorpusDirectory the output directory
+	 * @param parameters ["lang": model_file_name_without_extension]
+	 * @return
+	 */
+	public boolean processDirectory(File xmlFilesDirectory, File binaryCorpusDirectory, HashMap<String, Object> parameters) {
+		File[] files = xmlFilesDirectory.listFiles(new FileFilter() {
+			
+			@Override
+			public boolean accept(File pathname) {
+				return pathname.isFile() && !pathname.isHidden() && !pathname.getName().startsWith(".") && pathname.getName().endsWith(".xml");
+			}
+		});
+		if (files == null || files.length == 0) {
+			System.out.println("Error: no suitable file to process in "+xmlFilesDirectory);
+			return false;
+		}
+		boolean ret = true;
+		for (File xmlFile : files) {
+			ret = ret && processFile(xmlFile, binaryCorpusDirectory, parameters);
+		}
+		return ret;
+	}
 }
Index: tmp/org.txm.groovy.core/.settings/org.eclipse.jdt.groovy.core.prefs
===================================================================
--- tmp/org.txm.groovy.core/.settings/org.eclipse.jdt.groovy.core.prefs	(revision 926)
+++ tmp/org.txm.groovy.core/.settings/org.eclipse.jdt.groovy.core.prefs	(revision 927)
@@ -1,3 +1,3 @@
 eclipse.preferences.version=1
-groovy.compiler.level=-1
+groovy.compiler.level=25
 groovy.script.filters=**/*.dsld,y,**/*.gradle,n
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/doc/DocumentToTei.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/doc/DocumentToTei.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/doc/DocumentToTei.groovy	(revision 927)
@@ -30,7 +30,7 @@
 import java.io.File;
 import org.txm.importer.ApplyXsl2;
 import org.txm.importer.ConvertDocument;
-
+import org.txm.utils.zip.Zip
 /**
  * The Class DocumentToTei.
  */
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macroproto/importer/XTZImporterMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macroproto/importer/XTZImporterMacro.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macroproto/importer/XTZImporterMacro.groovy	(revision 927)
@@ -37,9 +37,10 @@
 import org.txm.importer.xml.pager;
 import org.txm.objects.*;
 import org.txm.tokenizer.TokenizerClasses;
-import org.txm.utils.*;
+import org.txm.utils.*
+import org.txm.utils.io.;
 import org.txm.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.i18n.*;
 import org.txm.metadatas.*;
 import javax.xml.stream.*;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/tigersearch/InsertAnnotationsBeroul.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/tigersearch/InsertAnnotationsBeroul.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/tigersearch/InsertAnnotationsBeroul.groovy	(revision 927)
@@ -33,7 +33,7 @@
 package org.txm.scripts.tigersearch;
 
 import org.txm.utils.treetagger.TreeTagger;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 
 // TODO: Auto-generated Javadoc
 /**
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/tal/melt/MEltAnnotate.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/tal/melt/MEltAnnotate.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/tal/melt/MEltAnnotate.groovy	(revision 927)
@@ -41,7 +41,7 @@
 import org.txm.importer.*
 import org.txm.importer.cwb.*
 import org.txm.objects.*
-import org.txm.scripts.teitxm.Annotate;
+import org.txm.importer.xmltxm.Annotate;
 import org.txm.tal.SlashFile2TTRez;
 import org.txm.utils.LangDetector;
 import org.txm.utils.treetagger.TreeTagger
@@ -147,8 +147,6 @@
 
 	public static void main(def args) {
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:/Program Files/TXM"));
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH, new File("/home/mdecorde/treetagger"));
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH, new File("/home/mdecorde/treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
 		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/cqp/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/cqp/compiler.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/cqp/compiler.groovy	(revision 927)
@@ -33,7 +33,7 @@
 import org.txm.importer.cwb.*
 import org.txm.importer.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.io.FileCopy;
 import org.txm.utils.treetagger.TreeTagger;
 import java.util.ArrayList;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/cqp/cqpLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/cqp/cqpLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/cqp/cqpLoader.groovy	(revision 927)
@@ -5,8 +5,9 @@
 import java.util.ArrayList;
 
 import org.txm.objects.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.*;
+import org.txm.core.engines.*;
 import org.txm.utils.i18n.*;
 import org.txm.metadatas.*;
 import org.txm.utils.io.FileCopy;
@@ -26,9 +27,6 @@
 	if (!org.txm.Toolbox.isInitialized()) {
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
 		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
-		//Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File("C:\\Program Files\\treetagger"));//for Windows
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
 		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/graal/qgraalLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/graal/qgraalLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/graal/qgraalLoader.groovy	(revision 927)
@@ -39,7 +39,8 @@
 //import org.txm.importer.cwb.CwbMakeAll
 //import org.txm.importer.cwb.PatchCwbRegistry;
 //import org.txm.objects.*;
-//import org.txm.utils.*;
+//import org.txm.utils.*
+import org.txm.utils.io.;
 //String userDir = System.getProperty("user.home");
 //
 //String rootDir;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xmltxm/xmltxmLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xmltxm/xmltxmLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xmltxm/xmltxmLoader.groovy	(revision 927)
@@ -40,9 +40,11 @@
 import org.txm.importer.xmltxm.compiler;
 import org.txm.importer.xml.pager;
 import org.txm.objects.*;
-import org.txm.utils.*;
+import org.txm.utils.*
+import org.txm.utils.io.;
 import org.txm.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.core.engines.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.metadatas.*;
 import org.txm.utils.i18n.*;
 import org.w3c.dom.Element;
@@ -58,8 +60,6 @@
 	params.load()
 	if (!org.txm.Toolbox.isInitialized()) {
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
 		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
@@ -236,4 +236,4 @@
 if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
 if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
 File paramFile = new File(binDir, "import.xml");
-DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xmltxm/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xmltxm/compiler.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xmltxm/compiler.groovy	(revision 927)
@@ -32,13 +32,14 @@
 import java.util.ArrayList;;
 
 import org.txm.*;
+import org.txm.core.engines.*;
 import org.txm.importer.cwb.BuildCwbEncodeArgs;
 import org.txm.importer.cwb.CwbEncode
 import org.txm.importer.cwb.CwbMakeAll
 import org.txm.importer.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.BuildTTSrc;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.BuildTTSrc;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 
 import javax.xml.stream.*;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/discours/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/discours/importer.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/discours/importer.groovy	(revision 927)
@@ -34,7 +34,7 @@
 import org.txm.importer.cwb.CwbEncode
 import org.txm.importer.cwb.CwbMakeAll
 import org.txm.metadatas.Metadatas
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 
 import javax.xml.stream.*;
 
@@ -51,7 +51,9 @@
 import java.util.List;
 
 import org.txm.*;
-import org.txm.utils.*;
+import org.txm.core.engines.*;
+import org.txm.utils.*
+import org.txm.utils.io.;
 import org.txm.utils.i18n.DetectBOM;
 
 // TODO: Auto-generated Javadoc
@@ -281,4 +283,4 @@
 		File dir = new File(System.getProperty("user.home"), "xml/discours/");
 		new importer().run(dir);
 	}
-}
+}
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/discours/discoursLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/discours/discoursLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/discours/discoursLoader.groovy	(revision 927)
@@ -32,6 +32,7 @@
 import org.txm.objects.*;
 import org.txm.utils.*;
 import org.txm.*;
+import org.txm.core.engines.*;
 import org.txm.utils.i18n.*;
 import org.w3c.dom.Element
 import org.txm.utils.xml.DomUtils;
@@ -49,8 +50,6 @@
 	if (!org.txm.Toolbox.isInitialized()) {
 
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
 		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/discours/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/discours/compiler.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/discours/compiler.groovy	(revision 927)
@@ -32,8 +32,8 @@
 import org.txm.importer.cwb.CwbMakeAll
 import org.txm.importer.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.BuildTTSrc;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.BuildTTSrc;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 
 import javax.xml.stream.*;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/lasla/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/lasla/compiler.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/lasla/compiler.groovy	(revision 927)
@@ -36,8 +36,8 @@
 import org.txm.importer.cwb.CwbMakeAll
 import org.txm.importer.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.BuildTTSrc;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.BuildTTSrc;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 
 import javax.xml.stream.*;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/lasla/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/lasla/importer.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/lasla/importer.groovy	(revision 927)
@@ -34,7 +34,7 @@
 import org.txm.importer.filters.*
 import org.txm.objects.*
 import org.txm.scripts.*
-import org.txm.scripts.teitxm.*
+import org.txm.importer.xmltxm.*
 
 import filters.CutHeader.*
 import filters.FusionHeader.*
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/lasla/laslaLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/lasla/laslaLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/lasla/laslaLoader.groovy	(revision 927)
@@ -37,8 +37,10 @@
 import org.txm.importer.xml.compiler;
 import org.txm.importer.xml.pager_old;
 import org.txm.objects.*;
-import org.txm.utils.*;
+import org.txm.utils.*
+import org.txm.utils.io.;
 import org.txm.*;
+import org.txm.core.engines.*;
 import org.txm.utils.i18n.*;
 
 // TODO: Auto-generated Javadoc
@@ -63,8 +65,6 @@
 		model="rgaqcj";//not used
 		Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
 		Toolbox.setParam(Toolbox.INSTALL_DIR,"/usr/lib/TXM");
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
 		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
@@ -162,4 +162,3 @@
 w.save()
 println "done"
 
-
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/fleurs/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/fleurs/importer.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/fleurs/importer.groovy	(revision 927)
@@ -30,8 +30,8 @@
 import org.txm.importer.*;
 import org.txm.importer.filters.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.BuildTTSrc;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.BuildTTSrc;
+import org.txm.importer.xmltxm.*;
 import javax.xml.stream.*;
 import java.io.BufferedWriter;
 import java.io.FileOutputStream;
@@ -41,6 +41,7 @@
 import java.util.List;
 
 import org.txm.*;
+import org.txm.core.engines.*;
 
 // TODO: Auto-generated Javadoc
 /**
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/fleurs/fleursLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/fleurs/fleursLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/fleurs/fleursLoader.groovy	(revision 927)
@@ -38,9 +38,11 @@
 import org.txm.importer.fleurs.pager;
 import org.txm.importer.fleurs.importer;
 import org.txm.objects.*;
-import org.txm.utils.*;
+import org.txm.utils.*
+import org.txm.utils.io.;
 import org.txm.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.core.engines.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.i18n.*;
 
 // TODO: Auto-generated Javadoc
@@ -62,8 +64,6 @@
 		encoding= "UTF-8";// not used
 		model="rgaqcj"; // not used
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File(userDir,"TXMinstall"));
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
 		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
@@ -142,4 +142,3 @@
 
 w.save();
 println ""
-
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/fleurs/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/fleurs/compiler.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/fleurs/compiler.groovy	(revision 927)
@@ -31,8 +31,8 @@
 import org.txm.importer.cwb.CwbMakeAll
 import org.txm.importer.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.BuildTTSrc;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.BuildTTSrc;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 
 import javax.xml.stream.*;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/corptef/annotate.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/corptef/annotate.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/corptef/annotate.groovy	(revision 927)
@@ -28,7 +28,7 @@
 package org.txm.importer.corptef;
 
 import org.txm.importer.cwb.*
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.importer.*;
 import org.txm.utils.treetagger.TreeTagger;
 import org.txm.Toolbox;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/corptef/corptefLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/corptef/corptefLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/corptef/corptefLoader.groovy	(revision 927)
@@ -38,7 +38,8 @@
 import org.txm.importer.corptef.pager;
 import org.txm.objects.*;
 import org.txm.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.core.engines.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.i18n.*;
 
 // TODO: Auto-generated Javadoc
@@ -91,7 +92,7 @@
 //move registry file to cwb registry dir
 File registryfile = new File(rootDir+"/registry","corptef");
 if(registryfile.exists())
-	org.txm.utils.FileCopy.copy(registryfile,new File(Toolbox.getTxmHomePath(),"registry/corptef"))
+	org.txm.utils.io.FileCopy.copy(registryfile,new File(Toolbox.getTxmHomePath(),"registry/corptef"))
 
 Workspace w = org.txm.Toolbox.workspace;
 Project p = w.getProject("default")
@@ -131,4 +132,4 @@
 //	editionbp.addPage(resultfile,ed.getIdx().get(0));
 }
 
-w.save();
+w.save();
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/corptef/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/corptef/compiler.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/corptef/compiler.groovy	(revision 927)
@@ -32,8 +32,8 @@
 import org.txm.importer.cwb.CwbMakeAll
 import org.txm.importer.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.BuildTTSrc;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.BuildTTSrc;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 
 import javax.xml.stream.*;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/corptef/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/corptef/importer.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/corptef/importer.groovy	(revision 927)
@@ -30,7 +30,7 @@
 import org.txm.importer.*;
 import org.txm.importer.filters.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 import javax.xml.stream.*;
 import java.net.URL;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/transcriber/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/transcriber/importer.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/transcriber/importer.groovy	(revision 927)
@@ -36,7 +36,7 @@
 import javax.xml.transform.stream.StreamResult;
 
 import org.txm.utils.logger.Log;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 
 import java.io.BufferedWriter;
 import java.io.File;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/transcriber/transcriberLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/transcriber/transcriberLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/transcriber/transcriberLoader.groovy	(revision 927)
@@ -44,8 +44,9 @@
 package org.txm.importer.transcriber;
 
 import java.io.File;
-import org.txm.scripts.teitxm.*;
-import org.txm.*;
+import org.txm.importer.xmltxm.*;
+import org.txm.*;
+import org.txm.core.engines.*;
 import org.txm.objects.*;
 import org.txm.utils.i18n.*;
 import org.txm.utils.*;
@@ -75,7 +76,6 @@
 	if (!org.txm.Toolbox.isInitialized()) {
 
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
 		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, "\t");
@@ -232,9 +232,12 @@
 	if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
 	println "-- ANNOTATE - Running NLP tools"
 	boolean annotationSuccess = false;
-	if (annotate && new Annotate().run(binDir, txmDir, model+".par")) {
-		annotationSuccess = true;
-	}
+if (annotate) {
+	def engine = Toolbox.getEngineManager(EngineType.ANNOTATION).getEngine("TreeTagger")
+	if (engine.processDirectory(txmDir, binDir, ["lang":model])) {
+		annotationSuccess = true;
+	}
+}
 
 	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
 	if (MONITOR != null) MONITOR.worked(25, "COMPILING")
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/alceste/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/alceste/importer.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/alceste/importer.groovy	(revision 927)
@@ -34,9 +34,9 @@
 import org.txm.scripts.*;
 import org.txm.importer.cwb.CwbEncode
 import org.txm.importer.cwb.CwbMakeAll
-import org.txm.scripts.teitxm.BuildTTSrc;
+import org.txm.importer.xmltxm.BuildTTSrc;
 import org.txm.utils.io.FileCopy;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 
 import javax.xml.stream.*;
 
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/alceste/alcesteLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/alceste/alcesteLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/alceste/alcesteLoader.groovy	(revision 927)
@@ -33,7 +33,9 @@
 import org.txm.objects.*;
 import org.txm.utils.*;
 import org.txm.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.core.engines.*;
+import org.txm.core.engines.EngineType
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.i18n.*;
 import org.w3c.dom.Element
 import org.txm.utils.xml.DomUtils;
@@ -50,8 +52,6 @@
 	params.load()
 	if (!org.txm.Toolbox.isInitialized()) {
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
 		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
@@ -100,8 +100,12 @@
 if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
 println "-- ANNOTATE - Running NLP tools"
 boolean annotationSuccess = false;
-if (annotate && new Annotate().run(binDir, txmDir, model+".par")) {
-	annotationSuccess = true;
+
+if (annotate) {
+	def engine = Toolbox.getEngineManager(EngineType.ANNOTATION).getEngine("TreeTagger")
+	if (engine.processDirectory(txmDir, binDir, ["lang":model])) {
+		annotationSuccess = true;
+	}
 }
 
 if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/alceste/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/alceste/compiler.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/alceste/compiler.groovy	(revision 927)
@@ -32,7 +32,7 @@
 import org.txm.importer.cwb.CwbMakeAll
 import org.txm.importer.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 import org.txm.core.preferences.TXMPreferences
 import org.txm.libs.cqp.CQPLibPreferences
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xmltxmpara/xmltxmparaLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xmltxmpara/xmltxmparaLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xmltxmpara/xmltxmparaLoader.groovy	(revision 927)
@@ -28,9 +28,11 @@
 import org.txm.importer.xmltxmpara.compiler;
 import org.txm.importer.xml.pager_old;
 import org.txm.objects.*;
-import org.txm.utils.*;
+import org.txm.utils.*
+import org.txm.utils.io.;
 import org.txm.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.core.engines.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.i18n.*;
 import org.txm.importer.*;
 import org.txm.importer.cwb.CwbAlign;
@@ -51,8 +53,6 @@
 	if (!org.txm.Toolbox.isInitialized()) {
 		rootDir = userDir+"/xml/qgraal";
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
 		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xmltxmpara/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xmltxmpara/compiler.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xmltxmpara/compiler.groovy	(revision 927)
@@ -36,8 +36,8 @@
 import org.txm.importer.cwb.CwbMakeAll
 import org.txm.importer.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.BuildTTSrc;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.BuildTTSrc;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 
 import javax.xml.stream.*;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/txt/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/txt/compiler.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/txt/compiler.groovy	(revision 927)
@@ -33,7 +33,7 @@
 import org.txm.importer.cwb.PatchCwbRegistry;
 import org.txm.importer.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 
 import javax.xml.stream.*;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/txt/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/txt/importer.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/txt/importer.groovy	(revision 927)
@@ -33,7 +33,7 @@
 import org.txm.importer.*
 import org.txm.importer.filters.*
 import org.txm.scripts.*
-import org.txm.scripts.teitxm.*
+import org.txm.importer.xmltxm.*
 import org.txm.utils.*
 import org.txm.utils.i18n.DetectBOM
 
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/txt/txtLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/txt/txtLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/txt/txtLoader.groovy	(revision 927)
@@ -31,8 +31,9 @@
 import org.txm.importer.txt.compiler;
 import org.txm.importer.xml.pager;
 import org.txm.objects.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.*;
+import org.txm.core.engines.*;
 import org.txm.utils.i18n.*;
 import org.txm.metadatas.*;
 import org.txm.utils.io.FileCopy;
@@ -50,7 +51,6 @@
 	params.load()
 	if (!org.txm.Toolbox.isInitialized()) {
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:/Program Files/TXM"));
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH, new File("C:/Program Files/TreeTagger"));
 		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH, new File("C:/Users/mdecorde/TXM/treetagger"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
@@ -137,8 +137,11 @@
 if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
 if (MONITOR != null) MONITOR.worked(20, "ANNOTATE - Running NLP tools")
 boolean annotationSuccess = true;
-if (annotate && !new Annotate().run(binDir, txmDir, model+".par")) {
-	annotationSuccess = false;
+if (annotate) {
+	def engine = Toolbox.getEngineManager(EngineType.ANNOTATION).getEngine("TreeTagger")
+	if (engine.processDirectory(txmDir, binDir, ["lang":model])) {
+		annotationSuccess = true;
+	}
 }
 
 println "-- COMPILING - Building Search Engine indexes"
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/TTAnnotater.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/TTAnnotater.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/TTAnnotater.groovy	(revision 927)
@@ -2,7 +2,7 @@
 
 import java.io.File;
 
-import org.txm.scripts.teitxm.Annotate
+import org.txm.importer.xmltxm.Annotate
 
 
 /**
@@ -13,8 +13,6 @@
  */
 class TTAnnotater extends Annotater {
 
-	Annotate a;
-	
 	public TTAnnotater(ImportModule module) {
 		super(module);
 	}
@@ -29,16 +27,19 @@
 		def corpusElem = module.getParameters().getCorpora().get(corpusname);
 		String lang = corpusElem.getAttribute("lang");
 
-		def hash = [:]
-		for (File txmFile : inputDirectory.listFiles()) {
-			hash[txmFile.getName()] = lang;
-		}
-		
-		a = new Annotate()
+		def engine = Toolbox.getEngineManager(EngineType.ANNOTATION).getEngine("TreeTagger")
 		if (module.isMultiThread()) {
-			isSuccessFul = a.run(module.getBinaryDirectory(), inputDirectory, hash);
+			def hash = [:]
+			for (File txmFile : inputDirectory.listFiles()) {
+				hash[txmFile.getName()] = lang;
+			}
+			if (engine.processDirectory(inputDirectory, module.getBinaryDirectory(), ["langs"=hash])) {
+				isSuccessFul = true;
+			}
 		} else {
-			isSuccessFul = a.run(module.getBinaryDirectory(), inputDirectory, lang+".par");
+			if (engine.processDirectory(inputDirectory, module.getBinaryDirectory(), ["lang"=lang])) {
+				isSuccessFul = true;
+			}
 		}
 		
 		if ("true".equals(cleanDirectories)) {
@@ -51,6 +52,6 @@
 
 	@Override
 	public void cancel() {
-		a.setCancelNow();
+		//a.setCancelNow();
 	}
 }
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/XTZImporter.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/XTZImporter.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/XTZImporter.groovy	(revision 927)
@@ -22,7 +22,7 @@
 import org.txm.utils.xml.DomUtils
 import org.txm.metadatas.Metadatas
 import org.txm.objects.BaseParameters
-import org.txm.scripts.teitxm.Xml2Ana
+import org.txm.importer.xmltxm.Xml2Ana
 import org.txm.stat.utils.ConsoleProgressBar
 import org.txm.utils.io.*
 
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/xtzLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/xtzLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/xtzLoader.groovy	(revision 927)
@@ -32,7 +32,7 @@
 import org.txm.*
 import org.txm.metadatas.*
 import org.txm.objects.*
-import org.txm.scripts.teitxm.*
+import org.txm.importer.xmltxm.*
 import org.txm.tokenizer.TokenizerClasses
 import org.txm.utils.*
 import org.txm.utils.i18n.*
@@ -52,9 +52,6 @@
 		TokenizerClasses.loadFromNode(params.getTokenizerElement(params.getCorpusElement()));
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
 		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
-		//Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File("C:\\Program Files\\treetagger"));//for Windows
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
 		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/XTZCompilerStep.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/XTZCompilerStep.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/XTZCompilerStep.groovy	(revision 927)
@@ -5,6 +5,7 @@
 import java.net.URL
 import java.util.HashMap;
 import org.txm.utils.*
+import org.txm.utils.io.
 
 public class XTZCompilerStep {
 
@@ -264,4 +265,4 @@
 		}
 		return true;
 	}
-}
+}
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/XTZImport.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/XTZImport.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/XTZImport.groovy	(revision 927)
@@ -123,9 +123,6 @@
 		String userDir = System.getProperty("user.home")
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
 		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
-		//Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File("C:\\Program Files\\treetagger"));//for Windows
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
 		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/hyperprince/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/hyperprince/compiler.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/hyperprince/compiler.groovy	(revision 927)
@@ -32,8 +32,8 @@
 import org.txm.importer.cwb.CwbMakeAll
 import org.txm.importer.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.BuildTTSrc;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.BuildTTSrc;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 
 import javax.xml.stream.*;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/hyperprince/hyperprinceLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/hyperprince/hyperprinceLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/hyperprince/hyperprinceLoader.groovy	(revision 927)
@@ -36,7 +36,7 @@
 import org.txm.importer.hyperprince.compiler;
 import org.txm.objects.*;
 import org.txm.Toolbox;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.i18n.*;
 
 // TODO: Auto-generated Javadoc
@@ -59,8 +59,6 @@
 		model="rgaqcj";
 		Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File(userDir,"TXM"));
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"TXM/treetagger"));
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"TXM/treetagger/models"));
 		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"),"TXM"));
 	}
 }
@@ -81,7 +79,12 @@
 
 //ANNOTATE
 println "-- ANNOTATE - Running NLP tools"
-new Annotate().run(homedir,model+".par");
+if (annotate) {
+	def engine = Toolbox.getEngineManager(EngineType.ANNOTATION).getEngine("TreeTagger")
+	if (engine.processDirectory(txmDir, binDir, ["lang":model])) {
+		annotationSuccess = true;
+	}
+}
 
 //COMPILATION
 println "COMPILING"
@@ -93,7 +96,7 @@
 //move registry file to cwb registry dir
 File registryfile = new File(rootDir+"/registry","hyperprince");
 if(registryfile.exists())
-	org.txm.utils.FileCopy.copy(registryfile,new File(Toolbox.getTxmHomePath(),"registry/hyperprince"))
+	org.txm.utils.io.FileCopy.copy(registryfile,new File(Toolbox.getTxmHomePath(),"registry/hyperprince"))
 
 Workspace w = org.txm.Toolbox.workspace;
 Project p = w.getProject("default")
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/hyperprince/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/hyperprince/importer.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/hyperprince/importer.groovy	(revision 927)
@@ -32,7 +32,7 @@
 import org.txm.scripts.*;
 import org.txm.importer.cwb.CwbEncode
 import org.txm.importer.cwb.CwbMakeAll
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 import javax.xml.stream.*;
 import java.net.URL;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xml/xmlLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xml/xmlLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xml/xmlLoader.groovy	(revision 927)
@@ -37,9 +37,11 @@
 import org.txm.importer.xml.pager_old;
 import org.txm.objects.*;
 import org.txm.tokenizer.TokenizerClasses;
-import org.txm.utils.*;
+import org.txm.utils.*
+import org.txm.utils.io.;
 import org.txm.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.core.engines.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.i18n.*;
 import org.txm.metadatas.*;
 import javax.xml.stream.*;
@@ -61,9 +63,6 @@
 		TokenizerClasses.loadFromNode(params.getTokenizerElement(params.getCorpusElement()));
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
 		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
-		//Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File("C:\\Program Files\\treetagger"));//for Windows
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
 		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
@@ -237,8 +236,11 @@
 if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
 println "-- ANNOTATE - Running NLP tools"
 boolean annotationSuccess = false;
-if (annotate && new Annotate().run(binDir, txmDir, model+".par")) {
-	annotationSuccess = true;
+if (annotate) {
+	def engine = Toolbox.getEngineManager(EngineType.ANNOTATION).getEngine("TreeTagger")
+	if (engine.processDirectory(txmDir, binDir, ["lang":model])) {
+		annotationSuccess = true;
+	}
 }
 
 if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xml/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xml/compiler.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xml/compiler.groovy	(revision 927)
@@ -38,7 +38,7 @@
 import org.txm.importer.cwb.CwbMakeAll
 import org.txm.importer.*
 import org.txm.scripts.*
-import org.txm.scripts.teitxm.*
+import org.txm.importer.xmltxm.*
 import org.txm.utils.treetagger.TreeTagger
 
 import javax.xml.stream.*
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xml/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xml/importer.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xml/importer.groovy	(revision 927)
@@ -37,7 +37,7 @@
 import org.txm.importer.filters.*
 import org.txm.objects.*
 import org.txm.scripts.*
-import org.txm.scripts.teitxm.*
+import org.txm.importer.xmltxm.*
 
 import filters.CutHeader.*
 import filters.FusionHeader.*
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bfm/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bfm/compiler.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bfm/compiler.groovy	(revision 927)
@@ -47,8 +47,8 @@
 import org.txm.importer.cwb.*
 import org.txm.importer.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.BuildTTSrc;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.BuildTTSrc;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 
 import javax.xml.stream.*;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bfm/bfmLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bfm/bfmLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bfm/bfmLoader.groovy	(revision 927)
@@ -2,217 +2,209 @@
 // Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
 // Lyon 2, University of Franche-Comté, University of Nice
 // Sophia Antipolis, University of Paris 3.
-//
-//
-// This file is part of the TXM platform.
-//
-// The TXM platform is free software: you can redistribute it and/or modif y
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// The TXM platform is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
-//
-//
-//
-// $LastChangedDate: 2016-03-01 10:10:58 +0100 (mar. 01 mars 2016) $
-// $LastChangedRevision: 3133 $
-// $LastChangedBy: mdecorde $
-//
-package org.txm.importer.bfm;
-
-import javax.xml.stream.XMLStreamReader;
-import org.txm.importer.ApplyXsl2;
-import org.txm.importer.bfm.importer;
-import org.txm.importer.bfm.compiler;
-import org.txm.importer.bfm.pager;
-import org.txm.objects.*;
-import org.txm.*;
-import org.txm.utils.i18n.*;
-import org.txm.scripts.teitxm.*;
-import org.txm.importer.*;
-import org.w3c.dom.Element
-import org.txm.utils.xml.DomUtils;
-import org.txm.utils.*;
-
-String userDir = System.getProperty("user.home");
-boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
-def MONITOR;
-BaseParameters params;
-try {params = paramsBinding;MONITOR=monitor} catch (Exception)
-{	println "DEV MODE";//exception means we debug
-	debug = true
-	params = new BaseParameters(new File(userDir, "xml/bfm/import.xml"))
-	params.load()
-	if (!org.txm.Toolbox.isInitialized()) {
-		//rootDir = userDir+"/xml/TESTS/alceste";  // directory which contains the source file
-
-		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
-		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
-		//Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File("C:\\Program Files\\treetagger"));//for Windows
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
-		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
-		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
-		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File("C:\\Program Files\\treetagger\\models"));//for Windows
-		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
-	}
-}
-if (params == null) { println "no parameters. Aborting"; return; }
-
-String corpusname = params.getCorpusName();
-Element corpusElem = params.corpora.get(corpusname);
-String basename = params.name;
-String rootDir = params.rootDir;
-String lang = corpusElem.getAttribute("lang");
-String model = lang
-String encoding = corpusElem.getAttribute("encoding");
-boolean annotate = "true" == corpusElem.getAttribute("annotate");
-String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
+//
+//
+// This file is part of the TXM platform.
+//
+// The TXM platform is free software: you can redistribute it and/or modif y
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The TXM platform is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
+//
+//
+//
+// $LastChangedDate: 2016-03-01 10:10:58 +0100 (mar. 01 mars 2016) $
+// $LastChangedRevision: 3133 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.importer.bfm;
+
+import javax.xml.stream.XMLStreamReader;
+import org.txm.importer.ApplyXsl2;
+import org.txm.importer.bfm.importer;
+import org.txm.importer.bfm.compiler;
+import org.txm.importer.bfm.pager;
+import org.txm.objects.*;
+import org.txm.*;
+import org.txm.core.engines.*;
+import org.txm.utils.i18n.*;
+import org.txm.importer.xmltxm.*;
+import org.txm.importer.*;
+import org.w3c.dom.Element
+import org.txm.utils.xml.DomUtils;
+import org.txm.utils.*
+import org.txm.utils.io.;
+
+String userDir = System.getProperty("user.home");
+boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
+def MONITOR;
+BaseParameters params;
+try {params = paramsBinding;MONITOR=monitor} catch (Exception)
+{	println "DEV MODE";//exception means we debug
+	debug = true
+	params = new BaseParameters(new File(userDir, "xml/bfm/import.xml"))
+	params.load()
+	if (!org.txm.Toolbox.isInitialized()) {
+		//rootDir = userDir+"/xml/TESTS/alceste";  // directory which contains the source file
+
+		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
+		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
+		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
+		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
+		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
+		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File("C:\\Program Files\\treetagger\\models"));//for Windows
+		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"), "TXM"));
+	}
+}
+if (params == null) { println "no parameters. Aborting"; return; }
+
+String corpusname = params.getCorpusName();
+Element corpusElem = params.corpora.get(corpusname);
+String basename = params.name;
+String rootDir = params.rootDir;
+String lang = corpusElem.getAttribute("lang");
+String model = lang
+String encoding = corpusElem.getAttribute("encoding");
+boolean annotate = "true" == corpusElem.getAttribute("annotate");
+String xsl = params.getXsltElement(corpusElem).getAttribute("xsl")
 def xslParams = params.getXsltParams(corpusElem);
-int wordsPerPage = params.getWordsPerPage("default")
+int wordsPerPage = params.getWordsPerPage("default")
 boolean build_edition = params.getDoEdition("default")
-
-File srcDir = new File(rootDir);
-File binDir = new File(Toolbox.getTxmHomePath(),"corpora/"+basename);
-binDir.deleteDir();
-binDir.mkdirs();
-if (!binDir.exists()) {
-	println "Could not create binDir "+binDir
-	return;
-}
-
-File txmDir = new File(binDir,"txm/$corpusname");
-txmDir.deleteDir();
-txmDir.mkdirs();
-
-// BFM XPATH PARAMETERS
-if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
-if (MONITOR != null) MONITOR.worked(1, "READ XPATH PARAMETERS")
-File paramDeclarationFile = new File(srcDir, "import.properties");
-Properties metadataXPath = new Properties();
-if (paramDeclarationFile.exists() && paramDeclarationFile.canRead()) {
-	InputStreamReader input = new InputStreamReader(new FileInputStream(paramDeclarationFile) , "UTF-8");
-	metadataXPath.load(input);
-	input.close();
-
-	if (!metadataXPath.containsKey("titre"))
-		println "Warning: parameters property file does not contain the 'titre' metadata"
-	if (!metadataXPath.containsKey("forme"))
-		println "Warning: parameters property file does not contain the 'forme' metadata in param values. The default value is 'prose'"
-}
-else
-	println "No '$paramDeclarationFile' file found"
-
-// Apply XSL
-if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
-if (MONITOR != null) MONITOR.worked(1, "APPLYING XSL")
-if (xsl != null && xslParams != null && xsl.trim().length() > 0) {
-	if (ApplyXsl2.processImportSources(new File(xsl), srcDir, new File(binDir, "src"), xslParams))
-	// return; // error during process
-	srcDir = new File(binDir, "src");
-	println ""
-}
-
-// copy txm files
-println "-- VALIDATION - checking XML source files well-formedness"
-List<File> srcfiles = srcDir.listFiles();
-for (File f : srcfiles) { // check XML format, and copy file into binDir
-	if (f.isHidden() || f.getName().equals("import.xml") || f.getName().equals("metadata.csv") || f.getName().endsWith(".properties"))
-		continue;
-	if (ValidateXml.test(f)) {
-		FileCopy.copy(f, new File(txmDir, f.getName()));
-	} else {
-		println "Won't process file "+f;
-	}
-}
-
-if (txmDir.listFiles() == null) {
-	println "No txm file to process"
-	return;
-}
-
-if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
-if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
-println "-- IMPORTER - Reading source files"
-def imp = new importer()
-if (!imp.run(srcDir, binDir, txmDir, basename, metadataXPath)) {
-	println "import process stopped";
-	return;
-}
-
-if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
-if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
-println "-- ANNOTATE - Running NLP tools - $model model"
-boolean annotate_status = true;
-if (annotate && !(new Annotate().run(binDir, txmDir,model+".par"))) {
-	println "Skipping Annotate process";
-	annotate_status = false;
-}
-
-//if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
-//if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
-//println "-- ANNOTATE - Running NLP tools - fr model"
-//annotate_status = true;
-//if (annotate && !(new Annotate().run(binDir, txmDir,"fr.par"))) {
-//	println "Skipping Annotate process";
-//	annotate_status = false;
-//}
-
-if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
-if (MONITOR != null) MONITOR.worked(25, "COMPILING")
-println "-- COMPILING - Building Search Engine indexes"
-def c = new compiler();
-if (debug) c.setDebug();
-//c.setCwbPath("~/TXM/cwb/bin");
-c.setLang(lang);
-c.setAnnotationDone(annotate_status)
-if (!c.run(binDir, txmDir, corpusname, metadataXPath)) {
-	println "import process stopped";
-	return;
-}
-
-if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
 
+File srcDir = new File(rootDir);
+File binDir = new File(Toolbox.getTxmHomePath(),"corpora/"+basename);
+binDir.deleteDir();
+binDir.mkdirs();
+if (!binDir.exists()) {
+	println "Could not create binDir "+binDir
+	return;
+}
+
+File txmDir = new File(binDir,"txm/$corpusname");
+txmDir.deleteDir();
+txmDir.mkdirs();
+
+// BFM XPATH PARAMETERS
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(1, "READ XPATH PARAMETERS")
+File paramDeclarationFile = new File(srcDir, "import.properties");
+Properties metadataXPath = new Properties();
+if (paramDeclarationFile.exists() && paramDeclarationFile.canRead()) {
+	InputStreamReader input = new InputStreamReader(new FileInputStream(paramDeclarationFile) , "UTF-8");
+	metadataXPath.load(input);
+	input.close();
+
+	if (!metadataXPath.containsKey("titre"))
+		println "Warning: parameters property file does not contain the 'titre' metadata"
+	if (!metadataXPath.containsKey("forme"))
+		println "Warning: parameters property file does not contain the 'forme' metadata in param values. The default value is 'prose'"
+}
+else
+	println "No '$paramDeclarationFile' file found"
+
+// Apply XSL
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(1, "APPLYING XSL")
+if (xsl != null && xslParams != null && xsl.trim().length() > 0) {
+	if (ApplyXsl2.processImportSources(new File(xsl), srcDir, new File(binDir, "src"), xslParams))
+	// return; // error during process
+	srcDir = new File(binDir, "src");
+	println ""
+}
+
+// copy txm files
+println "-- VALIDATION - checking XML source files well-formedness"
+List<File> srcfiles = srcDir.listFiles();
+for (File f : srcfiles) { // check XML format, and copy file into binDir
+	if (f.isHidden() || f.getName().equals("import.xml") || f.getName().equals("metadata.csv") || f.getName().endsWith(".properties"))
+		continue;
+	if (ValidateXml.test(f)) {
+		FileCopy.copy(f, new File(txmDir, f.getName()));
+	} else {
+		println "Won't process file "+f;
+	}
+}
+
+if (txmDir.listFiles() == null) {
+	println "No txm file to process"
+	return;
+}
+
+if (MONITOR != null) MONITOR.worked(1, "IMPORTER")
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+println "-- IMPORTER - Reading source files"
+def imp = new importer()
+if (!imp.run(srcDir, binDir, txmDir, basename, metadataXPath)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
+println "-- ANNOTATE - Running NLP tools - $model model"
+boolean annotate_status = true;
+if (annotate) {
+	def engine = Toolbox.getEngineManager(EngineType.ANNOTATION).getEngine("TreeTagger")
+	if (engine.processDirectory(txmDir, binDir, ["lang":model])) {
+		annotate_status = true;
+	}
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(25, "COMPILING")
+println "-- COMPILING - Building Search Engine indexes"
+def c = new compiler();
+if (debug) c.setDebug();
+//c.setCwbPath("~/TXM/cwb/bin");
+c.setLang(lang);
+c.setAnnotationDone(annotate_status)
+if (!c.run(binDir, txmDir, corpusname, metadataXPath)) {
+	println "import process stopped";
+	return;
+}
+
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+
 new File(binDir,"HTML/$corpusname").deleteDir();
 new File(binDir,"HTML/$corpusname").mkdirs();
 if (build_edition) {
-
-	println "-- EDITION"
-	if (MONITOR != null) MONITOR.worked(25, "EDITION")
-	File outdir = new File(binDir,"/HTML/$corpusname/default/");
-	outdir.mkdirs();
+
+	println "-- EDITION"
+	if (MONITOR != null) MONITOR.worked(25, "EDITION")
+	File outdir = new File(binDir,"/HTML/$corpusname/default/");
+	outdir.mkdirs();
 	files = c.getOrderedTxmFiles();
-
+
 	println("Building editions: "+files.size()+" files" );
-	for (File txmFile : files) {
-		print "."
-		String txtname = txmFile.getName();
-		int idx = txtname.lastIndexOf(".");
-		if(idx > 0) txtname = txtname.substring(0, idx);
-		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
-		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);//["'","(","[","{","«"];
-
-		Element text = params.addText(corpusElem, txtname, txmFile);
-
-		def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, corpusname, metadataXPath);
-		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
-
-		for (i = 0 ; i < ed.getPageFiles().size();) {
-			File f = ed.getPageFiles().get(i);
-			String wordid = ed.getIdx().get(i);
-			params.addPage(edition, ""+(++i), wordid);
-		}
-	}
-}
-if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
-if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
-File paramFile = new File(binDir, "import.xml");
-DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
+	for (File txmFile : files) {
+		print "."
+		String txtname = txmFile.getName();
+		int idx = txtname.lastIndexOf(".");
+		if(idx > 0) txtname = txtname.substring(0, idx);
+		List<String> NoSpaceBefore = LangFormater.getNoSpaceBefore(lang);
+		List<String> NoSpaceAfter = LangFormater.getNoSpaceAfter(lang);//["'","(","[","{","«"];
+
+		Element text = params.addText(corpusElem, txtname, txmFile);
+
+		def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, corpusname, metadataXPath);
+		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
+
+		for (i = 0 ; i < ed.getPageFiles().size();) {
+			File f = ed.getPageFiles().get(i);
+			String wordid = ed.getIdx().get(i);
+			params.addPage(edition, ""+(++i), wordid);
+		}
+	}
+}
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
+File paramFile = new File(binDir, "import.xml");
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bfm/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bfm/importer.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bfm/importer.groovy	(revision 927)
@@ -30,7 +30,7 @@
 import org.txm.importer.*;
 import org.txm.importer.filters.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.io.FileCopy;
 import org.txm.utils.treetagger.TreeTagger;
 
@@ -41,6 +41,7 @@
 import java.util.Properties;
 
 import org.txm.*;
+import org.txm.core.engines.*;
 
 import filters.CutHeader.*;
 import filters.ReunitBrokenWords.*;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/RGAQCJ/rgaqcjLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/RGAQCJ/rgaqcjLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/RGAQCJ/rgaqcjLoader.groovy	(revision 927)
@@ -39,6 +39,7 @@
 import org.txm.objects.*;
 import org.txm.utils.i18n.*;
 import org.txm.*;
+import org.txm.core.engines.*;
 
 // TODO: Auto-generated Javadoc
 /* (non-Javadoc)
@@ -60,8 +61,6 @@
 		model="rgaqcj";// not used
 		Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File(userDir,"txminstall"));
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"txminstall/treetagger"));
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"txminstall/treetagger/models"));
 		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"),"TXM"));
 	}
 }
@@ -136,4 +135,4 @@
 //	editionbp.addPage(resultfile, ed.getIdx().get(0));
 }
 
-w.save();
+w.save();
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/RGAQCJ/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/RGAQCJ/importer.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/RGAQCJ/importer.groovy	(revision 927)
@@ -30,7 +30,7 @@
 import org.txm.importer.*;
 import org.txm.importer.filters.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 import javax.xml.stream.*;
 import java.net.URL;
@@ -46,6 +46,7 @@
 
 import org.apache.commons.lang.StringUtils;
 import org.txm.*;
+import org.txm.core.engines.*;
 
 // TODO: Auto-generated Javadoc
 /**
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/RGAQCJ/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/RGAQCJ/compiler.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/RGAQCJ/compiler.groovy	(revision 927)
@@ -33,8 +33,8 @@
 import org.txm.importer.cwb.CwbMakeAll
 import org.txm.importer.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.BuildTTSrc;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.BuildTTSrc;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 
 import javax.xml.stream.*;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/tmx/tmxLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/tmx/tmxLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/tmx/tmxLoader.groovy	(revision 927)
@@ -33,9 +33,11 @@
 import org.txm.importer.tmx.compiler;
 import org.txm.importer.tmx.pager;
 import org.txm.objects.*;
-import org.txm.utils.*;
+import org.txm.utils.*
+import org.txm.utils.io.;
 import org.txm.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.core.engines.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.i18n.*;
 import org.w3c.dom.Element
 import org.txm.utils.xml.DomUtils;
@@ -52,7 +54,6 @@
 	if (!org.txm.Toolbox.isInitialized()) {
 
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
 		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
@@ -99,8 +100,12 @@
 def corpusIDS = imp.getCorpusIDS()
 println "-- ANNOTATE - Running NLP tools"
 if (MONITOR != null) MONITOR.worked(20, "ANNOTATE - Running NLP tools");
-new Annotate().run(binDir, txmDir, textLangs);
-
+if (annotate) {
+	def engine = Toolbox.getEngineManager(EngineType.ANNOTATION).getEngine("TreeTagger")
+	if (engine.processDirectory(txmDir, binDir, ["lang":model])) {
+		annotationSuccess = true;
+	}
+}
 println "langs : "+textLangs
 println "texts : "+langGroups
 
@@ -191,4 +196,4 @@
 if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
 if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
 File paramFile = new File(binDir, "import.xml");
-DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/tmx/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/tmx/importer.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/tmx/importer.groovy	(revision 927)
@@ -35,7 +35,7 @@
 import org.txm.scripts.*;
 import org.txm.importer.cwb.CwbEncode
 import org.txm.importer.cwb.CwbMakeAll
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.io.FileCopy;
 //import org.txm.utils.treetagger.TreeTagger;
 import javax.xml.stream.*;
@@ -53,6 +53,7 @@
 
 import org.txm.objects.*;
 import org.txm.*;
+import org.txm.core.engines.*;
 
 // TODO: Auto-generated Javadoc
 /**
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/tmx/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/tmx/compiler.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/tmx/compiler.groovy	(revision 927)
@@ -34,7 +34,7 @@
 import org.txm.importer.cwb.PatchCwbRegistry;
 import org.txm.importer.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.logger.Log;
 import org.txm.utils.treetagger.TreeTagger;
 
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/factiva/factivaLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/factiva/factivaLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/factiva/factivaLoader.groovy	(revision 927)
@@ -35,9 +35,11 @@
 import org.txm.importer.xml.compiler;
 import org.txm.importer.xml.pager;
 import org.txm.objects.*;
-import org.txm.utils.*;
+import org.txm.utils.*
+import org.txm.utils.io.;
 import org.txm.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.core.engines.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.i18n.*;
 import org.txm.metadatas.*;
 import javax.xml.stream.*;
@@ -57,8 +59,6 @@
 	if (!org.txm.Toolbox.isInitialized()) {
 
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
 		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
@@ -226,8 +226,11 @@
 if (MONITOR != null) MONITOR.worked(10, "ANNOTATE")
 println "-- ANNOTATE - Running NLP tools"
 boolean annotationSuccess = false;
-if (annotate && new Annotate().run(binDir, txmDir, model+".par")) {
-	annotationSuccess = true;
+if (annotate) {
+	def engine = Toolbox.getEngineManager(EngineType.ANNOTATION).getEngine("TreeTagger")
+	if (engine.processDirectory(txmDir, binDir, ["lang":model])) {
+		annotationSuccess = true;
+	}
 }
 
 if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/factiva/factivamailLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/factiva/factivamailLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/factiva/factivamailLoader.groovy	(revision 927)
@@ -33,7 +33,8 @@
 import org.txm.objects.*;
 import org.txm.utils.*;
 import org.txm.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.core.engines.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.i18n.*;
 import org.w3c.dom.Element
 import org.txm.utils.xml.DomUtils;
@@ -51,8 +52,6 @@
 	if (!org.txm.Toolbox.isInitialized()) {
 
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
 		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
@@ -107,8 +106,11 @@
 if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
 println "-- ANNOTATE - Running NLP tools"
 boolean annotationSuccess = false;
-if (annotate && new Annotate().run(binDir, txmDir, model+".par")) {
-	annotationSuccess = true;
+if (annotate) {
+	def engine = Toolbox.getEngineManager(EngineType.ANNOTATION).getEngine("TreeTagger")
+	if (engine.processDirectory(txmDir, binDir, ["lang":model])) {
+		annotationSuccess = true;
+	}
 }
 
 if (MONITOR != null) MONITOR.worked(25, "COMPILING")
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bvh/bvhLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bvh/bvhLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bvh/bvhLoader.groovy	(revision 927)
@@ -39,7 +39,8 @@
 import org.txm.importer.bvh.pager;
 import org.txm.objects.*;
 import org.txm.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.core.engines.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.i18n.*;
 
 // TODO: Auto-generated Javadoc
@@ -68,8 +69,6 @@
 		basename="bvh"
 		Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File(userDir,"TXM"));
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
 		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
@@ -104,7 +103,7 @@
 //move registry file to cwb registry dir
 File registryfile = new File(rootDir+"/registry",basename);
 if(registryfile.exists())
-	org.txm.utils.FileCopy.copy(registryfile,new File(Toolbox.getTxmHomePath(),"registry/"+basename))
+	org.txm.utils.io.FileCopy.copy(registryfile,new File(Toolbox.getTxmHomePath(),"registry/"+basename))
 
 Workspace w = org.txm.Toolbox.workspace;
 Project p = w.getProject("default")
@@ -142,4 +141,4 @@
 //	editionbp.addPage(resultfile,ed.getIdx().get(0));
 }
 
-w.save();
+w.save();
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bvh/annotate.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bvh/annotate.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bvh/annotate.groovy	(revision 927)
@@ -31,8 +31,8 @@
 import org.txm.scripts.*;
 import org.txm.importer.cwb.CwbEncode
 import org.txm.importer.cwb.CwbMakeAll
-import org.txm.scripts.teitxm.BuildTTSrc;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.BuildTTSrc;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 import org.txm.Toolbox;
 
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bvh/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bvh/compiler.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bvh/compiler.groovy	(revision 927)
@@ -32,8 +32,8 @@
 import org.txm.importer.cwb.CwbMakeAll
 import org.txm.importer.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.BuildTTSrc;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.BuildTTSrc;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 
 import javax.xml.stream.*;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bvh/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bvh/importer.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/bvh/importer.groovy	(revision 927)
@@ -32,13 +32,14 @@
 import org.txm.scripts.*;
 import org.txm.importer.cwb.CwbEncode
 import org.txm.importer.cwb.CwbMakeAll
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 import javax.xml.stream.*;
 import java.io.File;
 import java.net.URL;
 
 import org.txm.*;
+import org.txm.core.engines.*;
 
 import filters.CutHeader.*;
 import filters.Tokeniser.*;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/frantext/frantextLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/frantext/frantextLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/frantext/frantextLoader.groovy	(revision 927)
@@ -29,19 +29,21 @@
 //
 package org.txm.importer.frantext;
 
-import javax.xml.stream.XMLStreamReader;
-import org.txm.importer.ApplyXsl2;
+import javax.xml.stream.XMLStreamReader;
+import org.txm.importer.ApplyXsl2;
 import org.txm.importer.bfm.importer;
 import org.txm.importer.bfm.compiler;
 import org.txm.importer.bfm.pager;
 import org.txm.objects.*;
 import org.txm.*;
+import org.txm.core.engines.*;
 import org.txm.utils.i18n.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.importer.*;
 import org.w3c.dom.Element
 import org.txm.utils.xml.DomUtils;
-import org.txm.utils.*;
+import org.txm.utils.*
+import org.txm.utils.io.;
 
 String userDir = System.getProperty("user.home");
 boolean debug = org.txm.utils.logger.Log.isPrintingErrors();
@@ -56,8 +58,6 @@
 		//rootDir = userDir+"/xml/TESTS/alceste";  // directory which contains the source file
 
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
 		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
@@ -93,18 +93,18 @@
 txmDir.mkdirs();
 
 // BFM XPATH PARAMETERS
-if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
+if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
 if (MONITOR != null) MONITOR.worked(1, "READ XPATH PARAMETERS")
-File paramDeclarationFile = new File(srcDir, "import.properties");
-Properties metadataXPath = new Properties();
+File paramDeclarationFile = new File(srcDir, "import.properties");
+Properties metadataXPath = new Properties();
 if (paramDeclarationFile.exists() && paramDeclarationFile.canRead()) {
 	InputStreamReader input = new InputStreamReader(new FileInputStream(paramDeclarationFile) , "UTF-8");
-	metadataXPath.load(input);
+	metadataXPath.load(input);
 	input.close();
 
-	if (!metadataXPath.containsKey("titre"))
+	if (!metadataXPath.containsKey("titre"))
 		println "Warning: parameters property file does not contain the 'titre' metadata"
-	if (!metadataXPath.containsKey("forme"))
+	if (!metadataXPath.containsKey("forme"))
 		println "Warning: parameters property file does not contain the 'forme' metadata in param values. The default value is 'prose'"
 }
 else
@@ -125,8 +125,8 @@
 println "-- VALIDATION - checking XML source files well-formedness"
 if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
 List<File> srcfiles = srcDir.listFiles();
-for (File f : srcfiles) { // check XML format, and copy file into binDir
-	if (f.isHidden() || f.getName().equals("import.xml") || f.getName().equals("metadata.csv") || f.getName().endsWith(".properties"))
+for (File f : srcfiles) { // check XML format, and copy file into binDir
+	if (f.isHidden() || f.getName().equals("import.xml") || f.getName().equals("metadata.csv") || f.getName().endsWith(".properties"))
 		continue;
 	if (ValidateXml.test(f)) {
 		FileCopy.copy(f, new File(txmDir, f.getName()));
@@ -145,7 +145,7 @@
 if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
 println "-- IMPORTER - Reading source files"
 def imp = new importer()
-if (!imp.run(srcDir, binDir, txmDir, basename, metadataXPath)) {
+if (!imp.run(srcDir, binDir, txmDir, basename, metadataXPath)) {
 	println "import process stopped";
 	return;
 }
@@ -154,9 +154,11 @@
 if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
 println "-- ANNOTATE - Running NLP tools - $model model"
 boolean annotate_status = true;
-if (annotate && !(new Annotate().run(binDir, txmDir, model+".par"))) {
-	println "Skipping Annotate process";
-	annotate_status = false;
+if (annotate) {
+	def engine = Toolbox.getEngineManager(EngineType.ANNOTATION).getEngine("TreeTagger")
+	if (engine.processDirectory(txmDir, binDir, ["lang":model])) {
+		annotate_status = true;
+	}
 }
 
 if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
@@ -167,7 +169,7 @@
 //c.setCwbPath("~/TXM/cwb/bin");
 c.setLang(lang);
 c.setAnnotationDone(annotate_status)
-if (!c.run(binDir, txmDir, corpusname, metadataXPath)) {
+if (!c.run(binDir, txmDir, corpusname, metadataXPath)) {
 	println "import process stopped";
 	return;
 }
@@ -196,7 +198,7 @@
 
 		Element text = params.addText(corpusElem, txtname, txmFile);
 
-		def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, corpusname, metadataXPath);
+		def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, corpusname, metadataXPath);
 		Element edition = params.addEdition(text, "default", outdir.getAbsolutePath(), "html");
 
 		for (i = 0 ; i < ed.getPageFiles().size();) {
@@ -209,4 +211,4 @@
 if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
 if (MONITOR != null) MONITOR.worked(20, "FINALIZING")
 File paramFile = new File(binDir, "import.xml");
-DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
+DomUtils.save(params.root.getOwnerDocument(), paramFile);readyToLoad = true;
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/perrault/annotate.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/perrault/annotate.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/perrault/annotate.groovy	(revision 927)
@@ -31,8 +31,8 @@
 import org.txm.scripts.*;
 import org.txm.importer.cwb.CwbEncode
 import org.txm.importer.cwb.CwbMakeAll
-import org.txm.scripts.teitxm.BuildTTSrc;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.BuildTTSrc;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 import org.txm.Toolbox;
 
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/perrault/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/perrault/compiler.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/perrault/compiler.groovy	(revision 927)
@@ -31,8 +31,8 @@
 import org.txm.importer.cwb.CwbMakeAll
 import org.txm.importer.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.BuildTTSrc;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.BuildTTSrc;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 
 import javax.xml.stream.*;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/perrault/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/perrault/importer.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/perrault/importer.groovy	(revision 927)
@@ -33,7 +33,7 @@
 import org.txm.scripts.*;
 import org.txm.importer.cwb.CwbEncode
 import org.txm.importer.cwb.CwbMakeAll
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 import javax.xml.stream.*;
 import java.net.URL;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/perrault/allimport.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/perrault/allimport.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/perrault/allimport.groovy	(revision 927)
@@ -39,7 +39,7 @@
 import org.txm.importer.cwb.CwbMakeAll
 import org.txm.importer.filters.*
 import org.txm.scripts.*
-import org.txm.scripts.teitxm.*
+import org.txm.importer.xmltxm.*
 import org.txm.utils.treetagger.TreeTagger
 
 import filters.CutHeader.*
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/perrault/perraultLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/perrault/perraultLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/perrault/perraultLoader.groovy	(revision 927)
@@ -39,7 +39,8 @@
 import org.txm.importer.perrault.pager;
 import org.txm.objects.*;
 import org.txm.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.core.engines.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.i18n.*;
 
 // TODO: Auto-generated Javadoc
@@ -90,7 +91,7 @@
 //move registry file to cwb registry dir
 File registryfile = new File(rootDir+"/registry","perrault");
 if(registryfile.exists())
-	org.txm.utils.FileCopy.copy(registryfile,new File(Toolbox.getTxmHomePath(),"registry/perrault"))
+	org.txm.utils.io.FileCopy.copy(registryfile,new File(Toolbox.getTxmHomePath(),"registry/perrault"))
 	
 
 Workspace w = org.txm.Toolbox.workspace;
@@ -130,4 +131,3 @@
 //	Edition editionbp = text.addEdition("bp","integral",resultfile);
 //	editionbp.addPage(resultfile,ed.getIdx().get(0));
 }
-
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/CopyXMLFiles.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/CopyXMLFiles.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/CopyXMLFiles.groovy	(revision 927)
@@ -11,6 +11,7 @@
 import javax.xml.stream.events.DTD;
 import javax.xml.stream.events.EntityReference;
 import org.txm.utils.*
+import org.txm.utils.io.
 
 public class CopyXMLFiles {
 	File xmlFile;
@@ -58,4 +59,4 @@
 		CopyXMLFiles cdf = new CopyXMLFiles(xmlFile)
 		println cdf.copy(outDir)
 	}
-}
+}
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/doc/FixBreaksAndAutomaticStyles.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/doc/FixBreaksAndAutomaticStyles.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/doc/FixBreaksAndAutomaticStyles.groovy	(revision 927)
@@ -6,6 +6,7 @@
 
 import groovy.xml.QName
 import groovy.xml.StreamingMarkupBuilder
+import groovy.util.XmlParser
 
 class FixBreaksAndAutomaticStyles {
 
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/doc/docLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/doc/docLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/doc/docLoader.groovy	(revision 927)
@@ -36,8 +36,11 @@
 import org.txm.objects.*;
 import org.txm.tokenizer.TokenizerClasses;
 import org.txm.utils.*;
+import org.txm.utils.io.*;
 import org.txm.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.core.preferences.TBXPreferences
+import org.txm.core.engines.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.i18n.*;
 import org.txm.metadatas.*;
 import javax.xml.stream.*;
@@ -60,9 +63,6 @@
 		TokenizerClasses.loadFromNode(params.getTokenizerElement(params.getCorpusElement()));
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
 		//Toolbox.setParam(Toolbox.INSTALL_DIR,new File("C:\\Program Files\\TXM"));//For Windows
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
-		//Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File("C:\\Program Files\\treetagger"));//for Windows
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
 		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
@@ -128,7 +128,7 @@
 if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
 if (MONITOR != null) MONITOR.worked(20, "CREATING TEI FILES")
 println "-- CONVERTER - Converting source files"
-File xsldir = new File(Toolbox.getTxmHomePath(), "xsl")
+File xsldir = new File(Toolbox.getPreference(TBXPreferences.INSTALL_DIR), "redist/xsl")
 if (!DocumentToTei.processFiles(srcfiles, txmDir, xsldir)) {
 	println "Abord import"
 	return;
@@ -268,8 +268,11 @@
 if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
 println "-- ANNOTATE - Running NLP tools"
 boolean annotationSuccess = false;
-if (annotate && new Annotate().run(binDir, txmDir, model+".par")) {
-	annotationSuccess = true;
+if (annotate) {
+	def engine = Toolbox.getEngineManager(EngineType.ANNOTATION).getEngine("TreeTagger")
+	if (engine.processDirectory(txmDir, binDir, ["lang":model])) {
+		annotationSuccess = true;
+	}
 }
 
 if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/limsi/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/limsi/compiler.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/limsi/compiler.groovy	(revision 927)
@@ -33,7 +33,7 @@
 import org.txm.importer.cwb.*
 import org.txm.importer.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.stat.utils.ConsoleProgressBar
 import org.txm.utils.io.FileCopy;
 import org.txm.utils.treetagger.TreeTagger;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/limsi/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/limsi/importer.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/limsi/importer.groovy	(revision 927)
@@ -36,7 +36,7 @@
 import javax.xml.transform.stream.StreamResult;
 
 import org.txm.utils.logger.Log;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.stat.utils.ConsoleProgressBar
 
 import java.io.BufferedWriter;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/limsi/limsiLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/limsi/limsiLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/limsi/limsiLoader.groovy	(revision 927)
@@ -50,9 +50,10 @@
 
 import java.io.File;
 
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.stat.utils.ConsoleProgressBar
-import org.txm.*;
+import org.txm.*;
+import org.txm.core.engines.*;
 import org.txm.objects.*;
 import org.txm.utils.i18n.*;
 import org.txm.utils.*;
@@ -84,8 +85,6 @@
 		params.load()
 	if (!org.txm.Toolbox.isInitialized()) {
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
 		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/hyperbase/hyperbaseLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/hyperbase/hyperbaseLoader.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/hyperbase/hyperbaseLoader.groovy	(revision 927)
@@ -34,7 +34,8 @@
 import org.txm.objects.*;
 import org.txm.utils.*;
 import org.txm.*;
-import org.txm.scripts.teitxm.*;
+import org.txm.core.engines.*;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.i18n.*;
 import org.w3c.dom.Element
 import org.txm.utils.xml.DomUtils;
@@ -52,8 +53,6 @@
 	if (!org.txm.Toolbox.isInitialized()) {
 
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File("/usr/lib/TXM"));
-		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"treetagger"));
-		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"treetagger/models"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
 		Toolbox.setParam(Toolbox.METADATA_TXTSEPARATOR, "\"");
@@ -101,8 +100,11 @@
 if (MONITOR != null) MONITOR.worked(20, "ANNOTATE")
 println "-- ANNOTATE - Running NLP tools"
 boolean annotationSuccess = false;
-if ((new Annotate().run(binDir, txmDir, model+".par"))) {
-	annotationSuccess = true
+if (annotate) {
+	def engine = Toolbox.getEngineManager(EngineType.ANNOTATION).getEngine("TreeTagger")
+	if (engine.processDirectory(txmDir, binDir, ["lang":model])) {
+		annotationSuccess = true;
+	}
 }
 
 if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/hyperbase/compiler.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/hyperbase/compiler.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/hyperbase/compiler.groovy	(revision 927)
@@ -31,8 +31,8 @@
 import org.txm.importer.cwb.CwbMakeAll
 import org.txm.importer.*;
 import org.txm.scripts.*;
-import org.txm.scripts.teitxm.BuildTTSrc;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.BuildTTSrc;
+import org.txm.importer.xmltxm.*;
 import org.txm.utils.treetagger.TreeTagger;
 
 import javax.xml.stream.*;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/hyperbase/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/hyperbase/importer.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/hyperbase/importer.groovy	(revision 927)
@@ -33,8 +33,8 @@
 import org.txm.scripts.*;
 import org.txm.importer.cwb.CwbEncode
 import org.txm.importer.cwb.CwbMakeAll
-import org.txm.scripts.teitxm.BuildTTSrc;
-import org.txm.scripts.teitxm.*;
+import org.txm.importer.xmltxm.BuildTTSrc;
+import org.txm.importer.xmltxm.*;
 //import org.txm.utils.treetagger.TreeTagger;
 import javax.xml.stream.*;
 import java.io.BufferedWriter;
@@ -50,6 +50,7 @@
 import filters.TagSentences.*;
 
 import org.txm.*;
+import org.txm.core.engines.*;
 import org.txm.utils.*;
 // TODO: Auto-generated Javadoc
 
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/TextTranscription2TRS.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/TextTranscription2TRS.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/TextTranscription2TRS.groovy	(revision 927)
@@ -51,7 +51,7 @@
 
 import org.xml.sax.InputSource;
 import org.xml.sax.helpers.DefaultHandler;
-
+import org.txm.utils.io.*
 import java.text.DecimalFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -157,7 +157,7 @@
 			}
 			if (!ret) return ret;
 		} else { // the document is already a TXT file
-			org.txm.utils.FileCopy.copy(docFile, txtFile)
+			org.txm.utils.io.FileCopy.copy(docFile, txtFile)
 			ret = true
 		}
 
@@ -282,4 +282,3 @@
 		return finalTrsFile.exists() && finalTrsFile.length() > 0
 	}
 }
-
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/InjectWordPropTableMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/InjectWordPropTableMacro.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/InjectWordPropTableMacro.groovy	(revision 927)
@@ -1,6 +1,7 @@
 package org.txm.macro.annotation;
 
 import org.txm.utils.*
+import org.txm.utils.io.
 
 import java.nio.charset.Charset
 
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/oriflamms/prepare/TEI2ProjectMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/oriflamms/prepare/TEI2ProjectMacro.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/oriflamms/prepare/TEI2ProjectMacro.groovy	(revision 927)
@@ -6,6 +6,7 @@
 import org.txm.rcp.swt.widget.parameters.*
 import org.txm.*
 import org.txm.utils.*
+import org.txm.utils.io.
 import org.txm.importer.*
 import org.txm.utils.logger.*
 import org.txm.utils.zip.Zip;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/oriflamms/prepare/CopyXMLFiles.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/oriflamms/prepare/CopyXMLFiles.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/oriflamms/prepare/CopyXMLFiles.groovy	(revision 927)
@@ -11,6 +11,7 @@
 import javax.xml.stream.events.DTD;
 import javax.xml.stream.events.EntityReference;
 import org.txm.utils.*
+import org.txm.utils.io.
 
 public class CopyXMLFiles {
 	File xmlFile;
@@ -58,4 +59,4 @@
 		CopyXMLFiles cdf = new CopyXMLFiles(xmlFile)
 		println cdf.copy(outDir)
 	}
-}
+}
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/oriflamms/prepare/Project2XTZMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/oriflamms/prepare/Project2XTZMacro.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/oriflamms/prepare/Project2XTZMacro.groovy	(revision 927)
@@ -8,6 +8,7 @@
 import org.txm.rcp.swt.widget.parameters.*
 import org.txm.*
 import org.txm.utils.*
+import org.txm.utils.io.
 import org.txm.importer.*
 import org.txm.utils.logger.*
 import org.txm.utils.xml.UpdateXSLParameters
@@ -272,4 +273,4 @@
 cParams.getCorpusElement().setAttribute("font", "Junicode");
 cParams.getEditionsElement(cParams.getCorpusElement()).setAttribute("default", "default,facsimile")
 cParams.getCorpusElement().setAttribute("name", AsciiUtils.buildId(cDirectory.getName()).toUpperCase());
-cParams.save();
+cParams.save();
\ No newline at end of file
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/misc/EuroPress2XMLMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/misc/EuroPress2XMLMacro.groovy	(revision 926)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/misc/EuroPress2XMLMacro.groovy	(revision 927)
@@ -2,6 +2,8 @@
 // STANDARD DECLARATIONS
 
 import groovy.xml.QName
+
+import java.nio.charset.Charset
 import java.text.DecimalFormat
 import org.txm.utils.xml.DomUtils;
 import org.txm.importer.ValidateXml;
@@ -97,14 +99,18 @@
 
 	File xhtmlFile = new File(outDir, name+".xhtml")
 
-	Tidy tidy = new Tidy(); // obtain a new Tidy instance
-	tidy.setXHTML(true); // set desired config options using tidy setters
-	tidy.setInputEncoding("UTF-8")
-	tidy.setOutputEncoding("UTF-8")
-	tidy.setShowErrors(0)
-	tidy.setShowWarnings(false)
+//	Tidy tidy = new Tidy(); // obtain a new Tidy instance
+//	tidy.setXHTML(true); // set desired config options using tidy setters
+//	tidy.setInputEncoding("UTF-8")
+//	tidy.setOutputEncoding("UTF-8")
+//	tidy.setShowErrors(0)
+//	tidy.setShowWarnings(false)
 	xhtmlFile.withWriter("UTF-8") { out ->
-		tidy.parse(tmpHTML.toURI().toURL().newInputStream(), out); // run tidy, providing an input and output stream
+		def doc = org.jsoup.Jsoup.connect(tmpHTML.toURI().toURL().toString());
+		println "current charset: "+doc.charset()
+		doc.charset(Charset.forName("UTF-8"))
+		println "current charset: "+doc.charset()
+		out.println(doc.outerHtml​())
 	}
 
 	if (ValidateXml.test(xhtmlFile)) {
Index: tmp/org.txm.groovy.core/build.properties
===================================================================
--- tmp/org.txm.groovy.core/build.properties	(revision 926)
+++ tmp/org.txm.groovy.core/build.properties	(revision 927)
@@ -4,5 +4,7 @@
                .,\
                bin/,\
                plugin.xml,\
-               src/groovy/
+               src/groovy/org/,\
+               src/groovy/tests/,\
+               src/groovy/filters/
 jars.compile.order = .
Index: tmp/org.txm.analec.feature/feature.xml
===================================================================
--- tmp/org.txm.analec.feature/feature.xml	(revision 926)
+++ tmp/org.txm.analec.feature/feature.xml	(revision 927)
@@ -67,21 +67,25 @@
    </license>
 
    <requires>
+      <import plugin="org.eclipse.ui"/>
+      <import plugin="org.eclipse.core.runtime"/>
+      <import plugin="org.eclipse.jface"/>
+      <import plugin="org.eclipse.swt"/>
+      <import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/>
+      <import plugin="org.txm.core" version="0.8.0" match="greaterOrEqual"/>
+      <import plugin="org.txm.rcp" version="0.8.0" match="greaterOrEqual"/>
+      <import plugin="org.txm.utils"/>
       <import plugin="org.txm.concordance.rcp" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.progression.rcp" version="1.0.0" match="greaterOrEqual"/>
+      <import plugin="org.txm.chartsengine.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.chartsengine.jfreechart.rcp" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.chartsengine.r.rcp" version="1.0.0" match="greaterOrEqual"/>
+      <import plugin="org.txm.lexicaltable.rcp" version="1.0.0" match="greaterOrEqual"/>
+      <import plugin="org.txm.edition.rcp" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.annotation.rcp"/>
    </requires>
 
    <plugin
-         id="org.txm.edition.rcp"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
          id="org.txm.analec.rcp"
          download-size="0"
          install-size="0"
Index: tmp/org.txm.core/src/java/org/txm/core/engines/EngineType.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/engines/EngineType.java	(revision 926)
+++ tmp/org.txm.core/src/java/org/txm/core/engines/EngineType.java	(revision 927)
@@ -15,6 +15,7 @@
 	CHARTS("charts"),
 	SCRIPT("scripts"),
 	ANNOTATION("annotations"),
+	TAL("tal"),
 	OTHER("others engines");
 
 	/**
Index: tmp/org.txm.core/src/java/org/txm/importer/GetPagesFromURL.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/GetPagesFromURL.groovy	(revision 926)
+++ tmp/org.txm.core/src/java/org/txm/importer/GetPagesFromURL.groovy	(revision 927)
@@ -1,6 +1,6 @@
 package org.txm.importer
 
-import org.w3c.tidy.Tidy
+import org.w3c.tidy.*
 
 def workDir = new File("/home/mdecorde/TEMP")
 def outdir = new File("/home/mdecorde/TEMP/out")
@@ -49,7 +49,8 @@
 	out.close()
 	
 	println "xHTMLize HTML $htmlFile"
-	Tidy tidy = new Tidy(); // obtain a new Tidy instance
+	//TODO replace JTidy with Jsoup
+	//def tidy = new Tidy(); // obtain a new Tidy instance
 	tidy.setXHTML(true); // set desired config options using tidy setters
 	tidy.setInputEncoding("UTF-8")
 	tidy.setOutputEncoding("UTF-8")
Index: tmp/org.txm.core/src/java/org/txm/importer/CopyXMLFiles.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/CopyXMLFiles.groovy	(revision 926)
+++ tmp/org.txm.core/src/java/org/txm/importer/CopyXMLFiles.groovy	(revision 927)
@@ -11,6 +11,7 @@
 import javax.xml.stream.events.DTD;
 import javax.xml.stream.events.EntityReference;
 import org.txm.utils.*
+import org.txm.utils.io.*;
 
 public class CopyXMLFiles {
 	File xmlFile;
Index: tmp/org.txm.core/src/java/org/txm/importer/xmltxm/AnnotateWTC.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/xmltxm/AnnotateWTC.groovy	(revision 926)
+++ tmp/org.txm.core/src/java/org/txm/importer/xmltxm/AnnotateWTC.groovy	(revision 927)
@@ -1,178 +0,0 @@
-// Copyright © 2010-2013 ENS de Lyon.
-// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
-// Lyon 2, University of Franche-Comté, University of Nice
-// Sophia Antipolis, University of Paris 3.
-//
-// The TXM platform is free software: you can redistribute it
-// and/or modify it under the terms of the GNU General Public
-// License as published by the Free Software Foundation,
-// either version 2 of the License, or (at your option) any
-// later version.
-//
-// The TXM platform is distributed in the hope that it will be
-// useful, but WITHOUT ANY WARRANTY; without even the implied
-// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-// PURPOSE. See the GNU General Public License for more
-// details.
-//
-// You should have received a copy of the GNU General
-// Public License along with the TXM platform. If not, see
-// http://www.gnu.org/licenses.
-//
-//
-//
-// $LastChangedDate: 2013-12-06 16:57:35 +0100 (Fri, 06 Dec 2013) $
-// $LastChangedRevision: 2583 $
-// $LastChangedBy: mdecorde $
-//
-package org.txm.importer.xmltxm
-
-import java.io.File
-import java.text.DateFormat
-import java.util.Date
-
-import org.txm.Toolbox
-import org.txm.importer.*
-import org.txm.importer.cwb.*
-import org.txm.objects.*
-import org.txm.stat.utils.ConsoleProgressBar
-import org.txm.utils.DeleteDir;
-import org.txm.utils.LangDetector;
-import org.txm.utils.treetagger.TreeTagger
-
-// TODO: Auto-generated Javadoc
-/**
- * Annotate and replace the TEI-TXM files of the folder $rootDirFile/txm with TreeTagger.
- * creates $rootDirFile/interp and $rootDirFile/treetagger
- *
- */
-class AnnotateCQP {
-
-	/** The debug. */
-	boolean debug = true;
-
-	/**
-	 * Sets the debug.
-	 */
-	public void setDebug() { debug=true; }
-
-	String id;
-
-	/**
-	 * Apply tt.
-	 *
-	 * @param ttsrcfile the ttsrcfile
-	 * @param ttoutfile the ttoutfile
-	 * @param modelfile the modelfile
-	 * @return true, if successful
-	 */
-	public boolean applyTT(File ttsrcfile, File ttoutfile, File modelfile)
-	{
-		try {
-			File infile = ttsrcfile;
-			File outfile = ttoutfile;
-
-			// TODO: why org.txm.utils.treetagger.TreeTagger tt = ..., throw IllegalAccessError ???
-			String opt = Toolbox.getPreference(Toolbox.TREETAGGER_OPTIONS);
-			if (opt == null) opt = "";
-			String[] options = opt.split("  ");
-			def tt = new TreeTagger(Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/", options);
-			tt.settoken();
-			tt.setlemma();
-			tt.setquiet();
-			tt.setsgml();
-			tt.setnounknown();
-			tt.seteostag("<s>");
-			tt.treetagger(modelfile.getAbsolutePath(), infile.getAbsolutePath(), outfile.getAbsolutePath())
-			//infile.delete();
-		}
-		catch(Exception e)
-		{
-			e.printStackTrace();
-			return false;
-		}
-		return true;
-	}
-
-	/**
-	 * Run.
-	 *
-	 * @param rootDirFile the root dir file
-	 * @param modelfilename the modelfilename
-	 * @return true, if successful
-	 */
-	public boolean run(File binDir, File txmDir,  String modelfilename)
-	{
-		//test if modelfile exists
-		if(debug) {
-			println "rootDirFile "+binDir
-			println "txmDir "+txmDir
-			println "TREETAGGER INSTALL PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)
-			println "TREETAGGER MODELS PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH)
-		}
-
-		//test if the Toolbox know TreeTagger
-		if (!new File(Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/").exists())
-		{
-			println("Could not find TreeTagger binaries in "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/")
-			return false;
-		}
-
-		//cleaning
-		File annotDir = new File(binDir, "annotations")
-		annotDir.mkdir();
-
-		//BUILD TT FILE READY TO BE TAGGED
-		//println "Re "+Toolbox.getParam(Toolbox.TREETAGGER_APOSTROPHE)
-		List<File> files = txmDir.listFiles()
-
-		// get model file and check it
-		File modelfile = new File(Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH), modelfilename);
-		if (debug)
-			println "model file : "+modelfile;
-
-		if (!modelfile.exists()) {
-			println "Skipping ANNOTATE: Incorrect modelfile path: "+modelfile;
-			if(System.getProperty("os.name").startsWith("Windows"))
-				println "Windows users: Windows might be hiding files extension. To see them, in the explorer parameters."
-			return false;
-		}
-
-		//APPLY TREETAGGER
-		println("Applying $modelfilename TreeTagger model on dir: "+txmDir+ " ("+files.size()+" files)")
-		if (files == null || files.size() == 0)
-			return false;
-
-		ConsoleProgressBar cpb = new ConsoleProgressBar(files.size());
-		for (File f : files) {
-			cpb.tick();
-			
-			File infile = f;
-			File outfile = new File(new File(binDir, "annotations"), f.getName());
-			if (outfile.exists() && // outfile exists
-				outfile.lastModified() >= infile.lastModified() && // outfile is more recent 
-				outfile.length() > infile.length()) { // outfile is bigger
-				// skip
-			} else {
-				if (!applyTT(infile, outfile, modelfile)) {
-					System.out.println("Failed to apply treetagger on file "+f);
-					return false;
-				}
-			}
-		}
-		println("")
-
-//		if (DeleteDir.deleteDirectory(txmDir)) {
-//			if (annotDir.renameTo(txmDir)) {
-//
-//			} else {
-//				println "Could not rename  'annotations' directory to 'txm' directory"
-//				return false
-//			}
-//		} else {
-//			println "Could not delete txmDir: $txmDir (and could not copy 'annotations' directory"
-//		}
-
-		return true;
-	}
-}
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/xmltxm/Annotate.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/xmltxm/Annotate.groovy	(revision 926)
+++ tmp/org.txm.core/src/java/org/txm/importer/xmltxm/Annotate.groovy	(revision 927)
@@ -1,552 +0,0 @@
-// Copyright © 2010-2013 ENS de Lyon.
-// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
-// Lyon 2, University of Franche-Comté, University of Nice
-// Sophia Antipolis, University of Paris 3.
-//
-// The TXM platform is free software: you can redistribute it
-// and/or modify it under the terms of the GNU General Public
-// License as published by the Free Software Foundation,
-// either version 2 of the License, or (at your option) any
-// later version.
-//
-// The TXM platform is distributed in the hope that it will be
-// useful, but WITHOUT ANY WARRANTY; without even the implied
-// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-// PURPOSE. See the GNU General Public License for more
-// details.
-//
-// You should have received a copy of the GNU General
-// Public License along with the TXM platform. If not, see
-// http://www.gnu.org/licenses.
-//
-//
-//
-// $LastChangedDate: 2016-10-03 15:30:36 +0200 (lun. 03 oct. 2016) $
-// $LastChangedRevision: 3313 $
-// $LastChangedBy: mdecorde $
-//
-package org.txm.importer.xmltxm
-
-import java.io.File
-import java.text.DateFormat
-import java.util.Date
-import java.util.concurrent.*
-
-import org.txm.Toolbox
-import org.txm.importer.*
-import org.txm.importer.cwb.*
-import org.txm.objects.*
-import org.txm.stat.utils.ConsoleProgressBar;
-import org.txm.utils.LangDetector;
-import org.txm.utils.logger.Log;
-import org.txm.utils.treetagger.TreeTagger
-
-// TODO: Auto-generated Javadoc
-/**
- * Annotate and replace the TEI-TXM files of the folder $rootDirFile/txm with TreeTagger.
- * creates $rootDirFile/interp and $rootDirFile/treetagger
- *
- */
-class Annotate
-{
-	boolean cancelNow = false;
-
-	/** The report file. */
-	File reportFile;//contains the txm:application tag content
-
-	/** The resp person. */
-	String respPerson;
-
-	/** The resp id. */
-	String respId;
-
-	/** The resp desc. */
-	String respDesc;
-
-	/** The resp date. */
-	String respDate;
-
-	/** The resp when. */
-	String respWhen;
-
-	/** The app ident. */
-	String appIdent;
-
-	/** The app version. */
-	String appVersion;
-
-	/** The distributor. */
-	String distributor;
-
-	/** The publi stmt. */
-	String publiStmt;
-
-	/** The source stmt. */
-	String sourceStmt;
-
-	/** The types. */
-	def types;
-
-	/** The types title. */
-	def typesTITLE;
-
-	/** The types desc. */
-	def typesDesc;
-
-	/** The types tagset. */
-	def typesTAGSET;
-
-	/** The types web. */
-	def typesWEB;
-
-	/** The idform. */
-	String idform;
-
-	/** The debug. */
-	boolean debug = false;
-
-	File modelsDirectory;
-	
-	public Annotate() {
-		modelsDirectory = new File(Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH)); // default models directory is set in the Toolbox
-	}
-		
-	/**
-	 * Sets the debug.
-	 */
-	public void setDebug() {
-		debug = true;
-	}
-
-	String id;
-	/**
-	 * Inits the tt outfile infos.
-	 *
-	 * @param rootDirFile the root dir file
-	 * @param modelfile the modelfile
-	 */
-	public void initTTOutfileInfos(File rootDirFile, File modelfile, String modelfilename)
-	{
-		initTTOutfileInfos(rootDirFile, modelfile, modelfilename, null);
-	}
-	
-	/**
-	 * Inits the tt outfile infos.
-	 *
-	 * @param rootDirFile the root dir file
-	 * @param modelfile the modelfile
-	 * @param properties : 2 element array that contains the word properties to create. It can be null (the modelfilename will be used)
-	 */
-	public void initTTOutfileInfos(File rootDirFile, File modelfile, String modelfilename, String[] properties)
-	{
-		id = modelfilename;
-		String[] split = id.split("\\.");
-		if (split.length > 0) id = split[0];
-		if (id.equals("??")) id = "xx"
-
-		reportFile = new File(rootDirFile,"NLPToolsParameters.xml");
-
-		respPerson = System.getProperty("user.name");
-		respId = "txm";
-		respDesc = "NLP annotation tool";
-		respDate = DateFormat.getDateInstance(DateFormat.SHORT, Locale.UK).format(new Date());
-		respWhen = DateFormat.getDateInstance(DateFormat.FULL, Locale.UK).format(new Date());
-
-		appIdent = "TreeTagger";
-		appVersion = "3.2";
-
-		distributor = "";
-		publiStmt = """""";
-		sourceStmt = """""";
-
-		if (properties != null && properties.length == 2) {
-			types = [properties[0],properties[1]];
-			typesTITLE = [properties[0],properties[1]];
-		} else {
-			types = [id+"pos",id+"lemma"];
-			typesTITLE = [id+"pos",id+"lemma"];
-		}
-		
-		//TODO: the tagset, website and description should be referenced in the model catalog
-		if(modelfile.getName() == "rgaqcj.par") {
-			typesDesc = ["CATTEX pos tagset built with BFM texts","fr lemma of the model "+modelfile+" - "]
-			typesTAGSET = ["http://bfm.ens-lyon.fr/IMG/pdf/Cattex2009_Manuel.pdf",""]
-			typesWEB = ["http://bfm.ens-lyon.fr/",""]
-		} else {
-			typesDesc = ["pos tagset built from model "+modelfile,id+" lemma of the model "+modelfile+" - "]
-			typesTAGSET = ["",""]
-			typesWEB = ["",""]
-		}
-		
-		idform ="w";
-	}
-
-	/**
-	 * Apply tt.
-	 *
-	 * @param ttsrcfile the ttsrcfile
-	 * @param ttoutfile the ttoutfile
-	 * @param modelfile the modelfile
-	 * @return true, if successful
-	 */
-	public boolean applyTT(File ttsrcfile, File ttoutfile, File modelfile)
-	{
-		applyTT(ttsrcfile, ttoutfile, modelfile, null)
-	}
-	
-	/**
-	 * Apply tt.
-	 *
-	 * @param ttsrcfile the ttsrcfile
-	 * @param ttoutfile the ttoutfile
-	 * @param modelfile the modelfile
-	 * @param options, if null use value set in Toolbox preferences
-	 * @return true, if successful
-	 */
-	public boolean applyTT(File ttsrcfile, File ttoutfile, File modelfile, String[] options)
-	{
-		try {
-			File infile = ttsrcfile;
-			File outfile = ttoutfile;
-
-			// TODO: why org.txm.utils.treetagger.TreeTagger tt = ..., throw IllegalAccessError ???
-			String opt = Toolbox.getParam(Toolbox.TREETAGGER_OPTIONS);
-			if (options == null) {
-				if (opt == null) opt = "";
-				options = opt.split("  ");
-			}
-			
-			def tt = new TreeTagger(Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/", options);
-			tt.settoken();
-			tt.setlemma();
-			tt.setquiet();
-			tt.setsgml();
-			tt.setnounknown();
-			tt.seteostag("<s>");
-			tt.debug(debug);
-			tt.treetagger(modelfile.getAbsolutePath(), infile.getAbsolutePath(), outfile.getAbsolutePath())
-			infile.delete();
-		} catch(Exception e) {
-			Log.printStackTrace(e);
-			System.out.println("Failed to apply TreeTagger on $f input file with the $modelfile model file.");
-			return false;
-		}
-		return true;
-	}
-
-	/**
-	 * Write standoff file.
-	 *
-	 * @param ttoutfile the ttoutfile
-	 * @param posfile the posfile
-	 * @return true, if successful
-	 */
-	public boolean writeStandoffFile(File ttoutfile, File posfile)
-	{
-		def encoding ="UTF-8";
-		def transfo = new CSV2W_ANA();
-		//println("build w-interp "+ttfile.getName()+ ">>"+posfile.getName())
-		transfo.setAnnotationTypes( types, typesDesc, typesTAGSET, typesWEB, idform);
-		transfo.setResp(respId, respDesc, respDate, respPerson, respWhen);
-		transfo.setApp(appIdent, appVersion);
-		transfo.setTarget(ttoutfile.getAbsolutePath(), reportFile);
-		transfo.setInfos(distributor,  publiStmt, sourceStmt);
-		return transfo.process( ttoutfile, posfile, encoding );
-	}
-
-	/**
-	 * Run step by step : build TT src files, run TT, build xml-standoff files, inject standoff annotations
-	 *
-	 * @param rootDirFile the root dir file
-	 * @param modelfilename the modelfilename
-	 * @return true, if successful
-	 */
-	public boolean run(File binDir, File txmDir,  String modelfilename)
-	{
-		//test if modelfile exists
-		if (debug) {
-			println "rootDirFile "+binDir
-			println "txmDir "+txmDir
-			println "TREETAGGER INSTALL PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)
-			println "TREETAGGER MODELS PATH : "+Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH)
-		}
-
-		//test if the Toolbox know TreeTagger
-		if (!new File(Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/").exists()) {
-			println("Could not find TreeTagger binaries in "+Toolbox.getPreference(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/")
-			return false;
-		}
-		String langAll = null
-		String lang;
-		if (modelfilename.startsWith("??")) {
-			langAll = new LangDetector(binDir).getLang();
-			println "General lang $langAll"
-		}
-
-		//cleaning
-		new File(binDir, "annotations").deleteDir();
-		new File(binDir, "annotations").mkdir();
-		new File(binDir, "treetagger").deleteDir();
-		new File(binDir, "treetagger").mkdir();
-
-		ArrayList<String> milestones = [];
-
-		//BUILD TT FILE READY TO BE TAGGED
-		//println "Re "+Toolbox.getParam(Toolbox.TREETAGGER_APOSTROPHE)
-		List<File> files = txmDir.listFiles()
-
-		println("Building TT source files ("+files.size()+") from directory "+txmDir)
-		ConsoleProgressBar cpb = new ConsoleProgressBar(files.size())
-		for (File f : files) {
-			cpb.tick()
-			File srcfile = f;
-			File resultfile = new File(binDir, "treetagger/"+f.getName()+".tt");
-			if(debug)
-				println "build tt src : "+srcfile+" >> "+resultfile
-			def ttsrcbuilder = new BuildTTSrc(srcfile.toURI().toURL())
-			if (!ttsrcbuilder.process(resultfile, null))
-				System.out.println("Failed to build tt src file of "+srcfile);
-		}
-
-		if (cancelNow) return;
-
-		File modelDirectory = new File(Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH));
-		if (!modelDirectory.exists()) {
-			println "Skipping ANNOTATE: TreeTagger language model file directory not found: "+modelDirectory.getAbsolutePath();
-			return false;
-		} else 	if (!modelDirectory.canRead()) {
-			println "Skipping ANNOTATE: impossible to access the TreeTagger language model file directory: "+modelDirectory.getAbsolutePath();
-			return false;
-		}
-		println("")
-		//Convert encoding if needed
-
-		//APPLY TREETAGGER
-		files = new File(binDir, "treetagger").listFiles()
-		println("Applying $modelfilename TreeTagger model on dir: "+new File(binDir, "treetagger")+ " ("+files.size()+" files)")
-		if (files == null || files.size() == 0)
-			return false;
-		File modelfile;
-		cpb = new ConsoleProgressBar(files.size())
-		for (File f : files) {
-			String tmpModelFileName = modelfilename
-			if (modelfilename.startsWith("??")) {
-				lang = langAll;
-				if (f.length() > LangDetector.MINIMALSIZE) {
-					lang = new LangDetector(f).getLang();
-					//println "guessing lang $f : $lang"
-				}
-				tmpModelFileName = lang+".par"
-			}
-			modelfile = new File(modelsDirectory, tmpModelFileName);
-			if (debug)
-				println "model file : "+modelfile;
-
-			File
-
-			if (!modelfile.exists()) {
-				println "Skipping ANNOTATE: '$modelfile' TreeTagger language model file not found."
-				if(System.getProperty("os.name").startsWith("Windows") || System.getProperty("os.name").startsWith("Mac"))
-					println "Windows&Mac users: the operating system might be hiding file extensions. Use your file explorer to check the file name."
-				return false;
-			} else if (!modelfile.canRead()) {
-				println "Skipping ANNOTATE: impossible to access the '$modelfile' TreeTagger language model file."
-				return false;
-			}
-
-			//			if (modelfile.getName().equals("sp.par")) {//UTF >> Latin1
-			//				if(debug)
-			//					println "fix encoding for model "+modelfile
-			//				new EncodingConverter(f, "UTF-8", "ISO-8859-1")
-			//			}
-
-			cpb.tick()
-			File infile = f;
-			File outfile = new File(f.getParent(),f.getName()+"-out.tt");
-			if (!applyTT(infile, outfile, modelfile)) {
-				return false;
-			}
-
-			//			//Reconvert encoding if needed
-			//			if (modelfile.getName().equals("sp.par")) {
-			//				if(debug)
-			//					println "convert "+f+" latin1 >> UTF-8"
-			//				new EncodingConverter(f, "ISO-8859-1", "UTF-8")
-			//			}
-		}
-		println("")
-
-		if (cancelNow) return;
-
-		//BUILD STAND-OFF FILES
-		if (modelfile == null) {
-			println "no model applied"
-			return false;
-		}
-
-		initTTOutfileInfos(binDir, modelfile, modelfilename);
-		files = new File(binDir, "treetagger").listFiles()// now contains the result files of TT
-		println "Building stdoff files ("+files.size()+") from dir:"+new File(binDir, "treetagger")+" to "+new File(binDir, "annotations");
-		if (files == null || files.size() == 0)
-			return false;
-		cpb = new ConsoleProgressBar(files.size())
-		for (File ttrezfile : files) {
-			cpb.tick()
-			File annotfile = new File(binDir, "annotations/"+ttrezfile.getName()+"-STOFF.xml");
-			if (!writeStandoffFile(ttrezfile, annotfile))
-				println("Failed to build standoff file of "+ttrezfile);
-		}
-		println("")
-
-		if (cancelNow) return;
-
-		//INJECT ANNOTATIONS
-		List<File> interpfiles = new File(binDir, "annotations").listFiles();
-		List<File> txmfiles = txmDir.listFiles();
-		if (txmfiles == null) {
-			println "No file to annotate in "+txmDir.getAbsolutePath()
-			return false;
-		}
-		interpfiles.sort(); // same order
-		txmfiles.sort(); //same order
-		println "Injecting stdoff files ("+interpfiles.size()+") data from "+new File(binDir, "annotations")+ " to xml-txm files of "+txmDir;
-		if (interpfiles == null || interpfiles.size() == 0)
-			return false;
-		cpb = new ConsoleProgressBar(interpfiles.size())
-		for (int i = 0 ; i < interpfiles.size() ; i++) {
-			cpb.tick()
-			File srcfile = txmfiles.get(i);
-			File pos1file = interpfiles.get(i);
-			File temp = File.createTempFile("Annotate", "temp", srcfile.getParentFile());
-			def builder = new AnnotationInjection(srcfile.toURI().toURL(), pos1file.toURI().toURL());
-			if (!builder.process(temp)) {
-				return false;
-			}
-			builder = null;
-
-			//println "renaming files..."
-			if (!(srcfile.delete() && temp.renameTo(srcfile)))
-				println "Warning can't rename file "+temp+" to "+srcfile
-		}
-		println("")
-		return true;
-	}
-	
-	public void setModelsDirectory(File modelsDirectory) {
-		this.modelsDirectory = modelsDirectory;
-	}
-
-	/**
-	 * Run file by file. Allow to have one different lang per file. Default behavior add new word properties
-	 *
-	 * @param binDir
-	 * @param txmDir
-	 * @param lang associate a file name with a model filename
-	 * @return true, if successful
-	 */
-	public boolean run(File binDir, File txmDir, HashMap<String, String> langs)
-	{
-		return run(binDir, txmDir, langs, false, new String[0], new String[0]);
-	}
-	
-	/**
-	 * Run file by file. Allow to have one different lang per file
-	 *
-	 * @param binDir 
-	 * @param txmDir
-	 * @param lang associate a file name with a model filename
-	 * @param replace, replace or create a word property
-	 * @return true, if successful
-	 */
-	public boolean run(File binDir, File txmDir, HashMap<String, String> langs, boolean replace, String[] properties, String[] options)
-	{
-		if (!new File(Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/").exists()) {
-			println("Path to TreeTagger is wrong "+Toolbox.getParam(Toolbox.TREETAGGER_INSTALL_PATH)+"/bin/")
-			return true;
-		}
-
-		List<File> listfiles = txmDir.listFiles();
-
-		//cleaning
-		File annotDir = new File(binDir,"annotations");
-		annotDir.deleteDir();
-		annotDir.mkdir();
-		File ptreetaggerDir = new File(binDir,"ptreetagger");
-		ptreetaggerDir.deleteDir();
-		ptreetaggerDir.mkdir();
-		File treetaggerDir = new File(binDir,"treetagger");
-		treetaggerDir.deleteDir();
-		treetaggerDir.mkdir();
-
-		int cores = Runtime.getRuntime().availableProcessors()
-		int coresToUse = Math.max(1.0, cores * 0.7)
-		ExecutorService pool = Executors.newFixedThreadPool(coresToUse)
-
-		def files = txmDir.listFiles()
-		ConsoleProgressBar cpb = new ConsoleProgressBar(files.size())
-		for (File teiFile : files) {
-			int counter = 1;
-			ThreadFile t = new ThreadFile("TT_"+counter++, teiFile) {
-
-						public void run() {
-
-							if (cancelNow) return;
-
-							if (langs.get(f.getName()) == null) {
-								println "Error: no lang defined for file $f"
-								return;
-							}
-
-							String model = langs.get(f.getName());
-							File modelfile = new File(modelsDirectory, model+".par");
-							if (!modelfile.exists()) {
-								println "Error: No Modelfile available for lang "+modelfile+". Continue import process ";
-								return;
-							}
-							File annotfile = new File(annotDir, f.getName()+"-STDOFF.xml");
-							File ttsrcfile = new File(ptreetaggerDir, f.getName()+"-src.tt");
-							File ttrezfile = new File(treetaggerDir, f.getName()+"-out.tt");
-							//println ("TT with $model "+f+"+"+annotfile+" > "+ttsrcfile+" > "+ttrezfile);
-
-							//BUILD TT FILE READY TO BE TAGGED
-							def builder = new BuildTTSrc(f.toURL());
-							builder.process(ttsrcfile, null);
-
-							//Apply TT
-							applyTT(ttsrcfile, ttrezfile, modelfile, options);
-
-							//CREATE STANDOFF FILES
-							initTTOutfileInfos(binDir, modelfile, model, properties);
-							writeStandoffFile(ttrezfile, annotfile)
-
-							//INJECT ANNOTATIONS
-							File tmpFile = new File(txmDir, "temp_"+f.getName())
-							builder = new AnnotationInjection(f.toURL(), annotfile.toURL(), replace);
-							builder.process(tmpFile);
-							if (!(f.delete() && tmpFile.renameTo(f))) println "Warning can't rename file "+tmpFile+" to "+f
-
-							cpb.tick();
-						}
-					};
-
-			pool.execute(t)
-		}
-
-		pool.shutdown()
-		pool.awaitTermination(10, TimeUnit.HOURS)
-		println ""
-		return true;
-	}
-
-	public void setCancelNow() {
-		cancelNow = true;
-	}
-
-	public class ThreadFile extends Thread {
-		File f;
-		public ThreadFile(String name, File f) {
-			this.setName(name)
-			this.f = f;
-		}
-	}
-}
\ No newline at end of file
Index: tmp/org.txm.core/src/java/org/txm/importer/xmltxm/BuildTTSrc.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/xmltxm/BuildTTSrc.groovy	(revision 926)
+++ tmp/org.txm.core/src/java/org/txm/importer/xmltxm/BuildTTSrc.groovy	(revision 927)
@@ -1,217 +0,0 @@
-// Copyright © 2010-2013 ENS de Lyon.
-// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
-// Lyon 2, University of Franche-Comté, University of Nice
-// Sophia Antipolis, University of Paris 3.
-// 
-// The TXM platform is free software: you can redistribute it
-// and/or modify it under the terms of the GNU General Public
-// License as published by the Free Software Foundation,
-// either version 2 of the License, or (at your option) any
-// later version.
-// 
-// The TXM platform is distributed in the hope that it will be
-// useful, but WITHOUT ANY WARRANTY; without even the implied
-// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-// PURPOSE. See the GNU General Public License for more
-// details.
-// 
-// You should have received a copy of the GNU General
-// Public License along with the TXM platform. If not, see
-// http://www.gnu.org/licenses.
-// 
-// 
-// 
-// $LastChangedDate: 2017-01-24 18:11:42 +0100 (mar. 24 janv. 2017) $
-// $LastChangedRevision: 3400 $
-// $LastChangedBy: mdecorde $ 
-//
-package org.txm.importer.xmltxm
-
-import java.text.DateFormat;
-import java.util.Date;
-import java.util.ArrayList;
-import javax.xml.stream.*;
-import java.net.URL;
-
-import org.txm.Toolbox;
-import org.txm.importer.filters.*;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class BuildTTSrc.
- *
- * @author mdecorde
- * build the TT source for tigerSearch
- */
-
-public class BuildTTSrc {
-	
-	/** The url. */
-	private def url;
-	
-	/** The input data. */
-	private def inputData;
-	
-	/** The factory. */
-	private def factory;
-	
-	/** The parser. */
-	private XMLStreamReader parser;
-	
-	/** The output. */
-	private BufferedWriter output;
-	
-	/**
-	 * Instantiates a new builds the tt src.
-	 * uses XML-TXM V2
-	 *
-	 * @param url the url of the file to process
-	 */
-	public BuildTTSrc(URL url) {
-		try {
-			this.url = url;
-			inputData = url.openStream();
-			factory = XMLInputFactory.newInstance();
-			parser = factory.createXMLStreamReader(inputData);
-			
-		} catch (XMLStreamException ex) {
-			System.out.println(ex);
-		} catch (IOException ex) {
-			System.out.println("IOException while parsing ");
-		}
-	}
-	
-	/**
-	 * Creates the output.
-	 *
-	 * @param outfile the outfile
-	 * @return true, if successful
-	 */
-	private boolean createOutput(File outfile) {
-		try {
-			File f = outfile;
-			output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile),
-					"UTF-8"));
-			return true;
-		} catch (Exception e) {
-			System.out.println(e.getLocalizedMessage());
-			return false;
-		}
-	}
-	
-	/**
-	 * Process.
-	 *
-	 * @param outfile the outfile
-     * @param formtype, if multiple form, use this param to choose the correct one, if null takes the first form found
-	 * @return true, if successful
-	 */
-	public boolean process(File outfile, String formtype) {
-		if (!createOutput(outfile))
-			return false;
-		
-		boolean flagform = false; // to catch the content of the form tag
-		boolean firstform = false; // to know if its the first form of the w element
-		String form = ""; // the content of the form tag
-		String lastopenlocalname = "";
-		String localname = "";
-		StringBuffer buffer = new StringBuffer();
-		try {
-			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
-				switch (event) {
-					case XMLStreamConstants.START_ELEMENT:
-						localname = parser.getLocalName();
-						switch (localname) {
-							case "w":
-								//firstform = true;
-								break;
-							case "form":
-//								if (firstform) {
-//									if (formtype != null) {
-//										if(parser.getAttributeCount() > 0 
-//											&& parser.getAttributeValue(0).equals(formtype)) // only one attribute in form, type
-//											flagform = true;
-//									}
-//									else
-									flagform = true;
-									form = "";
-									firstform = false;
-								//}
-								break;
-							case "s": // TreeTagger can use s tags
-								buffer.append("<s>\n");
-								break;
-						}
-						break;
-					case XMLStreamConstants.END_ELEMENT:
-						localname = parser.getLocalName();
-						switch (localname) {
-							case "form":
-								flagform = false;
-								form = form.trim()
-								if (form.length() == 0) buffer.append("__EMPTY__\n");
-								else buffer.append(form.replace("\n", "").replace("<", "&lt;")+ "\n");
-								//buffer.append(form+ "\n"); // its a txt file no need to use entities
-								break;
-							
-							case "s":
-								buffer.append("</s>\n");
-								break;
-						}
-						break;
-					
-					case XMLStreamConstants.CHARACTERS:
-						if (flagform) {
-							if (parser.getText().length() > 0)
-								form += parser.getText();
-						}
-						break;
-				}
-			}
-
-			String str = buffer.toString()
-			if ("false".equals(Toolbox.getPreference(Toolbox.TREETAGGER_APOSTROPHE))) {
-				str = str.replace("’", "'").replace("‘", "'");
-			}
-			output.write(str)
-			output.close();
-			parser.close();
-			inputData.close();
-		} catch (Exception ex) {
-			System.out.println(ex);
-			return false;
-		} 
-		
-		return true;
-	}
-	
-	/**
-	 * The main method.
-	 *
-	 * @param args the arguments
-	 */
-	public static void main(String[] args) {
-		
-		String rootDir = "~/xml/rgaqcj/";
-		// new File(rootDir+"/identity/").mkdir();
-		
-		ArrayList<String> milestones = new ArrayList<String>();// the tags who
-		// you want them
-		// to stay
-		// milestones
-		milestones.add("tagUsage");
-		milestones.add("pb");
-		milestones.add("lb");
-		milestones.add("catRef");
-		
-		File srcfile = new File(rootDir + "anainline/", "roland-p5.xml");
-		File resultfile = new File(rootDir + "ttsrc/", "roland-p5.tt");
-		println("build ttsrc file : " + srcfile + " to : " + resultfile);
-		
-		def builder = new BuildTTSrc(srcfile.toURL(), milestones);
-		builder.process(resultfile);
-		
-		return;
-	}
-	
-}
Index: tmp/org.txm.core/src/java/org/txm/importer/xmltxm/CSV2W_ANA.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/xmltxm/CSV2W_ANA.groovy	(revision 926)
+++ tmp/org.txm.core/src/java/org/txm/importer/xmltxm/CSV2W_ANA.groovy	(revision 927)
@@ -1,491 +0,0 @@
-// Copyright © 2010-2013 ENS de Lyon.
-// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
-// Lyon 2, University of Franche-Comté, University of Nice
-// Sophia Antipolis, University of Paris 3.
-// 
-// The TXM platform is free software: you can redistribute it
-// and/or modify it under the terms of the GNU General Public
-// License as published by the Free Software Foundation,
-// either version 2 of the License, or (at your option) any
-// later version.
-// 
-// The TXM platform is distributed in the hope that it will be
-// useful, but WITHOUT ANY WARRANTY; without even the implied
-// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-// PURPOSE. See the GNU General Public License for more
-// details.
-// 
-// You should have received a copy of the GNU General
-// Public License along with the TXM platform. If not, see
-// http://www.gnu.org/licenses.
-//
-//
-//
-// $LastChangedDate: 2016-03-29 09:51:35 +0200 (mar. 29 mars 2016) $
-// $LastChangedRevision: 3185 $
-// $LastChangedBy: mdecorde $
-//
-package org.txm.importer.xmltxm
-
-import java.io.File;
-import java.io.Writer;
-
-import org.txm.importer.PersonalNamespaceContext;
-import org.txm.utils.treetagger.TreeTagger;
-import java.util.Iterator;
-
-import javax.xml.namespace.NamespaceContext;
-
-import java.io.FileInputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.nio.charset.Charset;
-import java.util.Iterator;
-
-import javax.xml.stream.*;
-// TODO: Auto-generated Javadoc
-/**  
- * @author mdecorde  
- * 
- * Take a CVS file with columns [word, pos1, pos2, ...] Build xml-pos With given infos : - setAnnotationTypes( types, idform); - setResp( person, software, cmdLine);  types : list of type [pos1, pos2, ...] idform : the ___ of the words' id person : the resp software : the software which creates annotations cmdline : the used cmd line 
- * 
- */
-class CSV2W_ANA {
-	String encoding;
-
-	/** The target. */
-	String target = "" // ana file targeted
-
-	/** The distributor. */
-	String distributor= "";
-
-	/** The publi chat. */
-	String publiChat= "";
-
-	/** The source chat. */
-	String sourceChat= "";
-
-	/** The reportfile. */
-	File reportfile;
-
-	/** The resp person. */
-	String respPerson; // used for respStmt/resp/name(person)
-
-	/** The resp id. */
-	String respId;
-
-	/** The resp chat. */
-	String respChat;
-
-	/** The resp date. */
-	String respDate;
-
-	/** The resp when. */
-	String respWhen;
-
-	/** The app ident. */
-	String appIdent;
-
-	/** The app version. */
-	String appVersion;
-
-	/** The types. */
-	def types ;// used for linkGrp type
-
-	/** The types desc. */
-	def typesDesc ;// used for types' description
-
-	/** The types uri. */
-	def typesURI; // used for types' URI
-
-	/** The types web. */
-	def typesWEB;//used for types siteweb
-
-	/** The idform. */
-	String idform ="";
-
-	/** The writer. */
-	XMLOutputFactory factory = XMLOutputFactory.newInstance();
-	BufferedOutputStream output;
-	XMLStreamWriter writer;
-
-	public static String TXMNS = "http://textometrie.org/1.0";
-	public static String TEINS = "http://www.tei-c.org/ns/1.0";
-
-	/**
-	 * Process.
-	 *
-	 * @param TTrez the tt result file
-	 * @param xmlform the xmlform the standoff file created
-	 * @param encoding the encoding of the result file
-	 * @return true, if successful
-	 */
-	public boolean process(File TTrez,File xmlform, String encoding )
-	{
-		try {
-			this.encoding = encoding;
-			output = new BufferedOutputStream(new FileOutputStream(xmlform));
-			writer = factory.createXMLStreamWriter(output, "UTF-8"); // create a new file
-			writer.setNamespaceContext(new PersonalNamespaceContext());
-			writeHead();
-			writeBody(TTrez,encoding)
-			writeTail();
-			writer.close();
-			output.close();
-		} catch(Exception e) {
-			e.printStackTrace();
-			writer.close();
-			output.close();
-			return false;
-		}
-		return true;
-	}
-
-	/**
-	 * Write head.
-	 */
-	private void writeHead()
-	{
-		Charset UTF8 = Charset.forName("UTF8");
-		writer.writeStartDocument(encoding, "1.0");
-		writer.writeStartElement("TEI");
-		writer.writeDefaultNamespace(TEINS);
-		writer.writeNamespace("txm", TXMNS);
-		writer.writeStartElement("teiHeader");
-		writer.writeStartElement("fileDesc");
-		writer.writeStartElement("titleStmt");
-		writer.writeStartElement("title");
-		writer.writeCharacters("Standoff annotation file for "+target);
-		writer.writeEndElement(); // title
-		writer.writeStartElement("respStmt");
-		writer.writeAttribute("xml:id", respId);
-		writer.writeStartElement("resp");
-		writer.writeCharacters(respChat)
-		writer.writeStartElement("date");
-		writer.writeAttribute("when", respWhen);
-		writer.writeCharacters(respDate);
-		writer.writeEndElement(); // date
-		writer.writeEndElement(); // resp
-		writer.writeStartElement("name");
-		writer.writeAttribute("type", "person");
-		writer.writeCharacters(respPerson+"\n");
-		writer.writeEndElement(); // name
-		writer.writeEndElement(); // respStmt
-		writer.writeEndElement(); // titleStmt
-		writer.writeStartElement("publicationStmt")
-		writer.writeCharacters("\n");
-		writer.writeStartElement("distributor");
-		writer.writeCharacters("\n");
-		writer.flush();
-		output.write(distributor.getBytes(UTF8))
-		output.flush()
-		writer.writeEndElement(); // distributor
-		writer.writeCharacters("\n");
-		writer.flush();
-		output.write(publiChat.getBytes(UTF8));
-		output.flush()
-		writer.writeEndElement(); // publicationStmt
-		writer.writeStartElement("sourceDesc");
-		writer.writeCharacters("\n");
-		writer.flush();
-		output.write(sourceChat.getBytes(UTF8));
-		output.flush()
-		writer.writeEndElement(); // sourceDesc
-		writer.writeEndElement(); // fileDesc
-		writer.writeStartElement("encodingDesc");
-		writer.writeStartElement("appInfo");
-		writer.writeStartElement(TXMNS,"application");
-		writer.writeAttribute("ident",appIdent);
-		writer.writeAttribute("version", appVersion);
-		writer.writeAttribute("resp", respId);
-		writer.writeCharacters("\n");
-		writer.flush();
-		def report = this.reportfile;
-		if (report != null) {
-			//System.out.println("read report : "+report);
-			Reader reader = new FileReader(report);
-			String line = reader.readLine();
-			while (line != null) {
-				if (line.length() != 0)
-					output.write((line.replace("&","&amp;")+"\n").getBytes(UTF8));
-				line = reader.readLine();
-			}
-			reader.close();
-			output.flush()
-		} else {
-			writer.writeEmptyElement(TXMNS, "commandLine");
-			writer.writeCharacters("\n");
-		}
-
-		writer.writeStartElement("ab");
-		writer.writeAttribute("type", "annotation");
-		writer.writeCharacters("\n");
-		writer.writeStartElement("list");
-		writer.writeCharacters("\n");
-		for (int i = 0; i < types.size(); i++) {
-			writer.writeStartElement("item");
-			writer.writeEmptyElement("ref");
-			writer.writeAttribute("type", "tagset");
-			writer.writeAttribute("target","#"+types[i])
-			writer.writeEndElement(); // item
-			writer.writeCharacters("\n");
-		}
-		writer.writeEndElement(); // list
-		writer.writeEndElement(); // ab
-		writer.writeEndElement(); // txm:application
-		writer.writeEndElement(); // appInfo
-		writer.writeStartElement("classDecl");
-		for (int i = 0; i < types.size(); i++) {
-			writer.writeStartElement("taxonomy");
-			writer.writeAttribute("xml:id", types[i]);
-			writer.writeStartElement("bibl");
-			writer.writeStartElement("title");
-			writer.writeCharacters(typesDesc[i]);
-			writer.writeEndElement(); // title
-			if (!typesURI[i].equals("")) {
-				writer.writeEmptyElement("ref");
-				writer.writeAttribute("type", "tagset");
-				writer.writeAttribute("target", typesURI[i]);
-				writer.writeCharacters("\n");
-			}
-			if (!typesWEB[i].equals("")) {
-				writer.writeEmptyElement("ref");
-				writer.writeAttribute("type", "siteweb");
-				writer.writeAttribute("target", typesWEB[i]);
-				writer.writeCharacters("\n");
-			}
-			writer.writeEndElement(); // bibl
-			writer.writeCharacters("\n");
-			writer.writeEndElement(); // taxonomy
-			writer.writeCharacters("\n");
-		}
-		writer.writeEndElement(); // classDecl
-		writer.writeCharacters("\n");
-		writer.writeEndElement(); // encodingDesc
-		writer.writeCharacters("\n");
-		writer.writeEndElement(); // teiHeader
-
-		writer.writeStartElement("text");
-		writer.writeAttribute("type", "standoff");
-		writer.writeStartElement("body");
-		writer.writeCharacters("\n");
-		writer.writeStartElement("div");
-		writer.writeCharacters("");
-	}
-
-	/**
-	 * Write body.
-	 *
-	 * @param TTrez the tt result file
-	 * @param encoding the encoding
-	 * @return the java.lang. object
-	 */
-	private writeBody(File TTrez, String encoding) {
-		String tmp = "";
-		String targets= idform+"";
-
-		//def content = TTrez.getText(encoding)
-		//content = content.replace("&lt;", "<")
-
-		def separator= "\t"
-		def maxsize = types.size()+1;
-		for (int i = 0 ; i< types.size() ; i++) {
-			int id = 1;
-			//output.write("<linkGrp type=\""+types[i]+"\">\n");
-			writer.writeStartElement("linkGrp");
-			writer.writeAttribute("type", types[i]);
-			TTrez.eachLine("UTF-8") { line ->
-				line = line.replaceAll("&lt;", "<")
-				def fields = line.split(separator);
-				//content.splitEachLine(separator) {fields ->
-					if (fields.size() == maxsize)
-						if (!(fields[0].startsWith("<s>") || fields[0].startsWith("</s>")))// don't use the sentence tags
-					{
-						writer.writeEmptyElement("link");
-						writer.writeAttribute("targets", "#"+targets+id+" #"+ fields[i+1]);
-						id++;
-						writer.writeCharacters("\n");
-					}
-				//}
-			}
-			writer.writeEndElement(); // linkGrp
-		}
-	}
-
-	/**
-	 * Write tail.
-	 */
-	private void writeTail() {
-		writer.writeEndElement(); // div
-		writer.writeEndElement(); // body
-		writer.writeEndElement(); // text
-		writer.writeEndElement(); // TEI
-	}
-
-	/**
-	 * Sets the annotation types.
-	 *
-	 * @param types the types
-	 * @param typesDesc the types desc
-	 * @param typesURI the types uri
-	 * @param typesWEB the types web
-	 * @param idform the idform
-	 */
-	public void setAnnotationTypes(def types,def typesDesc,def typesURI,def typesWEB, String idform) {
-		this.types = types;
-		this.typesDesc = typesDesc;
-		this.typesURI = typesURI;
-		this.typesWEB = typesWEB;
-		this.idform = idform;
-	}
-
-	/**
-	 * Sets the resp.
-	 *
-	 * @param respId the resp id
-	 * @param respChat the resp chat
-	 * @param respDate the resp date
-	 * @param respPerson the resp person
-	 * @param respWhen the resp when
-	 */
-	public void setResp(respId, respChat,respDate, respPerson,respWhen) {
-		this.respId = respId;
-		this.respChat = respChat;
-		this.respDate = respDate
-		this.respPerson = respPerson;
-		this.respWhen = respWhen;
-	}
-
-	/**
-	 * Sets the target.
-	 *
-	 * @param target the target
-	 * @param reportFile the report file
-	 */
-	public void setTarget(target, reportFile) {
-		this.target = target;
-		this.reportfile = reportFile;
-	}
-
-	/**
-	 * Sets the app.
-	 *
-	 * @param appIdent the app ident
-	 * @param appVersion the app version
-	 */
-	public void setApp(String appIdent, String appVersion) {
-		this.appIdent = appIdent;
-		this.appVersion = appVersion;
-	}
-
-	/**
-	 * Sets the infos.
-	 *
-	 * @param distributor the distributor
-	 * @param publiChat the publi chat
-	 * @param sourceChat the source chat
-	 */
-	public void setInfos(distributor,  publiChat, sourceChat) {
-		this.distributor = distributor;
-		this.publiChat = publiChat;
-		this.sourceChat = sourceChat;
-	}
-
-	/**
-	 * The main method.
-	 *
-	 * @param args the arguments
-	 */
-	public static void main(String[] args) {
-
-		String rootDir = "~/xml/rgaqcj/";
-		new File(rootDir,"proj").mkdir();
-
-		//targeted file for annotations
-		String target = "roland.xml"
-		//contains txm:application/txm:commandLine
-		File reportFile = new File("~/xml/rgaqcj/tt1_REPORT.xml");
-
-		String respPerson ="slh";
-		String respId = "TT1";
-		String respDesc = "NLP annotation tool";
-		String respDate = "Tue Mar  11 1:02:55 Paris, Madrid 2010";
-		String respWhen="2010-03-11"
-
-		String appIdent = "TreeTagger";
-		String appVersion = "3.2";
-
-		String distributor = "BFM project - http://bfm.ens-lsh.fr";
-		String publiStmt = """<availability>
-			  <p>(c) 2010 Projet BFM - CNRS/ENS-LSH.
-			  <hi>Conditions d'utilisation</hi> : 
-			  Sous licence <ref target="http://creativecommons.org/licenses/by-sa/2.0/fr/">Creative Commons</ref>.
-			  </p>
-			</availability>""";
-
-		String sourceStmt = """<p>Born digital: TXM project - http://textometrie.org</p>
-			<p>Automatically generated on <date when=" """+respWhen+"""">"""+respDate+"""</date>
-			from <ref target="#"""+respId+"""">Tree Tagger</ref> applied on the text roland-tt.
-			</p>""";
-
-		def types = ["CATTEX2009"];
-		def typesTITLE = ["CATTEX2009"];
-		def typesDesc = ["CATTEX2009 POS description"]
-		def typesTAGSET = ["http://bfm.ens-lsh.fr/IMG/xml/cattex2009.xml"]
-		def typesWEB = ["http://bfm.ens-lsh.fr/article.php3?id_article=176"]
-		String idform ="w_fro_";
-
-		File ttfile = new File(rootDir+"/proj/","rol_rga.tt");
-		File posfile = new File(rootDir+"/pos/","rolandTT1-w-ana.xml");
-		String encoding ="UTF-8";
-		println("Process file : "+ttfile+" to : "+posfile );
-
-		def transfo = new CSV2W_ANA();
-		transfo.setAnnotationTypes( types, typesDesc, typesTAGSET, typesWEB, idform);
-		transfo.setResp(respId, respDesc,respDate, respPerson, respWhen);
-		transfo.setApp(appIdent, appVersion);
-		transfo.setTarget(target, reportFile);
-		transfo.setInfos(distributor,  publiStmt, sourceStmt);
-		transfo.process( ttfile, posfile, encoding );
-
-		//create annotation file for afrpar on roalnd.xml
-		String infile = rootDir+"/ttsrc/roland-learn.tt";
-		String modelfile =  rootDir+"/models/afr.par";
-		String outfile = rootDir+"/proj/afr_rol.tt";
-
-		println("proj "+modelfile+ " on " +infile +" >> "+outfile);
-
-		TreeTagger tt = new TreeTagger("~/Bureau/treetagger/bin/");
-		tt.settoken();
-		tt.setquiet();
-		tt.setsgml();
-		tt.seteostag("<s>");
-		tt.treetagger( modelfile, infile, outfile)
-
-		reportFile = new File("~/xml/rgaqcj/tt2_REPORT.xml");
-		respPerson ="slh";
-		respId = "TT2";
-		respDesc = "NLP annotation tool";
-		respDate = "Tue Mar  15 1:02:55 Paris, Madrid 2010";
-		respWhen = "2010-03-15"
-
-		types = ["AFRPOS"];
-		typesDesc = ["AFRPOS description"]
-		typesWEB = ["http://www.uni-stuttgart.de/lingrom/stein/forschung/resource.html"]
-		typesTAGSET = [""]
-		idform ="w_fro_";
-
-		ttfile = new File(rootDir+"/proj/","afr_rol.tt");
-		posfile = new File(rootDir+"/pos/","rolandTT2-w-ana.xml");
-		encoding ="UTF-8";
-		println("Process file : "+ttfile+" to : "+posfile );
-
-		transfo = new CSV2W_ANA();
-		transfo.setAnnotationTypes( types, typesDesc, typesTAGSET, typesWEB, idform);
-		transfo.setResp(respId, respDesc,respDate, respPerson,respWhen);
-		transfo.setTarget(target, reportFile);
-		transfo.setApp(appIdent, appVersion);
-		transfo.setInfos(distributor,  publiStmt, sourceStmt);
-		transfo.process( ttfile, posfile, encoding );
-	}
-}
\ No newline at end of file
Index: tmp/org.txm.core/.classpath
===================================================================
--- tmp/org.txm.core/.classpath	(revision 926)
+++ tmp/org.txm.core/.classpath	(revision 927)
@@ -24,7 +24,6 @@
 	<classpathentry exported="true" kind="lib" path="lib/json-20090211.jar"/>
 	<classpathentry exported="true" kind="lib" path="lib/ridl-3.2.1.jar"/>
 	<classpathentry exported="true" kind="lib" path="lib/unoil-3.2.1.jar"/>
-	<classpathentry exported="true" kind="lib" path="lib/jtidy-r938.jar"/>
 	<classpathentry exported="true" kind="lib" path="lib/sqlite-jdbc-3.8.11.2.jar"/>
 	<classpathentry exported="true" kind="lib" path="lib/postgresql-9.4.1207.jre6.jar"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
@@ -42,5 +41,6 @@
 	<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
 	<classpathentry exported="true" kind="lib" path="lib/hsqldb.jar"/>
 	<classpathentry exported="true" kind="lib" path="lib/jodconverter-core-3.1-beta.jar"/>
+	<classpathentry kind="lib" path="lib/jsoup-1.11.3.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: tmp/org.txm.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.core/META-INF/MANIFEST.MF	(revision 926)
+++ tmp/org.txm.core/META-INF/MANIFEST.MF	(revision 927)
@@ -300,6 +300,13 @@
  org.hsqldb.util,
  org.jdesktop.layout,
  org.json,
+ org.jsoup,
+ org.jsoup.helper,
+ org.jsoup.internal,
+ org.jsoup.nodes,
+ org.jsoup.parser,
+ org.jsoup.safety,
+ org.jsoup.select,
  org.junit,
  org.junit.experimental.results,
  org.junit.experimental.runners,
@@ -382,6 +389,7 @@
  org.txm.importer,
  org.txm.importer.filters,
  org.txm.importer.scripting,
+ org.txm.importer.xmltxm,
  org.txm.js,
  org.txm.js.viewer,
  org.txm.metadatas,
@@ -452,8 +460,6 @@
  org.txm.xml.xsl.tei.txt,
  org.txm.xml.xsl.tei.xhtml2,
  org.txm.xml.xsl.tei.xsd,
- org.w3c.tidy,
- org.w3c.tidy.ant,
  resources,
  resources.documents,
  src.main.assembly,
Index: tmp/org.txm.core/lib/jtidy-r938.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: tmp/org.txm.core/lib/jsoup-1.11.3.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.core/lib/jsoup-1.11.3.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.core/.settings/org.eclipse.jdt.groovy.core.prefs
===================================================================
--- tmp/org.txm.core/.settings/org.eclipse.jdt.groovy.core.prefs	(revision 926)
+++ tmp/org.txm.core/.settings/org.eclipse.jdt.groovy.core.prefs	(revision 927)
@@ -1,3 +1,3 @@
 eclipse.preferences.version=1
-groovy.compiler.level=-1
+groovy.compiler.level=25
 groovy.script.filters=scripts/**/*.groovy,y,src/main/resources/**/*.groovy,y,src/test/resources/**/*.groovy,y
Index: tmp/org.txm.tokenizer.core/src/org/txm/tokenizer/TTest.groovy
===================================================================
--- tmp/org.txm.tokenizer.core/src/org/txm/tokenizer/TTest.groovy	(revision 926)
+++ tmp/org.txm.tokenizer.core/src/org/txm/tokenizer/TTest.groovy	(revision 927)
@@ -1,39 +0,0 @@
-package org.txm.tokenizer
-
-public class TTest {
-	def regex;
-	def type = "w";
-	def before=1, hit=2, after=3;
-	public TTest(def regex, String type, int before, int hit, int after) {
-		this.regex = regex
-		this.type = type
-		this.before = before
-		this.hit = hit
-		this.after = after
-	}
-
-	public TTest(def regex, int before, int hit, int after) {
-		this.regex = regex
-		this.before = before
-		this.hit = hit
-		this.after = after
-	}
-
-	public TTest(def regex, String type) {
-		this.regex = regex
-		this.type= type
-	}
-
-	public TTest(def regex) {
-		this.regex = regex
-	}
-
-	/* (non-Javadoc)
-	 * @see java.lang.Object#toString()
-	 */
-	@Override
-	public String toString() {
-		return "[regex=" + regex + ", type=" + type + ", before="+ before + ", hit=" + hit + ", after=" + after + "]";
-	}
-}
-
Index: tmp/org.txm.tokenizer.core/src/org/txm/tokenizer/TokenizerClasses.groovy
===================================================================
--- tmp/org.txm.tokenizer.core/src/org/txm/tokenizer/TokenizerClasses.groovy	(revision 926)
+++ tmp/org.txm.tokenizer.core/src/org/txm/tokenizer/TokenizerClasses.groovy	(revision 927)
@@ -1,622 +0,0 @@
-// Copyright © 2010-2013 ENS de Lyon.
-// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
-// Lyon 2, University of Franche-Comté, University of Nice
-// Sophia Antipolis, University of Paris 3.
-// 
-// The TXM platform is free software: you can redistribute it
-// and/or modify it under the terms of the GNU General Public
-// License as published by the Free Software Foundation,
-// either version 2 of the License, or (at your option) any
-// later version.
-// 
-// The TXM platform is distributed in the hope that it will be
-// useful, but WITHOUT ANY WARRANTY; without even the implied
-// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-// PURPOSE. See the GNU General Public License for more
-// details.
-// 
-// You should have received a copy of the GNU General
-// Public License along with the TXM platform. If not, see
-// http://www.gnu.org/licenses.
-//
-//
-//
-// $LastChangedDate: 2017-04-06 09:11:32 +0200 (jeu. 06 avril 2017) $
-// $LastChangedRevision: 3425 $
-// $LastChangedBy: mdecorde $
-//
-package org.txm.tokenizer
-
-import java.io.FileWriter;
-import java.util.regex.Pattern;
-
-import org.txm.utils.xml.DomUtils;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import javax.xml.stream.*;
-import java.net.URL;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class TokenizerClasses.
- */
-class TokenizerClasses {
-
-	//// ROOTS ? ////
-	public static boolean debug = false;
-	/** The tag_all. */
-	public static String tag_all = "<[A-Za-z][^>]+>";
-	
-	/** The Weblex enclitics. */
-	public static String enclitics = "je|m[eo]i|tu|t[eo]i|il|lui|luy|ilz|ils|no?u?s|vo?u?s|on|ce|ci|là|elles?"; // FRO
-	public static String encliticsFR = "je|tu|il|elle|on|nous|vous|ils|elles|toi|moi|en|y|t|leur|lui|le|la|les"; // FR
-
-	/** The TT enclitics. */
-	public static String FClitic_en = "'(s|re|ve|d|m|em|ll)|n['‘’]t";
-	public static String PClitic_fr = '[dcjlmnstDCJLNMST][\'‘’]|[Qq]u[\'‘’]|[Jj]usqu[\'‘’]|[Ll]orsqu[\'‘’]|[Pp]uisqu[\'‘’]|[Qq]uoiqu[\'‘’]';
-	public static String FClitic_fr = '-t-elles?|-t-ils?|-t-on|-ce|-elles?|-ils?|-je|-la|-les?|-leur|-lui|-mêmes?|-m[\'‘’]|-moi|-nous|-on|-toi|-tu|-t[\'‘’]|-vous|-en|-y|-ci|-là';
-	public static String PClitic_it = '[dD][ae]ll[\'‘’]|[nN]ell[\'‘’]|[Aa]ll[\'‘’]|[lLDd][\'‘’]|[Ss]ull[\'‘’]|[Qq]uest[\'‘’]|[Uu]n[\'‘’]|[Ss]enz[\'‘’]|[Tt]utt[\'‘’]';
-	public static String FClitic_gl = '-la|-las|-lo|-los|-nos';
-	
-	/** The div_tags. */
-	public static String div_tags = "TEI|text|front|body|div|div1|div2|div3|div4|div5|div6|back|head|trailer|p|ab|sp|speaker|list|notice|bibl|opener|dateline";
-
-	/** The q_tags. */
-	public static String q_tags = "q|quote|said|item|stage|cit|label|heraldry";
-
-	/** The extraword_tags. */
-	public static String extraword1_tags = "expan|pb|lb|milestone|gap|note|s|locus|title|ref|hi|witDetail";
-
-	/** The corr_tags_no_seg. */
-	public static String corr_tags_no_seg = "expan|unclear|choice|corr|sic|reg|orig|foreign|hi|title|name|supplied|subst|add|del|damage|date|idno|surplus";
-
-	/** The word_tags. */
-	public static String word_tags = "w";
-
-	/** The intraword_tags. */
-	public static String intraword_tags = "c|ex|caesura";
-
-	/** The punct_quotes. */
-	public static String punct_quotes = "'‘’’"
-
-	/** The punct_strong1. */
-	public static String punct_strong1 = ".!?";
-
-	/** The punct_strong2. */
-	public static String punct_strong2 = "\\.\\.|\\.\\.\\.|…|\\|";
-
-	/** The punct_paren_open1. */
-	public static String punct_paren_open1 = "«";
-
-	/** The punct_paren_open2. */
-	public static String punct_paren_open2 = "``|\\(|\\[|\\{";
-
-	/** The punct_paren_close1. */
-	public static String punct_paren_close1 = "»";
-
-	/** The punct_paren_close2. */
-	public static String punct_paren_close2 = "''|‘‘|’’|\\)|\\]|\\}";
-
-	/** The punct_weak. */
-	public static String punct_weak = "\\-,;∼ˆ·*:\"“”\\+±=/\\≤≥<>\\—ν√μ•@≈→αγ∞≡σ&%|#¼½Θĩ†φθΓ§ẽə∈";
-
-	public static String entity = "&[^;]+;";
-
-	public static String seg_tags = "seg"
-
-	//// COMBINAISONS ////
-
-	/** The corr_tags. */
-	public static String corr_tags = "$corr_tags_no_seg|$seg_tags";
-	/** The extraword_tags. */
-	public static String extraword_tags = "$div_tags|$q_tags|$extraword1_tags";
-
-	/** The punct_strong. */
-	public static String punct_strong = "[$punct_strong1]+|$punct_strong2";
-
-	/** The punct_paren_open. */
-	public static String punct_paren_open = "$punct_paren_open1|$punct_paren_open2";
-
-	/** The punct_paren_close. */
-	public static String punct_paren_close = "$punct_paren_close1|$punct_paren_close2";
-
-	/** The punct_paren. */
-	public static String punct_paren = "$punct_paren_open|$punct_paren_close";
-
-	/** The punct_all. */
-	public static String punct_all = "$punct_strong|$punct_paren|[$punct_weak]";
-
-	/** The word_chars. */
-	public static String word_chars = "[^ $punct_quotes$punct_strong1$punct_paren_open1$punct_paren_close1$punct_weak]|$entity";
-
-	public static def tests = [
-		new TTest(/\A(.*-)(je|m[eo]i|tu|t[eo]i|lui|luy|ilz|ils?|no?u?s|vo?u?s|on|leurs|ce|ci|là|elles?)(.*)\Z/),
-		new TTest(/\A(.*)(-)()\Z/, "pon"),
-		//new TTest(/\A(.*)(Bande dessinée|eau de vie|machine à écrire|Moyen Âge|petit pois|poule d'eau|Avoir l'air|se rendre compte|faire semblant|prendre froid|s'en aller|Comme il faut|bon marché|bon enfant|en retard|en colère|à la mode|de bonne humeur|hors de propos|de travers|en vacances|de standing|à l'abandon|sans défense|pieds nus|Tout à fait|d'ores et déjà|de temps en temps|tout de suite|de gré ou de force|ne pas|ne jamais|ne plus|sans doute|on ne peut plus|Quelque chose|ce dernier|n'importe quoi|N'importe quel|beaucoup de|plus d'un|peu de|un tas de|un groupe de|je ne sais quel|De sorte que|bien que|parce que|c'est pourquoi|de même que|depuis que|Quant à|au-dessus de|par rapport à|à côté de|grâce à|hors de|le long de|Par ma barbe !|Mon dieu !|Eh bien !|Bonne nuit !|Pas de panique !)(.*)\Z/),
-		new TTest(/\A([Aa]ujourd'hui)(.*)/,0,1,2),
-		
-		// BFM ONLY
-//		new TTest(/\A()([.·][^ .·]+[.·])(.*)\Z/, "num"), 
-
-		// TXM REFMAN ONLY
-//		new TTest(/\A(.*)($tag_all)(.*)\Z/, "tag"),
-//		new TTest(/\A(.*)([0-9][0-9][\/][0-9][0-9][\/][0-9][0-9])(.*)\Z/, "date", 1,2,3),
-//		new TTest(/\A(.*)([0-9][0-9]:[0-9][0-9]:[0-9][0-9])(.*)\Z/, "time", 1,2,3),
-//		new TTest(/\A([^0-9]*)([0-9]+(\.[0-9]+[a-z]+))(.*)\Z/, "version", 1,2,4),
-//		new TTest(/\A([^0-9]*)([0-9]+(\.[0-9]+)(\.[0-9]+)+)(\.[0-9]+[a-z]+)?(.*)\Z/, "version", 1,2,6),
-//		new TTest(/\A()([a-z]++:\/\/)(.*)\Z/, "protocol", 1,2,3),
-//		new TTest(/\A()([0-9]+([.,][0-9]+)?)()\Z/, "num", 1,2,4),
-//		new TTest(/\A()(([A-Z]:)?([\/\\][^\/\\]+)+)()\Z/, "path", 1,2,5),
-		
-		new TTest(/\A([\p{Ps}|\p{Pe}|\p{Pi}|\p{Pf}|\p{Po}|\p{S}]*)(\p{L}++['‘’])(.*)\Z/, "w", 1, 2, 3),
-		new TTest(/\A(.*)(\.\.\.)(.*)\Z/, "pon"),
-		new TTest(/\A(.*)(\p{Ps}|\p{Pe}|\p{Pi}|\p{Pf}|\p{Po}|\p{S})(.*)\Z/, "pon")
-		
-	];
-	//tag_all = "<[^>]+>";
-	//enclitics = "je|m[eo]i|tu|t[eo]i|il|lui|luy|ilz|ils|no?u?s|vo?u?s|on|ce|ci|là|elles?"; // FRO
-	//encliticsFR = "je|tu|il|elle|on|nous|vous|ils|elles|toi|moi|en|y|t|leur|lui|le|la|les"; // FR
-	//div_tags = "TEI|text|front|body|div|div1|div2|div3|div4|div5|div6|back|head|trailer|p|ab|sp|speaker|list|notice|bibl";
-	//q_tags = "q|quote|item|stage";
-	//extraword_tags = "$div_tags|$q_tags|expan|pb|lb|milestone|gap|note|s|locus|title|ref|hi|witDetail";
-	//corr_tags_no_seg = "expan|unclear|choice|corr|sic|reg|orig|foreign|hi|title|name|supplied|subst|add|del|damage|date|idno";
-	//corr_tags = "$corr_tags_no_seg|seg";
-	//word_tags = "w|abbr|num";
-	//intraword_tags = "c|ex";
-
-	public static String whitespaces = "[\\p{Z}\\p{C}]+";
-	public static String regElision = "['‘’]" // obsolete
-	public static String regPunct = "[\\p{Ps}\\p{Pe}\\p{Pi}\\p{Pf}\\p{Po}\\p{S}]"
-
-	//punct_strong1 = ".!?";
-	//punct_strong2 = "\\.\\.|\\.\\.\\.|…|\\|";
-	//punct_strong = "[$punct_strong1]|$punct_strong2";
-	//punct_paren_open1 = "«";
-	//punct_paren_open2 = "<<|``|\\(|\\[|\\{";
-	//punct_paren_open = "$punct_paren_open1|$punct_paren_open2";
-	//punct_paren_close1 = "»";
-	//punct_paren_close2 = ">>|''|‘‘|’’|\\)|\\]|\\}";
-	//punct_paren_close = "$punct_paren_close1|$punct_paren_close2";
-	//punct_paren = "$punct_paren_open|$punct_paren_close";
-	//punct_weak = ",;∼ˆ·*:\"`'“”\\+±=/\\-≤≥<>\\—_ν√μ•@≈→αγ∞≡σ&¼½Θĩ†φθΓ§ẽə∈";
-	//punct_all = "$punct_strong|$punct_paren|[$punct_weak]";
-	//word_chars = "[^ $punct_strong1$punct_paren_open1$punct_paren_close1$punct_weak]|&[^;]+;";
-
-	public static reset() {
-		tag_all = "<[^>]+>";
-		enclitics = "je|m[eo]i|tu|t[eo]i|il|lui|luy|ilz|ils|no?u?s|vo?u?s|on|ce|ci|là|elles?"; // FRO
-		encliticsFR = "je|tu|il|elle|on|nous|vous|ils|elles|toi|moi|en|y|t|leur|lui|le|la|les"; // FR
-		div_tags = "TEI|text|front|body|div|div1|div2|div3|div4|div5|div6|back|head|trailer|p|ab|sp|speaker|list|notice|bibl";
-		q_tags = "q|quote|item|stage|cit";
-		extraword1_tags = "expan|pb|lb|milestone|gap|note|s|locus|title|ref|hi|witDetail";
-		corr_tags_no_seg = "expan|unclear|choice|corr|sic|reg|orig|foreign|hi|title|name|supplied|subst|add|del|damage|date|idno|surplus";
-		word_tags = "w";
-		intraword_tags = "c|ex|caesura";
-		punct_quotes = "'‘’’"
-		punct_strong1 = ".!?";
-		punct_strong2 = "\\.\\.|\\.\\.\\.|…|\\|";
-		punct_paren_open1 = "«";
-		punct_paren_open2 = "``|\\(|\\[|\\{";
-		punct_paren_close1 = "»";
-		punct_paren_close2 = "''|‘‘|’’|\\)|\\]|\\}";
-		punct_weak = "\\-,;∼ˆ·*:\"“”\\+±=/\\-≤≥<>\\—ν√μ•@≈→αγ∞≡σ&¼½Θĩ†φθΓ§ẽə∈";
-		entity = "&[^;]+;";
-		seg_tags = "seg"
-		
-		whitespaces = "[\\p{Z}\\p{C}]+";
-		regElision = "['‘’]"
-		regPunct = "[\\p{Ps}\\p{Pe}\\p{Pi}\\p{Pf}\\p{Po}\\p{S}]"
-
-		recombine();
-	}
-
-	public static recombine() {
-		corr_tags = "$corr_tags_no_seg|$seg_tags";
-		extraword_tags = "$div_tags|$q_tags|$extraword1_tags";
-		punct_strong = "[$punct_strong1]|$punct_strong2";
-		punct_paren_open = "$punct_paren_open1|$punct_paren_open2";
-		punct_paren_close = "$punct_paren_close1|$punct_paren_close2";
-		punct_paren = "$punct_paren_open|$punct_paren_close";
-		punct_all = "$punct_strong|$punct_paren|[$punct_weak]";
-		word_chars = "[^ $punct_quotes$punct_strong1$punct_paren_open1$punct_paren_close1$punct_weak]|$entity";
-	}
-
-	/**
-	 * To dom.
-	 *
-	 * @param doc the doc
-	 * @param parent the parent
-	 * @return the java.lang. object
-	 */
-	public static toDom(Document doc, Node parent) {
-		Element tokenizer = doc.createElement("tokenizer");
-		tokenizer.setAttribute("onlyThoseTests", "false")
-		parent.appendChild(tokenizer)
-		
-		//String tag_all = "<[^>]+>";
-		Element p = doc.createElement("param");
-		p.setAttribute("key","tag_all");
-		p.setTextContent(tag_all);
-		tokenizer.appendChild(p)
-		//String enclitics = "je|m[eo]i|tu|t[eo]i|il|lui|luy|ilz|ils|no?u?s|vo?u?s|on|ce|ci|là|elles?"; // FRO
-		p = doc.createElement("param");
-		p.setAttribute("key","enclitics");
-		p.setTextContent(enclitics);
-		tokenizer.appendChild(p)
-		//String encliticsFR = "je|tu|il|elle|on|nous|vous|ils|elles|toi|moi|en|y|t|leur|lui|le|la|les"; // FR
-		p = doc.createElement("param");
-		p.setAttribute("key","encliticsFR");
-		p.setTextContent(encliticsFR);
-		tokenizer.appendChild(p)
-		//String div_tags = "TEI|text|front|body|div|div1|div2|div3|div4|div5|div6|back|head|trailer|p|ab|sp|speaker|list|notice|bibl";
-		p = doc.createElement("param");
-		p.setAttribute("key","div_tags");
-		p.setTextContent(div_tags);
-		tokenizer.appendChild(p)
-		//String q_tags = "q|quote|item|stage";
-		p = doc.createElement("param");
-		p.setAttribute("key","q_tags");
-		p.setTextContent(q_tags);
-		tokenizer.appendChild(p)
-		//String extraword_tags = "$div_tags|$q_tags|expan|pb|lb|milestone|gap|note|s|locus|title|ref|hi|witDetail";
-		p = doc.createElement("param");
-		p.setAttribute("key","extraword_tags");
-		p.setTextContent(extraword_tags);
-		tokenizer.appendChild(p)
-		//String corr_tags_no_seg = "expan|unclear|choice|corr|sic|reg|orig|foreign|hi|title|name|supplied|subst|add|del|damage|date|idno";
-		p = doc.createElement("param");
-		p.setAttribute("key","enclitics");
-		p.setTextContent(enclitics);
-		tokenizer.appendChild(p)
-		//String corr_tags = "$corr_tags_no_seg|seg";
-		p = doc.createElement("param");
-		p.setAttribute("key","corr_tags");
-		p.setTextContent(corr_tags);
-		tokenizer.appendChild(p)
-		//String word_tags = "w|abbr|num";
-		p = doc.createElement("param");
-		p.setAttribute("key","word_tags");
-		p.setTextContent(word_tags);
-		tokenizer.appendChild(p)
-		//String intraword_tags = "c|ex";
-		p = doc.createElement("param");
-		p.setAttribute("key","intraword_tags");
-		p.setTextContent(intraword_tags);
-		tokenizer.appendChild(p)
-
-		//String punct_strong1 = ".!?";
-		p = doc.createElement("param");
-		p.setAttribute("key","punct_strong1");
-		p.setTextContent(punct_strong1);
-		tokenizer.appendChild(p)
-		//String punct_strong2 = "\\.\\.|\\.\\.\\.|…|\\|";
-		p = doc.createElement("param");
-		p.setAttribute("key","punct_strong2");
-		p.setTextContent(punct_strong2);
-		tokenizer.appendChild(p)
-		//String punct_strong = "[$punct_strong1]|$punct_strong2";
-		p = doc.createElement("param");
-		p.setAttribute("key","punct_strong");
-		p.setTextContent(punct_strong);
-		tokenizer.appendChild(p)
-		//String punct_paren_open1 = "«";
-		p = doc.createElement("param");
-		p.setAttribute("key","punct_paren_open1");
-		p.setTextContent(punct_paren_open1);
-		tokenizer.appendChild(p)
-		//String punct_paren_open2 = "<<|``|\\(|\\[|\\{";
-		p = doc.createElement("param");
-		p.setAttribute("key","punct_paren_open2");
-		p.setTextContent(punct_paren_open2);
-		tokenizer.appendChild(p)
-		//String punct_paren_open = "$punct_paren_open1|$punct_paren_open2";
-		p = doc.createElement("param");
-		p.setAttribute("key","punct_paren_open");
-		p.setTextContent(punct_paren_open);
-		tokenizer.appendChild(p)
-		//String punct_paren_close1 = "»";
-		p = doc.createElement("param");
-		p.setAttribute("key","punct_paren_close1");
-		p.setTextContent(punct_paren_close1);
-		tokenizer.appendChild(p)
-		//String punct_paren_close2 = ">>|''|‘‘|’’|\\)|\\]|\\}";
-		p = doc.createElement("param");
-		p.setAttribute("key","punct_paren_close2");
-		p.setTextContent(punct_paren_close2);
-		tokenizer.appendChild(p)
-		//String punct_paren_close = "$punct_paren_close1|$punct_paren_close2";
-		p = doc.createElement("param");
-		p.setAttribute("key","punct_paren_close");
-		p.setTextContent(punct_paren_close);
-		tokenizer.appendChild(p)
-		//String punct_paren = "$punct_paren_open|$punct_paren_close";
-		p = doc.createElement("param");
-		p.setAttribute("key","punct_paren");
-		p.setTextContent(punct_paren);
-		tokenizer.appendChild(p)
-		//String punct_weak = ",;∼ˆ·*:\"`'“”\\+±=/\\-≤≥<>\\—_ν√μ•@≈→αγ∞≡σ&¼½Θĩ†φθΓ§ẽə∈";
-		p = doc.createElement("param");
-		p.setAttribute("key","punct_weak");
-		p.setTextContent(punct_weak);
-		tokenizer.appendChild(p)
-		//String punct_all = "$punct_strong|$punct_paren|[$punct_weak]";
-		p = doc.createElement("param");
-		p.setAttribute("key","punct_all");
-		p.setTextContent(punct_all);
-		tokenizer.appendChild(p)
-		//String word_chars = "[^ $punct_strong1$punct_paren_open1$punct_paren_close1$punct_weak]|&[^;]+;";
-		p = doc.createElement("param");
-		p.setAttribute("key","word_chars");
-		p.setTextContent(word_chars);
-		tokenizer.appendChild(p)
-		//whitespaces = "[\\p{Z}\\p{C}]+";
-		p = doc.createElement("param");
-		p.setAttribute("key","whitespaces");
-		p.setTextContent(whitespaces);
-		tokenizer.appendChild(p)
-		//regElision = "['‘’]"
-		p = doc.createElement("param");
-		p.setAttribute("key","regElision");
-		p.setTextContent(regElision);
-		tokenizer.appendChild(p)
-		//regPunct = "[\\p{Ps}\\p{Pe}\\p{Pi}\\p{Pf}\\p{Po}\\p{S}]"
-		p = doc.createElement("param");
-		p.setAttribute("key","regPunct");
-		p.setTextContent(regPunct);
-		tokenizer.appendChild(p)
-	}
-
-	/**
-	 * Dump.
-	 */
-	public static void dump() {
-		println "BRUT"
-		println "tag_all = $tag_all"
-		println "enclitics = $enclitics"
-		println "encliticsFR = $encliticsFR"
-		println "div_tags = $div_tags"
-		println "q_tags = $q_tags"
-		println "extraword1_tags = $extraword1_tags"
-		println "corr_tags_no_seg = $corr_tags_no_seg"
-		println "word_tags = $word_tags"
-		println "intraword_tags = $intraword_tags"
-		println "punct_quotes = $punct_quotes"
-		println "punct_strong1 = $punct_strong1"
-		println "punct_strong2 = $punct_strong2"
-		println "punct_paren_open1 = $punct_paren_open1"
-		println "punct_paren_open2 = $punct_paren_open2"
-		println "punct_paren_close1 = $punct_paren_close1"
-		println "punct_paren_close2 = $punct_paren_close2"
-		println "punct_weak = $punct_weak"
-		println "entity = $entity"
-		println "seg_tags = $seg_tags"
-		println "COMBINED"
-		println "corr_tags = $corr_tags"
-		println "extraword_tags = $extraword_tags"
-		println "punct_strong = $punct_strong"
-		println "punct_paren_open = $punct_paren_open"
-		println "punct_paren_close = $punct_paren_close"
-		println "punct_paren = $punct_paren"
-		println "punct_all = $punct_all"
-		println "word_chars = $word_chars"
-		println "whitespaces = $whitespaces"
-		println "regElision = $regElision"
-		println "regPunct = $regPunct"
-		println "TESTS"
-		for(def test : tests)
-			println " $test"
-	}
-
-	public static boolean isValid() {
-		try { Pattern.compile(tag_all) }
-		catch (Exception e) { println "tag_all=${tag_all}: "+e;return false; }
-
-		try { Pattern.compile(enclitics) }
-		catch (Exception e) { println "enclitics=${enclitics}: "+e;return false; }
-
-		try { Pattern.compile(encliticsFR) }
-		catch (Exception e) { println "encliticsFR=${encliticsFR}: "+e;return false; }
-
-		try { Pattern.compile(div_tags) }
-		catch (Exception e) { println "div_tags=${div_tags}: "+e;return false; }
-
-		try { Pattern.compile(q_tags) }
-		catch (Exception e) { println "q_tags=${q_tags}: "+e;return false; }
-
-		try { Pattern.compile(extraword1_tags) }
-		catch (Exception e) { println "extraword1_tags=${extraword1_tags}: "+e;return false; }
-
-		try { Pattern.compile(corr_tags_no_seg) }
-		catch (Exception e) { println "corr_tags_no_seg=${corr_tags_no_seg}: "+e;return false; }
-
-		try { Pattern.compile(word_tags) }
-		catch (Exception e) { println "word_tags=${word_tags}: "+e;return false; }
-
-		try { Pattern.compile(intraword_tags) }
-		catch (Exception e) { println "intraword_tags=${intraword_tags}: "+e;return false; }
-
-		try { Pattern.compile(punct_quotes) }
-		catch (Exception e) { println "punct_quotes=${punct_quotes}: "+e;return false; }
-
-		try { Pattern.compile(punct_strong1) }
-		catch (Exception e) { println "punct_strong1=${punct_strong1}: "+e;return false; }
-
-		try { Pattern.compile(punct_strong2) }
-		catch (Exception e) { println "punct_strong2=${punct_strong2}: "+e;return false; }
-
-		try { Pattern.compile(punct_paren_open1) }
-		catch (Exception e) { println "punct_paren_open1=${punct_paren_open1}: "+e;return false; }
-
-		try { Pattern.compile(punct_paren_open2) }
-		catch (Exception e) { println "punct_paren_open2=${punct_paren_open2}: "+e;return false; }
-
-		try { Pattern.compile(punct_paren_close1) }
-		catch (Exception e) { println "punct_paren_close1=${punct_paren_close1}: "+e;return false; }
-
-		try { Pattern.compile(punct_paren_close2) }
-		catch (Exception e) { println "punct_paren_close2=${punct_paren_close2}: "+e;return false; }
-
-		try { Pattern.compile(punct_weak) }
-		catch (Exception e) { println "punct_weak=${punct_weak}: "+e;return false; }
-
-		try { Pattern.compile(entity) }
-		catch (Exception e) { println "entity=${entity}: "+e;return false; }
-
-		try { Pattern.compile(seg_tags) }
-		catch (Exception e) { println "seg_tags=${seg_tags}: "+e;return false; }
-
-		try { Pattern.compile(corr_tags) }
-		catch (Exception e) { println "corr_tags: "+e;return false; }
-
-		try { 	Pattern.compile(extraword_tags) }
-		catch (Exception e) { println "extraword_tags: "+e;return false; }
-
-		if (punct_strong != null)
-		try { 	Pattern.compile(punct_strong) }
-		catch (Exception e) { println "punct_strong: "+e;return false; }
-
-		try { Pattern.compile(punct_paren_open) }
-		catch (Exception e) { println "punct_paren_open: "+e;return false; }
-
-		try { Pattern.compile(punct_paren_close) }
-		catch (Exception e) { println "punct_paren_close: "+e;return false; }
-
-		try { Pattern.compile(punct_paren) }
-		catch (Exception e) { println "punct_paren: "+e;return false; }
-
-		try { Pattern.compile(punct_all) }
-		catch (Exception e) { println "punct_all: "+e;return false; }
-
-		try { Pattern.compile(word_chars) }
-		catch (Exception e) { println "word_chars: "+e;return false; }
-		
-		if (regPunct != null)
-		try { Pattern.compile(regPunct) }
-		catch (Exception e) { println "regPunct=${regPunct}: "+e;return false; }
-
-		if (regElision != null)
-		try { Pattern.compile(regElision) }
-		catch (Exception e) { println "regElision=${regElision}: "+e;return false; }
-
-		if (whitespaces != null)
-		try { Pattern.compile(whitespaces) }
-		catch (Exception e) { println "whitespaces=${whitespaces}: "+e;return false; }
-
-		for(TTest test : tests) {
-			try { Pattern.compile(test.regex) }
-			catch (Exception e) { println test.regex+": "+e;return false; }
-		}
-		return true;
-	}
-
-	public static boolean loadFromNode(Element tokenizerElement) {
-		//load params
-		String tmp_strong_punct;
-		NodeList params = tokenizerElement.getElementsByTagName("param");
-		for (int i = 0 ; i < params.getLength() ; i++) {
-			Element param = params.item(i);
-			String key = param.getAttribute("name")
-			String value = param.getAttribute("value")
-			if (value == null || value.length() == 0) value = param.getTextContent()
-			if (value.length() == 0) value = null;
-			
-			if (debug) println (" Tokenizer parametrized with $key=$value.")
-			if (key == "tag_all")
-				tag_all = value
-			else if (key == "enclitics")
-				enclitics = value
-			else if (key == "encliticsFR")
-				encliticsFR = value
-			else if (key == "div_tags")
-				div_tags = value
-			else if (key == "q_tags")
-				q_tags = value
-			else if (key == "extraword1_tags")
-				extraword1_tags = value
-			else if (key == "corr_tags_no_seg")
-				corr_tags_no_seg = value
-			else if (key == "word_tags")
-				word_tags = value
-			else if (key == "intraword_tags")
-				intraword_tags = value
-			else if (key == "punct_quotes")
-				punct_quotes = value
-			else if (key == "punct_strong1")
-				punct_strong1 = value
-			else if (key == "punct_strong2")
-				punct_strong2 = value
-			else if (key == "punct_paren_open1")
-				punct_paren_open1 = value
-			else if (key == "punct_paren_open2")
-				punct_paren_open2 = value
-			else if (key == "punct_paren_close1")
-				punct_paren_close1 = value
-			else if (key == "punct_paren_close2")
-				punct_paren_close2 = value
-			else if (key == "punct_weak")
-				punct_weak = value
-			else if (key == "entity")
-				entity = value
-			else if (key == "seg_tags")
-				seg_tags = value
-			else if (key == "regPunct")
-				regPunct = value
-			else if (key == "regElision")
-				regElision = value
-			else if (key == "whitespaces")
-				whitespaces = value
-			else if (key == "punct_strong") // this is temporary
-				tmp_strong_punct = value // this is temporary
-			else
-				println "MISSING TOKENIZER KEY: "+key
-		}
-		//recombine
-		recombine();
-		if (tmp_strong_punct != null) punct_strong = tmp_strong_punct;  // this is temporary
-		
-		String shouldResetTests = tokenizerElement.getAttribute("onlyThoseTests")
-		if ("true".equals(shouldResetTests)) {
-			println "Warning: tokenizer only using import parameters tests"
-			tests = []
-		}
-			
-		NodeList testsList = tokenizerElement.getElementsByTagName("test");
-		if (testsList.getLength() > 0) {
-			//println "Add "+testsList.getLength()+" tests to the tokenizer"
-			for (int i = 0 ; i < testsList.getLength() ; i++) {
-				Element test = testsList.item(i);
-				tests.add(i, new TTest(test.getTextContent(), test.getAttribute("type"),
-						Integer.parseInt(test.getAttribute("before")),
-						Integer.parseInt(test.getAttribute("hit")),
-						Integer.parseInt(test.getAttribute("after")))
-						)
-			}
-			//println "Tests: "+tests
-		}
-
-		if (isValid())
-			return true
-		else {
-			reset();
-			recombine();
-			return false;
-		}
-	}
-
-	/**
-	 * The main method.
-	 *
-	 * @param args the arguments
-	 */
-	public static void main(String[] args) {
-
-		Document doc = DomUtils.load(new File("/home/mdecorde/xml/discours/import.xml"));
-		Node corpora = doc.getDocumentElement().getElementsByTagName("corpora").item(0);
-		Node corpus = ((Element)corpora).getElementsByTagName("corpus").item(0)
-		Node tokenizer = ((Element)corpus).getElementsByTagName("tokenizer").item(0)
-		println "OK? "+ TokenizerClasses.loadFromNode(tokenizer)
-	}
-}
\ No newline at end of file
Index: tmp/org.txm.tokenizer.core/src/org/txm/tokenizer/TTest.java
===================================================================
--- tmp/org.txm.tokenizer.core/src/org/txm/tokenizer/TTest.java	(revision 0)
+++ tmp/org.txm.tokenizer.core/src/org/txm/tokenizer/TTest.java	(revision 927)
@@ -0,0 +1,43 @@
+package org.txm.tokenizer;
+
+public class TTest {
+	String regex;
+	String type = "w";
+	int before=1, hit=2, after=3;
+	public TTest(String regex, String type, int before, int hit, int after) {
+		this.regex = regex;
+		this.type = type;
+		this.before = before;
+		this.hit = hit;
+		this.after = after;
+	}
+	
+	public String getRegex() {
+		return regex;
+	}
+
+	public TTest(String regex, int before, int hit, int after) {
+		this.regex = regex;
+		this.before = before;
+		this.hit = hit;
+		this.after = after;
+	}
+
+	public TTest(String regex, String type) {
+		this.regex = regex;
+		this.type= type;
+	}
+
+	public TTest(String regex) {
+		this.regex = regex;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public String toString() {
+		return "[regex=" + regex + ", type=" + type + ", before="+ before + ", hit=" + hit + ", after=" + after + "]";
+	}
+}
+
Index: tmp/org.txm.tokenizer.core/src/org/txm/tokenizer/TokenizerClasses.java
===================================================================
--- tmp/org.txm.tokenizer.core/src/org/txm/tokenizer/TokenizerClasses.java	(revision 0)
+++ tmp/org.txm.tokenizer.core/src/org/txm/tokenizer/TokenizerClasses.java	(revision 927)
@@ -0,0 +1,635 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate: 2017-04-06 09:11:32 +0200 (jeu. 06 avril 2017) $
+// $LastChangedRevision: 3425 $
+// $LastChangedBy: mdecorde $
+//
+package org.txm.tokenizer;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Pattern;
+
+import org.txm.utils.xml.DomUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.stream.*;
+import java.net.URL;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class TokenizerClasses.
+ */
+public class TokenizerClasses {
+
+	//// ROOTS ? ////
+	public static boolean debug = false;
+	/** The tag_all. */
+	public static String tag_all = "<[A-Za-z][^>]+>";
+	
+	/** The Weblex enclitics. */
+	public static String enclitics = "je|m[eo]i|tu|t[eo]i|il|lui|luy|ilz|ils|no?u?s|vo?u?s|on|ce|ci|là|elles?"; // FRO
+	public static String encliticsFR = "je|tu|il|elle|on|nous|vous|ils|elles|toi|moi|en|y|t|leur|lui|le|la|les"; // FR
+
+	/** The TT enclitics. */
+	public static String FClitic_en = "'(s|re|ve|d|m|em|ll)|n['‘’]t";
+	public static String PClitic_fr = "[dcjlmnstDCJLNMST][\'‘’]|[Qq]u[\'‘’]|[Jj]usqu[\'‘’]|[Ll]orsqu[\'‘’]|[Pp]uisqu[\'‘’]|[Qq]uoiqu[\'‘’]";
+	public static String FClitic_fr = "-t-elles?|-t-ils?|-t-on|-ce|-elles?|-ils?|-je|-la|-les?|-leur|-lui|-mêmes?|-m[\'‘’]|-moi|-nous|-on|-toi|-tu|-t[\'‘’]|-vous|-en|-y|-ci|-là";
+	public static String PClitic_it = "[dD][ae]ll[\'‘’]|[nN]ell[\'‘’]|[Aa]ll[\'‘’]|[lLDd][\'‘’]|[Ss]ull[\'‘’]|[Qq]uest[\'‘’]|[Uu]n[\'‘’]|[Ss]enz[\'‘’]|[Tt]utt[\'‘’]";
+	public static String FClitic_gl = "-la|-las|-lo|-los|-nos";
+	
+	/** The div_tags. */
+	public static String div_tags = "TEI|text|front|body|div|div1|div2|div3|div4|div5|div6|back|head|trailer|p|ab|sp|speaker|list|notice|bibl|opener|dateline";
+
+	/** The q_tags. */
+	public static String q_tags = "q|quote|said|item|stage|cit|label|heraldry";
+
+	/** The extraword_tags. */
+	public static String extraword1_tags = "expan|pb|lb|milestone|gap|note|s|locus|title|ref|hi|witDetail";
+
+	/** The corr_tags_no_seg. */
+	public static String corr_tags_no_seg = "expan|unclear|choice|corr|sic|reg|orig|foreign|hi|title|name|supplied|subst|add|del|damage|date|idno|surplus";
+
+	/** The word_tags. */
+	public static String word_tags = "w";
+
+	/** The intraword_tags. */
+	public static String intraword_tags = "c|ex|caesura";
+
+	/** The punct_quotes. */
+	public static String punct_quotes = "'‘’’";
+
+	/** The punct_strong1. */
+	public static String punct_strong1 = ".!?";
+
+	/** The punct_strong2. */
+	public static String punct_strong2 = "\\.\\.|\\.\\.\\.|…|\\|";
+
+	/** The punct_paren_open1. */
+	public static String punct_paren_open1 = "«";
+
+	/** The punct_paren_open2. */
+	public static String punct_paren_open2 = "``|\\(|\\[|\\{";
+
+	/** The punct_paren_close1. */
+	public static String punct_paren_close1 = "»";
+
+	/** The punct_paren_close2. */
+	public static String punct_paren_close2 = "''|‘‘|’’|\\)|\\]|\\}";
+
+	/** The punct_weak. */
+	public static String punct_weak = "\\-,;∼ˆ·*:\"“”\\+±=/\\≤≥<>\\—ν√μ•@≈→αγ∞≡σ&%|#¼½Θĩ†φθΓ§ẽə∈";
+
+	public static String entity = "&[^;]+;";
+
+	public static String seg_tags = "seg";
+
+	//// COMBINAISONS ////
+
+	/** The corr_tags. */
+	public static String corr_tags = ""+corr_tags_no_seg+"|"+seg_tags+"";
+	/** The extraword_tags. */
+	public static String extraword_tags = ""+div_tags+"|"+q_tags+"|"+extraword1_tags+"";
+
+	/** The punct_strong. */
+	public static String punct_strong = "["+punct_strong1+"]+|"+punct_strong2+"";
+
+	/** The punct_paren_open. */
+	public static String punct_paren_open = ""+punct_paren_open1+"|"+punct_paren_open2+"";
+
+	/** The punct_paren_close. */
+	public static String punct_paren_close = ""+punct_paren_close1+"|"+punct_paren_close2+"";
+
+	/** The punct_paren. */
+	public static String punct_paren = ""+punct_paren_open+"|"+punct_paren_close+"";
+
+	/** The punct_all. */
+	public static String punct_all = ""+punct_strong+"|"+punct_paren+"|["+punct_weak+"]+";
+
+	/** The word_chars. */
+	public static String word_chars = "[^ "+punct_quotes+""+punct_strong1+""+punct_paren_open1+""+punct_paren_close1+""+punct_weak+"]+|"+entity+"";
+
+	public static TTest[] tests = {
+//		new TTest(/\A(.*-)(je|m[eo]i|tu|t[eo]i|lui|luy|ilz|ils?|no?u?s|vo?u?s|on|leurs|ce|ci|là|elles?)(.*)\Z/),
+//		new TTest(/\A(.*)(-)()\Z/, "pon"),
+//		//new TTest(/\A(.*)(Bande dessinée|eau de vie|machine à écrire|Moyen Âge|petit pois|poule d'eau|Avoir l'air|se rendre compte|faire semblant|prendre froid|s'en aller|Comme il faut|bon marché|bon enfant|en retard|en colère|à la mode|de bonne humeur|hors de propos|de travers|en vacances|de standing|à l'abandon|sans défense|pieds nus|Tout à fait|d'ores et déjà|de temps en temps|tout de suite|de gré ou de force|ne pas|ne jamais|ne plus|sans doute|on ne peut plus|Quelque chose|ce dernier|n'importe quoi|N'importe quel|beaucoup de|plus d'un|peu de|un tas de|un groupe de|je ne sais quel|De sorte que|bien que|parce que|c'est pourquoi|de même que|depuis que|Quant à|au-dessus de|par rapport à|à côté de|grâce à|hors de|le long de|Par ma barbe !|Mon dieu !|Eh bien !|Bonne nuit !|Pas de panique !)(.*)\Z/),
+//		new TTest(/\A([Aa]ujourd'hui)(.*)/,0,1,2),
+//		
+		// BFM ONLY
+//		new TTest(/\A()([.·][^ .·]+[.·])(.*)\Z/, "num"), 
+
+		// TXM REFMAN ONLY
+//		new TTest(/\A(.*)($tag_all)(.*)\Z/, "tag"),
+//		new TTest(/\A(.*)([0-9][0-9][\/][0-9][0-9][\/][0-9][0-9])(.*)\Z/, "date", 1,2,3),
+//		new TTest(/\A(.*)([0-9][0-9]:[0-9][0-9]:[0-9][0-9])(.*)\Z/, "time", 1,2,3),
+//		new TTest(/\A([^0-9]*)([0-9]+(\.[0-9]+[a-z]+))(.*)\Z/, "version", 1,2,4),
+//		new TTest(/\A([^0-9]*)([0-9]+(\.[0-9]+)(\.[0-9]+)+)(\.[0-9]+[a-z]+)?(.*)\Z/, "version", 1,2,6),
+//		new TTest(/\A()([a-z]++:\/\/)(.*)\Z/, "protocol", 1,2,3),
+//		new TTest(/\A()([0-9]+([.,][0-9]+)?)()\Z/, "num", 1,2,4),
+//		new TTest(/\A()(([A-Z]:)?([\/\\][^\/\\]+)+)()\Z/, "path", 1,2,5),
+		
+//		new TTest(/\A([\p{Ps}|\p{Pe}|\p{Pi}|\p{Pf}|\p{Po}|\p{S}]*)(\p{L}++['‘’])(.*)\Z/, "w", 1, 2, 3),
+//		new TTest(/\A(.*)(\.\.\.)(.*)\Z/, "pon"),
+//		new TTest(/\A(.*)(\p{Ps}|\p{Pe}|\p{Pi}|\p{Pf}|\p{Po}|\p{S})(.*)\Z/, "pon")
+	};
+		
+	//tag_all = "<[^>]+>";
+	//enclitics = "je|m[eo]i|tu|t[eo]i|il|lui|luy|ilz|ils|no?u?s|vo?u?s|on|ce|ci|là|elles?"; // FRO
+	//encliticsFR = "je|tu|il|elle|on|nous|vous|ils|elles|toi|moi|en|y|t|leur|lui|le|la|les"; // FR
+	//div_tags = "TEI|text|front|body|div|div1|div2|div3|div4|div5|div6|back|head|trailer|p|ab|sp|speaker|list|notice|bibl";
+	//q_tags = "q|quote|item|stage";
+	//extraword_tags = "$div_tags|$q_tags|expan|pb|lb|milestone|gap|note|s|locus|title|ref|hi|witDetail";
+	//corr_tags_no_seg = "expan|unclear|choice|corr|sic|reg|orig|foreign|hi|title|name|supplied|subst|add|del|damage|date|idno";
+	//corr_tags = "$corr_tags_no_seg|seg";
+	//word_tags = "w|abbr|num";
+	//intraword_tags = "c|ex";
+
+	public static String whitespaces = "[\\p{Z}\\p{C}]+";
+	public static String regElision = "['‘’]"; // obsolete
+	public static String regPunct = "[\\p{Ps}\\p{Pe}\\p{Pi}\\p{Pf}\\p{Po}\\p{S}]";
+
+	//punct_strong1 = ".!?";
+	//punct_strong2 = "\\.\\.|\\.\\.\\.|…|\\|";
+	//punct_strong = "[$punct_strong1]|$punct_strong2";
+	//punct_paren_open1 = "«";
+	//punct_paren_open2 = "<<|``|\\(|\\[|\\{";
+	//punct_paren_open = "$punct_paren_open1|$punct_paren_open2";
+	//punct_paren_close1 = "»";
+	//punct_paren_close2 = ">>|''|‘‘|’’|\\)|\\]|\\}";
+	//punct_paren_close = "$punct_paren_close1|$punct_paren_close2";
+	//punct_paren = "$punct_paren_open|$punct_paren_close";
+	//punct_weak = ",;∼ˆ·*:\"`'“”\\+±=/\\-≤≥<>\\—_ν√μ•@≈→αγ∞≡σ&¼½Θĩ†φθΓ§ẽə∈";
+	//punct_all = "$punct_strong|$punct_paren|[$punct_weak]";
+	//word_chars = "[^ $punct_strong1$punct_paren_open1$punct_paren_close1$punct_weak]|&[^;]+;";
+
+	public static void reset() {
+		tag_all = "<[^>]+>";
+		enclitics = "je|m[eo]i|tu|t[eo]i|il|lui|luy|ilz|ils|no?u?s|vo?u?s|on|ce|ci|là|elles?"; // FRO
+		encliticsFR = "je|tu|il|elle|on|nous|vous|ils|elles|toi|moi|en|y|t|leur|lui|le|la|les"; // FR
+		div_tags = "TEI|text|front|body|div|div1|div2|div3|div4|div5|div6|back|head|trailer|p|ab|sp|speaker|list|notice|bibl";
+		q_tags = "q|quote|item|stage|cit";
+		extraword1_tags = "expan|pb|lb|milestone|gap|note|s|locus|title|ref|hi|witDetail";
+		corr_tags_no_seg = "expan|unclear|choice|corr|sic|reg|orig|foreign|hi|title|name|supplied|subst|add|del|damage|date|idno|surplus";
+		word_tags = "w";
+		intraword_tags = "c|ex|caesura";
+		punct_quotes = "'‘’’";
+		punct_strong1 = ".!?";
+		punct_strong2 = "\\.\\.|\\.\\.\\.|…|\\|";
+		punct_paren_open1 = "«";
+		punct_paren_open2 = "``|\\(|\\[|\\{";
+		punct_paren_close1 = "»";
+		punct_paren_close2 = "''|‘‘|’’|\\)|\\]|\\}";
+		punct_weak = "\\-,;∼ˆ·*:\"“”\\+±=/\\-≤≥<>\\—ν√μ•@≈→αγ∞≡σ&¼½Θĩ†φθΓ§ẽə∈";
+		entity = "&[^;]+;";
+		seg_tags = "seg";
+		
+		whitespaces = "[\\p{Z}\\p{C}]+";
+		regElision = "['‘’]";
+		regPunct = "[\\p{Ps}\\p{Pe}\\p{Pi}\\p{Pf}\\p{Po}\\p{S}]";
+
+		recombine();
+	}
+
+	public static void recombine() {
+		corr_tags = ""+corr_tags_no_seg+"|"+seg_tags+"";
+		extraword_tags = ""+div_tags+"|"+q_tags+"|"+extraword1_tags+"";
+		punct_strong = "["+punct_strong1+"]|"+punct_strong2+"";
+		punct_paren_open = ""+punct_paren_open1+"|"+punct_paren_open2+"";
+		punct_paren_close = ""+punct_paren_close1+"|"+punct_paren_close2+"";
+		punct_paren = ""+punct_paren_open+"|"+punct_paren_close+"";
+		punct_all = ""+punct_strong+"|"+punct_paren+"|["+punct_weak+"]";
+		word_chars = "[^ "+punct_quotes+""+punct_strong1+""+punct_paren_open1+""+punct_paren_close1+""+punct_weak+"]|"+entity+"";
+	}
+
+	/**
+	 * To dom.
+	 *
+	 * @param doc the doc
+	 * @param parent the parent
+	 * @return the java.lang. object
+	 */
+	public static void toDom(Document doc, Node parent) {
+		Element tokenizer = doc.createElement("tokenizer");
+		tokenizer.setAttribute("onlyThoseTests", "false");
+		parent.appendChild(tokenizer);
+		
+		//String tag_all = "<[^>]+>";
+		Element p = doc.createElement("param");
+		p.setAttribute("key","tag_all");
+		p.setTextContent(tag_all);
+		tokenizer.appendChild(p);
+		//String enclitics = "je|m[eo]i|tu|t[eo]i|il|lui|luy|ilz|ils|no?u?s|vo?u?s|on|ce|ci|là|elles?"; // FRO
+		p = doc.createElement("param");
+		p.setAttribute("key","enclitics");
+		p.setTextContent(enclitics);
+		tokenizer.appendChild(p);
+		//String encliticsFR = "je|tu|il|elle|on|nous|vous|ils|elles|toi|moi|en|y|t|leur|lui|le|la|les"; // FR
+		p = doc.createElement("param");
+		p.setAttribute("key","encliticsFR");
+		p.setTextContent(encliticsFR);
+		tokenizer.appendChild(p);
+		//String div_tags = "TEI|text|front|body|div|div1|div2|div3|div4|div5|div6|back|head|trailer|p|ab|sp|speaker|list|notice|bibl";
+		p = doc.createElement("param");
+		p.setAttribute("key","div_tags");
+		p.setTextContent(div_tags);
+		tokenizer.appendChild(p);
+		//String q_tags = "q|quote|item|stage";
+		p = doc.createElement("param");
+		p.setAttribute("key","q_tags");
+		p.setTextContent(q_tags);
+		tokenizer.appendChild(p);
+		//String extraword_tags = "$div_tags|$q_tags|expan|pb|lb|milestone|gap|note|s|locus|title|ref|hi|witDetail";
+		p = doc.createElement("param");
+		p.setAttribute("key","extraword_tags");
+		p.setTextContent(extraword_tags);
+		tokenizer.appendChild(p);
+		//String corr_tags_no_seg = "expan|unclear|choice|corr|sic|reg|orig|foreign|hi|title|name|supplied|subst|add|del|damage|date|idno";
+		p = doc.createElement("param");
+		p.setAttribute("key","enclitics");
+		p.setTextContent(enclitics);
+		tokenizer.appendChild(p);
+		//String corr_tags = "$corr_tags_no_seg|seg";
+		p = doc.createElement("param");
+		p.setAttribute("key","corr_tags");
+		p.setTextContent(corr_tags);
+		tokenizer.appendChild(p);
+		//String word_tags = "w|abbr|num";
+		p = doc.createElement("param");
+		p.setAttribute("key","word_tags");
+		p.setTextContent(word_tags);
+		tokenizer.appendChild(p);
+		//String intraword_tags = "c|ex";
+		p = doc.createElement("param");
+		p.setAttribute("key","intraword_tags");
+		p.setTextContent(intraword_tags);
+		tokenizer.appendChild(p);
+
+		//String punct_strong1 = ".!?";
+		p = doc.createElement("param");
+		p.setAttribute("key","punct_strong1");
+		p.setTextContent(punct_strong1);
+		tokenizer.appendChild(p);
+		//String punct_strong2 = "\\.\\.|\\.\\.\\.|…|\\|";
+		p = doc.createElement("param");
+		p.setAttribute("key","punct_strong2");
+		p.setTextContent(punct_strong2);
+		tokenizer.appendChild(p);
+		//String punct_strong = "[$punct_strong1]|$punct_strong2";
+		p = doc.createElement("param");
+		p.setAttribute("key","punct_strong");
+		p.setTextContent(punct_strong);
+		tokenizer.appendChild(p);
+		//String punct_paren_open1 = "«";
+		p = doc.createElement("param");
+		p.setAttribute("key","punct_paren_open1");
+		p.setTextContent(punct_paren_open1);
+		tokenizer.appendChild(p);
+		//String punct_paren_open2 = "<<|``|\\(|\\[|\\{";
+		p = doc.createElement("param");
+		p.setAttribute("key","punct_paren_open2");
+		p.setTextContent(punct_paren_open2);
+		tokenizer.appendChild(p);
+		//String punct_paren_open = "$punct_paren_open1|$punct_paren_open2";
+		p = doc.createElement("param");
+		p.setAttribute("key","punct_paren_open");
+		p.setTextContent(punct_paren_open);
+		tokenizer.appendChild(p);
+		//String punct_paren_close1 = "»";
+		p = doc.createElement("param");
+		p.setAttribute("key","punct_paren_close1");
+		p.setTextContent(punct_paren_close1);
+		tokenizer.appendChild(p);
+		//String punct_paren_close2 = ">>|''|‘‘|’’|\\)|\\]|\\}";
+		p = doc.createElement("param");
+		p.setAttribute("key","punct_paren_close2");
+		p.setTextContent(punct_paren_close2);
+		tokenizer.appendChild(p);
+		//String punct_paren_close = "$punct_paren_close1|$punct_paren_close2";
+		p = doc.createElement("param");
+		p.setAttribute("key","punct_paren_close");
+		p.setTextContent(punct_paren_close);
+		tokenizer.appendChild(p);
+		//String punct_paren = "$punct_paren_open|$punct_paren_close";
+		p = doc.createElement("param");
+		p.setAttribute("key","punct_paren");
+		p.setTextContent(punct_paren);
+		tokenizer.appendChild(p);
+		//String punct_weak = ",;∼ˆ·*:\"`'“”\\+±=/\\-≤≥<>\\—_ν√μ•@≈→αγ∞≡σ&¼½Θĩ†φθΓ§ẽə∈";
+		p = doc.createElement("param");
+		p.setAttribute("key","punct_weak");
+		p.setTextContent(punct_weak);
+		tokenizer.appendChild(p);
+		//String punct_all = "$punct_strong|$punct_paren|[$punct_weak]";
+		p = doc.createElement("param");
+		p.setAttribute("key","punct_all");
+		p.setTextContent(punct_all);
+		tokenizer.appendChild(p);
+		//String word_chars = "[^ $punct_strong1$punct_paren_open1$punct_paren_close1$punct_weak]|&[^;]+;";
+		p = doc.createElement("param");
+		p.setAttribute("key","word_chars");
+		p.setTextContent(word_chars);
+		tokenizer.appendChild(p);
+		//whitespaces = "[\\p{Z}\\p{C}]+";
+		p = doc.createElement("param");
+		p.setAttribute("key","whitespaces");
+		p.setTextContent(whitespaces);
+		tokenizer.appendChild(p);
+		//regElision = "['‘’]"
+		p = doc.createElement("param");
+		p.setAttribute("key","regElision");
+		p.setTextContent(regElision);
+		tokenizer.appendChild(p);
+		//regPunct = "[\\p{Ps}\\p{Pe}\\p{Pi}\\p{Pf}\\p{Po}\\p{S}]"
+		p = doc.createElement("param");
+		p.setAttribute("key","regPunct");
+		p.setTextContent(regPunct);
+		tokenizer.appendChild(p);
+	}
+
+	/**
+	 * Dump.
+	 */
+	public static void dump() {
+		System.out.println("BRUT");
+		System.out.println("tag_all = "+tag_all+"");
+		System.out.println("enclitics = "+enclitics+"");
+		System.out.println("encliticsFR = "+encliticsFR+"");
+		System.out.println("div_tags = "+div_tags+"");
+		System.out.println("q_tags = "+q_tags+"");
+		System.out.println("extraword1_tags = "+extraword1_tags+"");
+		System.out.println("corr_tags_no_seg = "+corr_tags_no_seg+"");
+		System.out.println("word_tags = "+word_tags+"");
+		System.out.println("intraword_tags = "+intraword_tags+"");
+		System.out.println("punct_quotes = "+punct_quotes+"");
+		System.out.println("punct_strong1 = "+punct_strong1+"");
+		System.out.println("punct_strong2 = "+punct_strong2+"");
+		System.out.println("punct_paren_open1 = "+punct_paren_open1+"");
+		System.out.println("punct_paren_open2 = "+punct_paren_open2+"");
+		System.out.println("punct_paren_close1 = "+punct_paren_close1+"");
+		System.out.println("punct_paren_close2 = "+punct_paren_close2+"");
+		System.out.println("punct_weak = "+punct_weak+"");
+		System.out.println("entity = "+entity+"");
+		System.out.println("seg_tags = "+seg_tags+"");
+		System.out.println("COMBINED");
+		System.out.println("corr_tags = "+corr_tags+"");
+		System.out.println("extraword_tags = "+extraword_tags+"");
+		System.out.println("punct_strong = "+punct_strong+"");
+		System.out.println("punct_paren_open = "+punct_paren_open+"");
+		System.out.println("punct_paren_close = "+punct_paren_close+"");
+		System.out.println("punct_paren = "+punct_paren+"");
+		System.out.println("punct_all = "+punct_all+"");
+		System.out.println("word_chars = "+word_chars+"");
+		System.out.println("whitespaces = "+whitespaces+"");
+		System.out.println("regElision = "+regElision+"");
+		System.out.println("regPunct = "+regPunct+"");
+		System.out.println("TESTS");
+		
+		for (TTest test : tests) {
+			System.out.println(" "+test+"");
+		}
+			
+	}
+
+	public static boolean isValid() {
+		try { Pattern.compile(tag_all); }
+		catch (Exception e) { System.out.println("tag_all="+tag_all+": "+e);return false; }
+
+		try { Pattern.compile(enclitics); }
+		catch (Exception e) { System.out.println("enclitics="+enclitics+": "+e);return false; }
+
+		try { Pattern.compile(encliticsFR); }
+		catch (Exception e) { System.out.println("encliticsFR="+encliticsFR+": "+e);return false; }
+
+		try { Pattern.compile(div_tags); }
+		catch (Exception e) { System.out.println("div_tags="+div_tags+": "+e);return false; }
+
+		try { Pattern.compile(q_tags); }
+		catch (Exception e) { System.out.println("q_tags="+q_tags+": "+e);return false; }
+
+		try { Pattern.compile(extraword1_tags); }
+		catch (Exception e) { System.out.println("extraword1_tags="+extraword1_tags+": "+e);return false; }
+
+		try { Pattern.compile(corr_tags_no_seg); }
+		catch (Exception e) { System.out.println("corr_tags_no_seg="+corr_tags_no_seg+": "+e);return false; }
+
+		try { Pattern.compile(word_tags); }
+		catch (Exception e) { System.out.println("word_tags="+word_tags+": "+e);return false; }
+
+		try { Pattern.compile(intraword_tags); }
+		catch (Exception e) { System.out.println("intraword_tags="+intraword_tags+": "+e);return false; }
+
+		try { Pattern.compile(punct_quotes); }
+		catch (Exception e) { System.out.println("punct_quotes="+punct_quotes+": "+e);return false; }
+
+		try { Pattern.compile(punct_strong1); }
+		catch (Exception e) { System.out.println("punct_strong1="+punct_strong1+": "+e);return false; }
+
+		try { Pattern.compile(punct_strong2); }
+		catch (Exception e) { System.out.println("punct_strong2="+punct_strong2+": "+e);return false; }
+
+		try { Pattern.compile(punct_paren_open1); }
+		catch (Exception e) { System.out.println("punct_paren_open1="+punct_paren_open1+": "+e);return false; }
+
+		try { Pattern.compile(punct_paren_open2); }
+		catch (Exception e) { System.out.println("punct_paren_open2="+punct_paren_open2+": "+e);return false; }
+
+		try { Pattern.compile(punct_paren_close1); }
+		catch (Exception e) { System.out.println("punct_paren_close1="+punct_paren_close1+": "+e);return false; }
+
+		try { Pattern.compile(punct_paren_close2); }
+		catch (Exception e) { System.out.println("punct_paren_close2="+punct_paren_close2+": "+e);return false; }
+
+		try { Pattern.compile(punct_weak); }
+		catch (Exception e) { System.out.println("punct_weak="+punct_weak+": "+e);return false; }
+
+		try { Pattern.compile(entity); }
+		catch (Exception e) { System.out.println("entity="+entity+": "+e);return false; }
+
+		try { Pattern.compile(seg_tags); }
+		catch (Exception e) { System.out.println("seg_tags="+seg_tags+": "+e);return false; }
+
+		try { Pattern.compile(corr_tags); }
+		catch (Exception e) { System.out.println("corr_tags: "+e);return false; }
+
+		try { 	Pattern.compile(extraword_tags); }
+		catch (Exception e) { System.out.println("extraword_tags: "+e);return false; }
+
+		if (punct_strong != null)
+		try { 	Pattern.compile(punct_strong); }
+		catch (Exception e) { System.out.println("punct_strong: "+e);return false; }
+
+		try { Pattern.compile(punct_paren_open); }
+		catch (Exception e) { System.out.println("punct_paren_open: "+e);return false; }
+
+		try { Pattern.compile(punct_paren_close); }
+		catch (Exception e) { System.out.println("punct_paren_close: "+e);return false; }
+
+		try { Pattern.compile(punct_paren); }
+		catch (Exception e) { System.out.println("punct_paren: "+e);return false; }
+
+		try { Pattern.compile(punct_all); }
+		catch (Exception e) { System.out.println("punct_all: "+e);return false; }
+
+		try { Pattern.compile(word_chars); }
+		catch (Exception e) { System.out.println("word_chars: "+e);return false; }
+		
+		if (regPunct != null)
+		try { Pattern.compile(regPunct); }
+		catch (Exception e) { System.out.println("regPunct="+regPunct+": "+e);return false; }
+
+		if (regElision != null)
+		try { Pattern.compile(regElision); }
+		catch (Exception e) { System.out.println("regElision="+regElision+": "+e);return false; }
+
+		if (whitespaces != null)
+		try { Pattern.compile(whitespaces); }
+		catch (Exception e) { System.out.println("whitespaces="+whitespaces+": "+e);return false; }
+
+		for(TTest test : tests) {
+			try { Pattern.compile(test.getRegex()); }
+			catch (Exception e) { System.out.println(""+test.getRegex()+": "+e);return false; }
+		}
+		return true;
+	}
+
+	public static boolean loadFromNode(Element tokenizerElement) {
+		//load params
+		String tmp_strong_punct = null;
+		NodeList params = tokenizerElement.getElementsByTagName("param");
+		for (int i = 0 ; i < params.getLength() ; i++) {
+			Element param = (Element) params.item(i);
+			String key = param.getAttribute("name");
+			String value = param.getAttribute("value");
+			if (value == null || value.length() == 0) value = param.getTextContent();
+			if (value.length() == 0) value = null;
+			
+			if (debug) System.out.println(" Tokenizer parametrized with "+key+"="+value+"");
+			
+			if (key == "tag_all")
+				tag_all = value;
+			else if (key == "enclitics")
+				enclitics = value;
+			else if (key == "encliticsFR")
+				encliticsFR = value;
+			else if (key == "div_tags")
+				div_tags = value;
+			else if (key == "q_tags")
+				q_tags = value;
+			else if (key == "extraword1_tags")
+				extraword1_tags = value;
+			else if (key == "corr_tags_no_seg")
+				corr_tags_no_seg = value;
+			else if (key == "word_tags")
+				word_tags = value;
+			else if (key == "intraword_tags")
+				intraword_tags = value;
+			else if (key == "punct_quotes")
+				punct_quotes = value;
+			else if (key == "punct_strong1")
+				punct_strong1 = value;
+			else if (key == "punct_strong2")
+				punct_strong2 = value;
+			else if (key == "punct_paren_open1")
+				punct_paren_open1 = value;
+			else if (key == "punct_paren_open2")
+				punct_paren_open2 = value;
+			else if (key == "punct_paren_close1")
+				punct_paren_close1 = value;
+			else if (key == "punct_paren_close2")
+				punct_paren_close2 = value;
+			else if (key == "punct_weak")
+				punct_weak = value;
+			else if (key == "entity")
+				entity = value;
+			else if (key == "seg_tags")
+				seg_tags = value;
+			else if (key == "regPunct")
+				regPunct = value;
+			else if (key == "regElision")
+				regElision = value;
+			else if (key == "whitespaces")
+				whitespaces = value;
+			else if (key == "punct_strong") // this is temporary
+				tmp_strong_punct = value; // this is temporary
+			else
+				System.out.println("MISSING TOKENIZER KEY: "+key);
+		}
+		//recombine
+		recombine();
+		if (tmp_strong_punct != null) punct_strong = tmp_strong_punct;  // this is temporary
+		
+		String shouldResetTests = tokenizerElement.getAttribute("onlyThoseTests");
+		if ("true".equals(shouldResetTests)) {
+			System.out.println("Warning: tokenizer only using import parameters tests");
+			//tests = new ArrayList<>();
+		}
+			
+		NodeList testsList = tokenizerElement.getElementsByTagName("test");
+		if (testsList.getLength() > 0) {
+			//System.out.println("Add "+testsList.getLength()+" tests to the tokenizer"
+			for (int i = 0 ; i < testsList.getLength() ; i++) {
+				Element test = (Element) testsList.item(i);
+//				tests.add(i, new TTest(test.getTextContent(), test.getAttribute("type"),
+//						Integer.parseInt(test.getAttribute("before")),
+//						Integer.parseInt(test.getAttribute("hit")),
+//						Integer.parseInt(test.getAttribute("after")))
+//						);
+			}
+			//System.out.println("Tests: "+tests);
+		}
+
+		if (isValid())
+			return true;
+		else {
+			reset();
+			recombine();
+			return false;
+		}
+	}
+
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 * @throws IOException 
+	 * @throws SAXException 
+	 * @throws ParserConfigurationException 
+	 */
+	public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException {
+
+		Document doc = DomUtils.load(new File("/home/mdecorde/xml/discours/import.xml"));
+		Node corpora = doc.getDocumentElement().getElementsByTagName("corpora").item(0);
+		Node corpus = ((Element)corpora).getElementsByTagName("corpus").item(0);
+		Node tokenizer = ((Element)corpus).getElementsByTagName("tokenizer").item(0);
+		System.out.println("OK? "+ TokenizerClasses.loadFromNode((Element) tokenizer));
+	}
+}
\ No newline at end of file
Index: tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/KRAnnotationEngine.java
===================================================================
--- tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/KRAnnotationEngine.java	(revision 926)
+++ tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/KRAnnotationEngine.java	(revision 927)
@@ -1,5 +1,6 @@
 package org.txm.annotation.kr.core;
 
+import java.io.File;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -300,4 +301,19 @@
 		
 		return success;
 	}
+
+	/**
+	 * The KR Annotation engine is an assisted oriented annotation engine
+	 * @return false
+	 */
+	@Override
+	public boolean isAutomatic() {
+		return false;
+	}
+
+	@Override
+	public boolean processFile(File xmlFile, File binaryCorpusDirectory, HashMap<String, Object> parameters) {
+		// TODO not implemented yet.
+		return false;
+	}
 }
Index: tmp/org.txm.setups/sudo
===================================================================
--- tmp/org.txm.setups/sudo	(revision 0)
+++ tmp/org.txm.setups/sudo	(revision 927)
@@ -0,0 +1 @@
+on /sys/bus/usb/devices/usb2/power/level
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/IImageKeys.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/IImageKeys.java	(revision 926)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/IImageKeys.java	(revision 927)
@@ -44,7 +44,7 @@
 public abstract class IImageKeys {
 
 	/** The images. */
-	private static HashMap<String, Image> images = new HashMap<String, Image>();
+	private final static HashMap<String, Image> images = new HashMap<String, Image>();
 	
 	/** The Constant ACTION_CONCORDANCES. */
 	public static final String ACTION_CONCORDANCES = "icons/functions/Concordances.png"; //$NON-NLS-1$
@@ -147,33 +147,22 @@
 	/** The Constant UNCHECKED. */
 	public static final String UNCHECKED = "icons/cross.png"; //$NON-NLS-1$
 
-
-
-
 	public static final String ACTION_INTERTEXTDIST = "icons/functions/dist.png"; //$NON-NLS-1$
 
-
 	public static final String QUERYINDEX = "icons/functions/QueryIndex.png"; //$NON-NLS-1$
 
-
 	public static final String COOCMATRIX = "icons/functions/graph.png"; //$NON-NLS-1$
 
-
 	public static final String ACTION_WORDCLOUD = "icons/functions/WordCloud.png"; //$NON-NLS-1$
 
-
 	public static final String CTRLSTART = "icons/control_start_blue.png"; //$NON-NLS-1$
 
-
 	public static final String CTRLREVERSE = "icons/control_reverse_blue.png"; //$NON-NLS-1$
 
-
 	public static final String CTRLPLAY = "icons/control_play_blue.png"; //$NON-NLS-1$
 
-
 	public static final String CTRLEND = "icons/control_end_blue.png"; //$NON-NLS-1$
 
-
 	public static final String CTRLFASTFORWARD = "icons/control_fastforward_blue.png"; //$NON-NLS-1$
 	
 	public static final String CTRLFASTFORWARDEND = "icons/control_fastforwardend_blue.png"; //$NON-NLS-1$
@@ -238,8 +227,6 @@
 	public static final String OPEN_DECORATOR = "icons/decorators/bullet_arrow_down.png";
 	public static final String CLOSE_DECORATOR = "icons/decorators/bullet_arrow_up.png";
 
-
-
 	/**
 	 * Gets the image.
 	 *
@@ -264,7 +251,7 @@
 	 * @param imageFilePath
 	 * @return
 	 */
-	public static Image getImage(Class classOfPlugin, String imageFilePath) {
+	public static Image getImage(Class<?> classOfPlugin, String imageFilePath) {
 		return getImage(FrameworkUtil.getBundle(classOfPlugin).getSymbolicName(), imageFilePath);
 	}
 	
@@ -275,10 +262,15 @@
 	 * @return
 	 */
 	public static Image getImage(String pluginId, String imagekey) {
-		if (!images.containsKey(imagekey))
-			images.put(imagekey, new Image(null, AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, imagekey).getImageData()));
+		if (!images.containsKey(imagekey)) {
+			ImageDescriptor imgg = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, imagekey);
+			if (imgg == null) {
+				System.out.println("Warning: image not found in '"+pluginId+"' -> '"+imagekey+"'");
+				return getImage("icons/null.png");
+			}
+
+			images.put(imagekey, new Image(null, imgg.getImageData()));
+		}
 		return images.get(imagekey);
 	}
-	
-	
 }
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java	(revision 926)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java	(revision 927)
@@ -581,7 +581,6 @@
 				//					previousProperties.load(reader);
 				//					String [] keys= {TBXPreferences.TREETAGGER_INSTALL_PATH,
 				//							TBXPreferences.TREETAGGER_MODELS_PATH,
-				//							TBXPreferences.TREETAGGER_APOSTROPHE,
 				//							TBXPreferences.TREETAGGER_OPTIONS};
 				//					for (String k : keys) {
 				//						if (previousProperties.getProperty(k) != null) {
@@ -821,6 +820,9 @@
 			Log.info(TXMUIMessages.ApplicationWorkbenchAdvisor_11);
 			monitor.setTaskName(TXMUIMessages.ApplicationWorkbenchAdvisor_11);
 			//File corporaDir = new File(txmhomedir.getAbsolutePath(), "corpora"); //$NON-NLS-1$
+			if (txmhomedir == null) {
+				txmhomedir = new File(TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE).trim());
+			}
 			corporaDir = new File(txmhomedir, "corpora"); //$NON-NLS-1$
 			corporaDir.mkdir();
 
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteGroovyScript.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteGroovyScript.java	(revision 926)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteGroovyScript.java	(revision 927)
@@ -210,7 +210,6 @@
 //			//System.out.println("SCRIPT ROOT DIR CHANGED tmp="+tmp);
 //		}
 
-		String scriptsRootDirectories = Toolbox.getTxmHomePath() + "/scripts";
 		String dir = currentRootDir.getAbsolutePath();
 		String path = scriptfile.getAbsolutePath();
 		if (!path.startsWith(dir)) {
@@ -220,7 +219,7 @@
 		final String relativepath = path.substring(dir.length()+1);
 
 		//if (gse == null) {
-			gse = GSERunner.buildDefaultGSE(scriptsRootDirectories, scriptfile);
+			gse = GSERunner.buildDefaultGSE(scriptfile);
 			if (gse == null) {
 				System.out.println("Could not create the Groovy script engine. Aborting.");
 				return;
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteImportScript.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteImportScript.java	(revision 926)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteImportScript.java	(revision 927)
@@ -50,7 +50,9 @@
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.Toolbox;
+import org.txm.annotation.core.AnnotationEngine;
 import org.txm.Toolbox;
+import org.txm.core.engines.Engine;
 import org.txm.core.engines.EngineType;
 import org.txm.core.preferences.TBXPreferences;
 import org.txm.importer.ImportKeys;
@@ -159,23 +161,23 @@
 			Log.severe(TXMUIMessages.ExecuteScriptImport_2+corporadir);
 			return null;
 		}
-
-		// groovy configuration
-		IPreferencesService service = Platform.getPreferencesService();
-		final String scriptRootDir = service.getString(Application.PLUGIN_ID,
-				TBXPreferences.USER_TXM_HOME+"/scripts",
-				"", null);
 		
-//		ClassLoader parent = ExecuteImportScript.class.getClassLoader();
-//		final GroovyClassLoader loader = new GroovyClassLoader(parent);
-//		final String[] roots = new String[] { 
-//				scriptRootDir,
-//				scriptRootDir+"/user/", //$NON-NLS-1$
-//				scriptRootDir+"/macro/", //$NON-NLS-1$
-//				script.getParent(),
-//				};
+		params.load(); // reload params
 		
-		params.load(); // reload params
+		// check if TreeTagger if ready
+		boolean annotate = "true" == params.getCorpusElement().getAttribute("annotate");
+		if (annotate) {
+			Engine e = Toolbox.getEngineManager(EngineType.ANNOTATION).getEngine("TreeTagger");
+			if (e == null) {
+				System.out.println("Error: no TreeTagger annotation engine found to annotate the corpus. Aborting");
+				return null;
+			}
+			AnnotationEngine engine = (AnnotationEngine) e;
+			if (!engine.isRunning()) {
+				System.out.println("Error: TreeTagger annotation engine is not ready please check TXM > Advance > TAL > TreeTagger preferences. Aborting");
+				return null;
+			}
+		}
 
 		// the binary directory which is going to be created
 
@@ -221,9 +223,8 @@
 					monitor.worked(5);
 
 					//				if (ExecuteImportScript.gse == null)
-					ExecuteImportScript.gse = GSERunner.buildDefaultGSE(scriptRootDir, script);
+					ExecuteImportScript.gse = GSERunner.buildDefaultGSE(script);
 					
-
 					Binding binding = new Binding();
 					binding.setProperty("paramsBinding", p); //$NON-NLS-1$
 					binding.setProperty("monitor", this); //$NON-NLS-1$
@@ -268,6 +269,7 @@
 							Toolbox.workspace.save();
 							
 							Log.info("Restart Toolbox search engine"); //$NON-NLS-1$
+							Toolbox.restartWorkspace(null);
 							Toolbox.getEngineManager(EngineType.SEARCH).restartEngines();
 							final Base base2 = base;
 							syncExec(new Runnable() {
@@ -296,6 +298,7 @@
 				} finally {
 					if (!CQPSearchEngine.isInitialized()) { // the import failed
 						monitor.setTaskName("Restarting Toolbox search engine"); //$NON-NLS-1$
+						Toolbox.restartWorkspace(this);
 						Toolbox.getEngineManager(EngineType.SEARCH).restartEngines();
 						
 						syncExec(new Runnable() {
@@ -332,7 +335,7 @@
 		int idx = scriptPackage.indexOf("Loader");
 		scriptPackage = "org/txm/importer/" + scriptPackage.substring(0, idx);
 		
-		return BundleUtils.replaceFilesIfNewer("org.txm.core", "src", scriptPackage, 
+		return BundleUtils.replaceFilesIfNewer("org.txm.groovy.core", "src/groovy", scriptPackage, 
 				script.getName(), script);
 	}
 }
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/GSERunner.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/GSERunner.java	(revision 926)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/GSERunner.java	(revision 927)
@@ -21,9 +21,12 @@
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.wiring.BundleWiring;
 import org.txm.Toolbox;
+import org.txm.core.preferences.TBXPreferences;
 import org.txm.rcp.TXMClassLoader;
 import org.txm.utils.logger.Log;
 
+import cern.colt.Arrays;
+
 /**
  * gse wrapper for TXM scripts and macros
  * 
@@ -51,7 +54,8 @@
 	 * @param script
 	 * @return
 	 */
-	public static GSERunner buildDefaultGSE(String scriptRootDir, File script) {
+	public static GSERunner buildDefaultGSE(File script) {
+		String scriptRootDir = Toolbox.getPreference(TBXPreferences.USER_TXM_HOME)+"/scripts";
 		if (defaultScriptRootDir.equals(scriptRootDir) &&  defaultGSE != null) {
 			try {
 				defaultGSE.getGroovyClassLoader().addURL(new URL("file://"+script.getParent()));
@@ -74,6 +78,7 @@
 
 		try {
 			defaultScriptRootDir = scriptRootDir;
+			Log.info("GSE roots: "+Arrays.toString(roots));
 			defaultGSE = new GSERunner(roots);
 		} catch (IOException e) {
 			e.printStackTrace();
Index: tmp/org.txm.rcp/build.properties
===================================================================
--- tmp/org.txm.rcp/build.properties	(revision 926)
+++ tmp/org.txm.rcp/build.properties	(revision 927)
@@ -12,11 +12,11 @@
                lib/commons-lang-2.4.jar,\
                lib/junit-4.5.jar,\
                lib/log4j-1.2.12.jar,\
-               icons/,\
                installtreetagger_en.html,\
                css/,\
                p2.inf,\
                bin/,\
                OSGI-INF/,\
-               TXM.sh
+               TXM.sh,\
+               icons/
 bin.excludes = lib/batik/
Index: tmp/org.txm.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.rcp/META-INF/MANIFEST.MF	(revision 926)
+++ tmp/org.txm.rcp/META-INF/MANIFEST.MF	(revision 927)
@@ -32,7 +32,8 @@
  org.txm.tokenizer.core;bundle-version="1.0.0";visibility:=reexport,
  org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport,
  org.txm.statsengine.core,
- org.eclipse.ui.themes;bundle-version="1.2.1"
+ org.eclipse.ui.themes;bundle-version="1.2.1",
+ org.txm.annotation.core
 Export-Package: junit.extensions,
  junit.framework,
  junit.runner,
Index: tmp/org.txm.rcp/icons/null.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.rcp/icons/null.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.utils/src/org/txm/utils/treetagger/TreeTagger.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/treetagger/TreeTagger.java	(revision 926)
+++ tmp/org.txm.utils/src/org/txm/utils/treetagger/TreeTagger.java	(revision 927)
@@ -849,4 +849,8 @@
 	public static void main(String[] args) {
 
 	}
+
+	public void kill() {
+		//TODO uses TreeTagger4j and manage the process
+	}
 }
\ No newline at end of file
Index: tmp/org.txm.utils/src/org/txm/utils/io/IOUtils.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/io/IOUtils.java	(revision 926)
+++ tmp/org.txm.utils/src/org/txm/utils/io/IOUtils.java	(revision 927)
@@ -83,6 +83,12 @@
 		return new BufferedReader(new InputStreamReader(inputStream , "UTF-8")); //$NON-NLS-1$
 	}
 
+	public static void setText(File file, String text, String encoding) throws IOException {
+		PrintWriter writer = getWriter(file, encoding);
+		writer.print(text);
+		writer.close();
+	}
+	
 	public static String getText(URL url, String encoding) throws IOException {
 		BufferedReader reader = getReader(url, encoding);
 		StringBuilder builder = new StringBuilder();
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/Match.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/Match.java	(revision 926)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/Match.java	(revision 927)
@@ -27,13 +27,12 @@
 //
 package org.txm.searchengine.cqp.corpus.query;
 
-import groovy.lang.IntRange;
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 
+import org.apache.commons.lang.math.IntRange;
 import org.txm.searchengine.cqp.AbstractCqiClient;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.corpus.CorpusManager;
@@ -275,8 +274,10 @@
 		return (end - start);
 	}
 
-	public Collection<? extends Integer> getRange() {
-		return new IntRange(start, end);
+	public List<Integer> getRange() {
+		List<Integer> ret = new ArrayList<Integer>(end-start);
+		for (int i = start ; i < end; i++) ret.add(i);
+		return ret;
 	}
 
 	public void setEnd(int p) {
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java	(revision 926)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java	(revision 927)
@@ -43,6 +43,7 @@
 	 *
 	 * @return true, if successful
 	 */
+	@Override
 	public boolean start(IProgressMonitor monitor) throws Exception {
 
 		if (monitor != null) monitor.subTask("Starting Corpus Engine...");
@@ -282,6 +283,7 @@
 	/**
 	 * Shut the toolbox searchengine down.
 	 */
+	@Override
 	public boolean stop() {
 		try {
 			if (cqiClient instanceof MemCqiClient) {
Index: tmp/org.txm.para.core/src/org/txm/para/core/functions/ParallelContexts.java
===================================================================
--- tmp/org.txm.para.core/src/org/txm/para/core/functions/ParallelContexts.java	(revision 926)
+++ tmp/org.txm.para.core/src/org/txm/para/core/functions/ParallelContexts.java	(revision 927)
@@ -1,7 +1,5 @@
 package org.txm.para.core.functions;
 
-import groovy.lang.IntRange;
-
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -9,6 +7,7 @@
 import java.util.LinkedHashMap;
 import java.util.List;
 
+import org.apache.commons.lang.math.IntRange;
 import org.txm.Toolbox;
 import org.txm.searchengine.cqp.AbstractCqiClient;
 import org.txm.searchengine.cqp.CQPSearchEngine;
@@ -184,7 +183,7 @@
 				//System.out.println("seg matches: "+matches);
 				ArrayList<Integer> positions = new ArrayList<Integer>();
 				for (Match m : matches) {
-					groovy.lang.IntRange range = (IntRange) m.getRange();
+					List<Integer> range = m.getRange();
 
 					int minpos = range.get(0);
 					int maxpos = range.get(range.size()-1);
