Index: TXM/trunk/bundles/org.txm.nlp.core/.classpath
===================================================================
--- TXM/trunk/bundles/org.txm.nlp.core/.classpath	(revision 0)
+++ TXM/trunk/bundles/org.txm.nlp.core/.classpath	(revision 4020)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
Index: TXM/trunk/bundles/org.txm.nlp.core/META-INF/MANIFEST.MF
===================================================================
--- TXM/trunk/bundles/org.txm.nlp.core/META-INF/MANIFEST.MF	(revision 0)
+++ TXM/trunk/bundles/org.txm.nlp.core/META-INF/MANIFEST.MF	(revision 4020)
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.txm.nlp.core
+Bundle-SymbolicName: org.txm.nlp.core;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Export-Package: org.txm.nlp.core
+Require-Bundle: org.txm.core;bundle-version="0.8.3";visibility:=reexport
+Automatic-Module-Name: org.txm.nlp.core
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Index: TXM/trunk/bundles/org.txm.nlp.core/schema/org.txm.nlp.core.NLPEngine.exsd
===================================================================
--- TXM/trunk/bundles/org.txm.nlp.core/schema/org.txm.nlp.core.NLPEngine.exsd	(revision 0)
+++ TXM/trunk/bundles/org.txm.nlp.core/schema/org.txm.nlp.core.NLPEngine.exsd	(revision 4020)
@@ -0,0 +1,109 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.txm.nlp.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appinfo>
+         <meta.schema plugin="org.txm.nlp.core" id="org.txm.nlp.core.NLPEngine" name="org.txm.nlp.core.NLPEngine"/>
+      </appinfo>
+      <documentation>
+         [Enter description of this extension point.]
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element />
+         </appinfo>
+      </annotation>
+      <complexType>
+         <choice>
+            <element ref="NLPEngine"/>
+         </choice>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute translatable="true"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="NLPEngine">
+      <complexType>
+         <attribute name="class" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="java" basedOn="org.txm.nlp.core.NLPEngine:"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+         <attribute name="description" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="since"/>
+      </appinfo>
+      <documentation>
+         [Enter the first release in which this extension point appears.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="examples"/>
+      </appinfo>
+      <documentation>
+         [Enter extension point usage example here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="apiinfo"/>
+      </appinfo>
+      <documentation>
+         [Enter API information here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="implementation"/>
+      </appinfo>
+      <documentation>
+         [Enter information about supplied implementation of this extension point.]
+      </documentation>
+   </annotation>
+
+
+</schema>
Index: TXM/trunk/bundles/org.txm.nlp.core/.project
===================================================================
--- TXM/trunk/bundles/org.txm.nlp.core/.project	(revision 0)
+++ TXM/trunk/bundles/org.txm.nlp.core/.project	(revision 4020)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.nlp.core</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: TXM/trunk/bundles/org.txm.nlp.core/src/org/txm/nlp/core/NLPEngine.java
===================================================================
--- TXM/trunk/bundles/org.txm.nlp.core/src/org/txm/nlp/core/NLPEngine.java	(revision 0)
+++ TXM/trunk/bundles/org.txm.nlp.core/src/org/txm/nlp/core/NLPEngine.java	(revision 4020)
@@ -0,0 +1,90 @@
+package org.txm.nlp.core;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.util.HashMap;
+
+import org.eclipse.osgi.util.NLS;
+import org.txm.core.engines.Engine;
+import org.txm.core.results.TXMResult;
+import org.txm.tokenizer.StringTokenizer;
+import org.txm.utils.ConsoleProgressBar;
+import org.txm.utils.DeleteDir;
+import org.txm.utils.logger.Log;
+
+public abstract class NLPEngine implements Engine {
+	
+	public static final String EXTENSION_POINT_ID = NLPEngine.class.getCanonicalName();
+	
+	@Override
+	public abstract String getName();
+	
+
+	/**
+	 * 
+	 * @return a StringTokenizer, override this method if the engine needs a speciq tokenization
+	 * @throws Exception
+	 */
+	public StringTokenizer getStringTokenizer(String lang) throws Exception {
+		return null;
+	}
+	
+	/**
+	 * Automatically annotate a XML-TXM file
+	 * 
+	 * @param xmlFile to annotate
+	 * @param binaryCorpusDirectory
+	 * @param parameters
+	 * @return
+	 */
+	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"); //$NON-NLS-1$ //$NON-NLS-2$
+			}
+		});
+		if (files == null || files.length == 0) {
+			Log.warning(NLS.bind(Messages.ErrorNoSuitableFileToProcessInP0, xmlFilesDirectory));
+			return false;
+		}
+		boolean ret = true;
+		ConsoleProgressBar cpb = new ConsoleProgressBar(files.length);
+		
+		File annotDir = new File(binaryCorpusDirectory, "annotations"); //$NON-NLS-1$
+		DeleteDir.deleteDirectory(annotDir);
+		annotDir.mkdir();
+		File ptreetaggerDir = new File(binaryCorpusDirectory, "ptreetagger"); //$NON-NLS-1$
+		DeleteDir.deleteDirectory(ptreetaggerDir);
+		ptreetaggerDir.mkdir();
+		File treetaggerDir = new File(binaryCorpusDirectory, "treetagger"); //$NON-NLS-1$
+		DeleteDir.deleteDirectory(treetaggerDir);
+		treetaggerDir.mkdir();
+		
+		for (File xmlFile : files) {
+			ret = processFile(xmlFile, binaryCorpusDirectory, parameters) && ret;
+			
+			cpb.tick();
+		}
+		cpb.done();
+		return ret;
+	}
+	
+	public String hasAdditionalDetailsForResult(TXMResult result) {
+		return null;
+	}
+	
+	public String getAdditionalDetailsForResult(TXMResult result) {
+		return null;
+	}
+}
Index: TXM/trunk/bundles/org.txm.nlp.core/src/org/txm/nlp/core/messages.properties
===================================================================
--- TXM/trunk/bundles/org.txm.nlp.core/src/org/txm/nlp/core/messages.properties	(revision 0)
+++ TXM/trunk/bundles/org.txm.nlp.core/src/org/txm/nlp/core/messages.properties	(revision 4020)
@@ -0,0 +1,4 @@
+NLPEnginesManager_ErrorFailedToStopNLPEngineP0P1=Error: failed to stop the ''{0}'' NLP engine: {1}.
+NLPEnginesManager_FailToInitializeTheP0NLPEngine=Fail to initialize the {0} NLP engine.
+NLPEnginesManager_FailToInstanciateP0P1=Fail to instanciate {0}: {1}.
+ErrorNoSuitableFileToProcessInP0=Error: no suitable file to process in {0}.
Index: TXM/trunk/bundles/org.txm.nlp.core/src/org/txm/nlp/core/Messages.java
===================================================================
--- TXM/trunk/bundles/org.txm.nlp.core/src/org/txm/nlp/core/Messages.java	(revision 0)
+++ TXM/trunk/bundles/org.txm.nlp.core/src/org/txm/nlp/core/Messages.java	(revision 4020)
@@ -0,0 +1,19 @@
+package org.txm.nlp.core;
+
+import org.eclipse.osgi.util.NLS;
+import org.txm.utils.messages.Utf8NLS;
+
+public class Messages extends NLS {
+
+	public static String ErrorFailedToStopNLPEngineP0P1;
+	public static String FailToInitializeTheP0NLPEngine;
+	public static String FailToInstanciateP0P1;
+	public static String ErrorNoSuitableFileToProcessInP0;
+	
+	static {
+		// initialize resource bundle
+		Utf8NLS.initializeMessages(Messages.class);
+	}
+
+	private Messages() { }
+}
Index: TXM/trunk/bundles/org.txm.nlp.core/src/org/txm/nlp/core/messages_fr.properties
===================================================================
--- TXM/trunk/bundles/org.txm.nlp.core/src/org/txm/nlp/core/messages_fr.properties	(revision 0)
+++ TXM/trunk/bundles/org.txm.nlp.core/src/org/txm/nlp/core/messages_fr.properties	(revision 4020)
@@ -0,0 +1,4 @@
+NLPEnginesManager_ErrorFailedToStopNLPEngineP0P1=Échec lors de l''arrête du moteur TAL ''{0}'' : {1}
+NLPEnginesManager_FailToInitializeTheP0NLPEngine=Échec lors de l''initialisation du moteur TAL {0}.
+NLPEnginesManager_FailToInstanciateP0P1=Échec de l'instanciation de {0} : {1}.
+ErrorNoSuitableFileToProcessInP0=Erreur: pas de fichier à traiter dans {0}.
Index: TXM/trunk/bundles/org.txm.nlp.core/src/org/txm/nlp/core/NLPEnginesManager.java
===================================================================
--- TXM/trunk/bundles/org.txm.nlp.core/src/org/txm/nlp/core/NLPEnginesManager.java	(revision 0)
+++ TXM/trunk/bundles/org.txm.nlp.core/src/org/txm/nlp/core/NLPEnginesManager.java	(revision 4020)
@@ -0,0 +1,88 @@
+package org.txm.nlp.core;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.osgi.util.NLS;
+import org.txm.core.engines.EngineType;
+import org.txm.core.engines.EnginesManager;
+import org.txm.utils.logger.Log;
+
+
+/**
+ * 
+ * @author mdecorde
+ **/
+public class NLPEnginesManager extends EnginesManager<NLPEngine> {
+	
+	private static final long serialVersionUID = -6288338617609951960L;
+
+	public NLPEnginesManager() {
+		
+	}
+	
+	@Override
+	public boolean startEngines(IProgressMonitor monitor) {
+		
+		for (NLPEngine e : values()) {
+			
+			// lazy mode
+			
+			// NLPEngine se = (NLPEngine)e;
+			// if (monitor != null) monitor.subTask("Starting "+ se.getName()+" annotation engine.");
+			// try {
+			// se.start(monitor);
+			// } catch (Exception ex) {
+			// System.out.println("Error: failed to start annotation engine: "+se.getName()+": "+ex.getLocalizedMessage());
+			// }
+		}
+		return true;
+	}
+	
+	
+	@Override
+	public boolean stopEngines() {
+		for (NLPEngine e : values()) {
+			// System.out.println(e);
+			NLPEngine se = e;
+			Log.fine("Stoping " + se.getName() + " annotation engine."); //$NON-NLS-1$ //$NON-NLS-2$
+			try {
+				se.stop();
+			}
+			catch (Exception ex) {
+				Log.severe(NLS.bind(Messages.ErrorFailedToStopNLPEngineP0P1, se.getName(), ex.getLocalizedMessage()));
+			}
+		}
+		return true;
+	}
+	
+	@Override
+	public EngineType getEnginesType() {
+		return EngineType.NLP;
+	}
+	
+	@Override
+	public boolean fetchEngines() {
+		
+		IConfigurationElement[] contributions = Platform.getExtensionRegistry().getConfigurationElementsFor(NLPEngine.EXTENSION_POINT_ID);
+		// System.out.println("search engine contributions: "+SearchEngine.EXTENSION_POINT_ID);
+		for (int i = 0; i < contributions.length; i++) {
+			try {
+				NLPEngine e = (NLPEngine) contributions[i].createExecutableExtension("class"); //$NON-NLS-1$
+				if (e.initialize()) {
+					put(e.getName(), e);
+				}
+				else {
+					Log.warning(NLS.bind(Messages.FailToInitializeTheP0NLPEngine, e.getName()));
+				}
+			}
+			catch (Exception e) {
+				Log.warning(NLS.bind(Messages.FailToInstanciateP0P1, contributions[i].getName(), e.getLocalizedMessage()));
+				Log.printStackTrace(e);
+			}
+		}
+		
+		return size() > 0;
+	}
+
+}
Index: TXM/trunk/bundles/org.txm.nlp.core/bin/org/txm/nlp/core/NLPEngine.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: TXM/trunk/bundles/org.txm.nlp.core/bin/org/txm/nlp/core/NLPEngine.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: TXM/trunk/bundles/org.txm.nlp.core/bin/org/txm/nlp/core/NLPEngine$1.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: TXM/trunk/bundles/org.txm.nlp.core/bin/org/txm/nlp/core/NLPEngine$1.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: TXM/trunk/bundles/org.txm.nlp.core/bin/org/txm/nlp/core/messages_fr.properties
===================================================================
--- TXM/trunk/bundles/org.txm.nlp.core/bin/org/txm/nlp/core/messages_fr.properties	(revision 0)
+++ TXM/trunk/bundles/org.txm.nlp.core/bin/org/txm/nlp/core/messages_fr.properties	(revision 4020)
@@ -0,0 +1,4 @@
+NLPEnginesManager_ErrorFailedToStopNLPEngineP0P1=Échec lors de l''arrête du moteur TAL ''{0}'' : {1}
+NLPEnginesManager_FailToInitializeTheP0NLPEngine=Échec lors de l''initialisation du moteur TAL {0}.
+NLPEnginesManager_FailToInstanciateP0P1=Échec de l'instanciation de {0} : {1}.
+ErrorNoSuitableFileToProcessInP0=Erreur: pas de fichier à traiter dans {0}.
Index: TXM/trunk/bundles/org.txm.nlp.core/bin/org/txm/nlp/core/Messages.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: TXM/trunk/bundles/org.txm.nlp.core/bin/org/txm/nlp/core/Messages.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: TXM/trunk/bundles/org.txm.nlp.core/bin/org/txm/nlp/core/NLPEnginesManager.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: TXM/trunk/bundles/org.txm.nlp.core/bin/org/txm/nlp/core/NLPEnginesManager.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: TXM/trunk/bundles/org.txm.nlp.core/bin/org/txm/nlp/core/messages.properties
===================================================================
--- TXM/trunk/bundles/org.txm.nlp.core/bin/org/txm/nlp/core/messages.properties	(revision 0)
+++ TXM/trunk/bundles/org.txm.nlp.core/bin/org/txm/nlp/core/messages.properties	(revision 4020)
@@ -0,0 +1,4 @@
+NLPEnginesManager_ErrorFailedToStopNLPEngineP0P1=Error: failed to stop the ''{0}'' NLP engine: {1}.
+NLPEnginesManager_FailToInitializeTheP0NLPEngine=Fail to initialize the {0} NLP engine.
+NLPEnginesManager_FailToInstanciateP0P1=Fail to instanciate {0}: {1}.
+ErrorNoSuitableFileToProcessInP0=Error: no suitable file to process in {0}.
Index: TXM/trunk/bundles/org.txm.nlp.core/build.properties
===================================================================
--- TXM/trunk/bundles/org.txm.nlp.core/build.properties	(revision 0)
+++ TXM/trunk/bundles/org.txm.nlp.core/build.properties	(revision 4020)
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml
Index: TXM/trunk/bundles/org.txm.nlp.core/plugin.xml
===================================================================
--- TXM/trunk/bundles/org.txm.nlp.core/plugin.xml	(revision 0)
+++ TXM/trunk/bundles/org.txm.nlp.core/plugin.xml	(revision 4020)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension-point id="org.txm.nlp.core.NLPEngine" name="org.txm.nlp.core.NLPEngine" schema="schema/org.txm.nlp.core.NLPEngine.exsd"/>
+   <extension
+         point="org.txm.core.engines.EnginesManager">
+      <EngineManager
+            class="org.txm.nlp.core.NLPEnginesManager"
+            description="NLP engines manager"
+            name="NLP">
+      </EngineManager>
+   </extension>
+
+</plugin>
Index: TXM/trunk/bundles/org.txm.nlp.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- TXM/trunk/bundles/org.txm.nlp.core/.settings/org.eclipse.jdt.core.prefs	(revision 0)
+++ TXM/trunk/bundles/org.txm.nlp.core/.settings/org.eclipse.jdt.core.prefs	(revision 4020)
@@ -0,0 +1,9 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=17
Index: TXM/trunk/bundles/org.txm.nlp.core/.settings/org.eclipse.core.resources.prefs
===================================================================
--- TXM/trunk/bundles/org.txm.nlp.core/.settings/org.eclipse.core.resources.prefs	(revision 0)
+++ TXM/trunk/bundles/org.txm.nlp.core/.settings/org.eclipse.core.resources.prefs	(revision 4020)
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
