Index: tmp/org.txm.core/src/java/org/txm/scripts/importer/SAttributesListener.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/scripts/importer/SAttributesListener.groovy	(revision 2786)
+++ tmp/org.txm.core/src/java/org/txm/scripts/importer/SAttributesListener.groovy	(revision 2787)
@@ -1,220 +0,0 @@
-package org.txm.scripts.importer
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import javax.xml.stream.*;
-
-import org.txm.utils.io.IOUtils
-
-/**
- * Read an XML file and find out : XML elements, their attributes and recursivity level
- * names are lowercases
- * 
- * @author mdecorde
- *
- */
-class SAttributesListener {
-
-	private static HashMap<String,ArrayList<String>> structs = new HashMap<String, ArrayList<String>>();
-	private static HashMap<String, Integer> structsCountProf = new HashMap<String, Integer>();
-	private static HashMap<String, Integer> structsMaxProf = new HashMap<String, Integer>();
-	private static String structPath = "/";
-	private XMLStreamReader parser;
-
-	SAttributesListener() {
-		structs = new HashMap<String, ArrayList<String>>();
-		structsCountProf = new HashMap<String, Integer>();
-		structsMaxProf = new HashMap<String, Integer>();
-		structPath = "/";
-	}
-	
-	SAttributesListener(XMLStreamReader parser) {
-		this();
-		this.parser = parser;
-	}
-	
-	public void appendResultsTo(SAttributesListener another) {
-		structs = another.structs;
-		structsCountProf = another.structsCountProf;
-		structsMaxProf = another.structsMaxProf;
-	}
-
-	public void start(def parser) {
-		this.parser = parser;
-	}
-
-	def W = "w";
-	def ANA = "ana";
-	def FORM = "form";
-	/**
-	 * Call this method for each START_ELEMENT stax event
-	 * @param localname the element localname
-	 */
-	public void startElement(String localname) {
-		localname = localname.toLowerCase();
-
-		//String localname = parser.getLocalName();
-		if(localname.equals(W)) return;
-		if(localname.equals(ANA)) return;
-		if(localname.equals(FORM)) return;
-
-		structPath += localname+"/"
-		//println "add: "+structPath
-		def attrs = structs.get(localname)
-		if (!structs.containsKey(localname)) {
-			attrs = new HashSet();
-			structs.put(localname, attrs);
-			structsCountProf.put(localname, 0)
-			structsMaxProf.put(localname, 0)
-		} //else {
-		
-		// get structure recursion
-		int prof = structsCountProf.get(localname)+1
-		structsCountProf.put(localname, prof)
-		if (structsMaxProf.get(localname) < prof )
-			structsMaxProf.put(localname, prof)
-		
-		// get the structure attributes
-		for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
-			attrs << parser.getAttributeLocalName(i).toLowerCase();
-		}
-	}
-
-	/**
-	 * Call this method for each END_ELEMENT stax event
-	 * @param localname the element localname
-	 */
-	public void endElement(String localname) {
-		localname = localname.toLowerCase();
-		//String localname = parser.getLocalName();
-		if(localname.equals(W)) return;
-		if(localname.equals(ANA)) return;
-		if(localname.equals(FORM)) return;
-
-		if (structPath.length() > 1) {
-			int idx = structPath.lastIndexOf("/");
-			if (idx > 0) {
-				structPath = structPath.substring(0, idx)
-				//println "end of $localname "+(structsCountProf.get(localname))
-				//if (structsCountProf.get(localname) != null)
-				structsCountProf.put(localname, structsCountProf.get(localname)-1)
-			}
-			//println "pop: "+structPath
-		}
-	}
-
-	boolean firstGetStructs = true;
-	public HashMap<String,ArrayList<String>> getStructs() {
-		if (structsCountProf.get("div") > 0)
-			structs.remove("div1")
-		if (structsCountProf.get("div") > 1)
-			structs.remove("div2")
-		if (structsCountProf.get("div") > 2)
-			structs.remove("div3")
-		if (structsCountProf.get("div") > 3)
-			structs.remove("div4")
-		if (structsCountProf.get("div") > 4)
-			structs.remove("div5")
-		if (structsCountProf.get("div") > 5)
-			structs.remove("div6")
-
-		if (firstGetStructs) {
-			firstGetStructs = false;
-			def keys = []
-			keys.addAll(structs.keySet());
-			for( String key : keys) {
-				def value = structs.get(key);
-				structs.remove(key)
-				structs.put(key.toLowerCase(), value);
-			}
-		}
-
-		return structs;
-	}
-
-	boolean firstGetstructsCountProf = true;
-	public HashMap<String, Integer> getProfs() {
-
-		//		if (firstGetstructsCountProf) {
-		//			firstGetstructsCountProf = false;
-		//			def keys = []
-		//			keys.addAll(structsCountProf.keySet());
-		//			for( String key : keys) {
-		//				def value = structsCountProf.get(key);
-		//				structsCountProf.remove(key)
-		//				structsCountProf.put(key.toLowerCase(), value);
-		//			}
-		//		}
-		HashMap<String, Integer> clone = new HashMap<String, Integer>();
-		for (String key : structsMaxProf.keySet()) {
-			if (structsMaxProf.get(key) > 0)
-				clone.put(key, structsMaxProf.get(key)-1)
-			else
-				clone.put(key, 0)
-		}
-		return clone;
-	}
-	
-	public static SAttributesListener scanFile(File xmlFile) {
-		return scanFile(xmlFile, null)
-	}
-	
-	public void setParser(def parser) {
-		this.parser = parser;
-	}
-	
-	/**
-	 * Merge results in the parentListener
-	 * 
-	 * @param xmlFile
-	 * @param parentListener results are appended to the parentListener if any
-	 * @return
-	 */
-	public static SAttributesListener scanFile(File xmlFile, SAttributesListener parentListener) {
-		
-		def start = false;
-		def inputData = xmlFile.toURI().toURL().openStream();
-		def factory = XMLInputFactory.newInstance();
-		def parser = factory.createXMLStreamReader(inputData);
-		
-		SAttributesListener listener;
-		if (parentListener != null) {
-			listener = parentListener;
-			listener.setParser(parser)
-		} else {
-			listener = new SAttributesListener(parser);
-		}
-		String TEXT = "text";
-		//HashSet<String> types = new HashSet<String>();
-		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
-			if (event == XMLStreamConstants.START_ELEMENT) { // start elem
-				if (TEXT.equals(parser.getLocalName())) start = true;
-				if (start) listener.startElement(parser.getLocalName())
-			} else if (event == XMLStreamConstants.END_ELEMENT) { // end elem
-				if (start) listener.endElement(parser.getLocalName())
-				if (TEXT.equals(parser.getLocalName())) start = false;
-			}
-		}
-		if (parser != null) parser.close();
-		if (inputData != null) inputData.close();
-		
-		return listener
-	}
-	
-	public static SAttributesListener scanFiles(File xmlDirectory, String wordTag) {
-		SAttributesListener listener = new SAttributesListener()
-		listener.W = wordTag
-		for (File xmlFile : xmlDirectory.listFiles(IOUtils.HIDDENFILE_FILTER)) {
-			if (xmlFile.isFile() && !xmlFile.isHidden() && xmlFile.getName().toLowerCase().endsWith(".xml")) {
-				scanFile(xmlFile, listener); // results saved in 'listener' data
-//				println "LISTENER RESULT with ${xmlFile.getName()}: "+listener
-//				println " prof: "+listener.getStructs()
-//				println " prof: "+listener.getProfs()
-//				println " path: "+listener.structPath
-			}
-		}
-		
-		return listener;
-	}
-}
Index: tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 2786)
+++ tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 2787)
@@ -1947,9 +1947,11 @@
 	 * Gets a message indicating the start of computing.
 	 * Dedicated to indicate the start of computing and, for example, the parameters used for the computing.
 	 * 
+	 * Warning: at this point we don't know if all parameters are set -> you should avoid NPE
+	 * 
 	 * @return a message indicating the start of computing
 	 */
-	// FIXME: SJ: this method must become abstract in TXM0.8.1 and implemented by subclasses
+	// FIXME: SJ: this method must become abstract in TXM 0.8.1 and implemented by subclasses
 	public String getComputingStartMessage() {
 		return NLS.bind("Computing {0}...", this.getClass().getSimpleName());
 	}
Index: tmp/org.txm.core/src/java/org/txm/importer/SAttributesListener.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/SAttributesListener.java	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/SAttributesListener.java	(revision 2787)
@@ -0,0 +1,276 @@
+package org.txm.importer;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+
+import javax.xml.stream.*;
+
+import org.txm.utils.io.IOUtils;
+
+/**
+ * Read an XML file and find out : XML elements, their attributes and recursivity level
+ * names are lowercases
+ * 
+ * @author mdecorde
+ *
+ */
+public class SAttributesListener {
+
+	public HashMap<String,HashSet<String>> structs = new HashMap<String, HashSet<String>>();
+	public HashSet<String> anatypes = new HashSet<String>();
+	public HashMap<String, Integer> structsCountProf = new HashMap<String, Integer>();
+	public HashMap<String, Integer> structsMaxProf = new HashMap<String, Integer>();
+	private String structPath = "/";
+	private XMLStreamReader parser;
+
+	SAttributesListener() {
+		structs = new HashMap<String, HashSet<String>>();
+		structsCountProf = new HashMap<String, Integer>();
+		structsMaxProf = new HashMap<String, Integer>();
+		structPath = "/";
+		anatypes = new HashSet<String>(); // store scanned word attributes
+	}
+
+	SAttributesListener(XMLStreamReader parser) {
+		this();
+		this.parser = parser;
+	}
+
+	public void appendResultsTo(SAttributesListener another) {
+		structs = another.structs;
+		structsCountProf = another.structsCountProf;
+		structsMaxProf = another.structsMaxProf;
+		anatypes = another.anatypes; // store scanned word attributes
+	}
+
+	public void start(XMLStreamReader parser) {
+		this.parser = parser;
+	}
+
+	String W = "w";
+	String ANA = "ana";
+	String FORM = "form";
+	/**
+	 * Call this method for each START_ELEMENT stax event
+	 * @param localname the element localname
+	 */
+	public void startElement(String localname) {
+		localname = localname.toLowerCase();
+
+		//String localname = parser.getLocalName();
+		if(localname.equals(W)) return;
+		if(localname.equals(ANA)) return;
+		if(localname.equals(FORM)) return;
+
+		structPath += localname+"/";
+		//println "add: "+structPath
+		HashSet<String> attrs = structs.get(localname);
+		if (!structs.containsKey(localname)) {
+			attrs = new HashSet<String>();
+			structs.put(localname, attrs);
+			structsCountProf.put(localname, 0);
+			structsMaxProf.put(localname, 0);
+		} //else {
+
+		// get structure recursion
+		int prof = structsCountProf.get(localname)+1;
+		structsCountProf.put(localname, prof);
+		if (structsMaxProf.get(localname) < prof) {
+			structsMaxProf.put(localname, prof);
+		}
+
+		// get the structure attributes
+		for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
+			attrs.add(parser.getAttributeLocalName(i).toLowerCase());
+		}
+	}
+
+	/**
+	 * Call this method for each END_ELEMENT stax event
+	 * @param localname the element localname
+	 */
+	public void endElement(String localname) {
+		localname = localname.toLowerCase();
+		//String localname = parser.getLocalName();
+		if(localname.equals(W)) return;
+		if(localname.equals(ANA)) return;
+		if(localname.equals(FORM)) return;
+
+		if (structPath.length() > 1) {
+			int idx = structPath.lastIndexOf("/");
+			if (idx > 0) {
+				structPath = structPath.substring(0, idx);
+				//println "end of $localname "+(structsCountProf.get(localname))
+				//if (structsCountProf.get(localname) != null)
+				structsCountProf.put(localname, structsCountProf.get(localname)-1);
+			}
+			//println "pop: "+structPath
+		}
+	}
+
+//	boolean firstGetStructs = true;
+	public HashMap<String,HashSet<String>> getStructs() {
+		if (structsCountProf.containsKey("div")) {
+			if (structsCountProf.get("div") > 0)
+				structs.remove("div1");
+			if (structsCountProf.get("div") > 1)
+				structs.remove("div2");
+			if (structsCountProf.get("div") > 2)
+				structs.remove("div3");
+			if (structsCountProf.get("div") > 3)
+				structs.remove("div4");
+			if (structsCountProf.get("div") > 4)
+				structs.remove("div5");
+			if (structsCountProf.get("div") > 5)
+				structs.remove("div6");
+		}
+//		if (firstGetStructs) {
+//			firstGetStructs = false;
+		// fix min&maj names for CQP
+			ArrayList<String> keys = new ArrayList<String>();
+			keys.addAll(structs.keySet());
+			for (String key : keys) {
+				HashSet<String> value = structs.get(key);
+				structs.remove(key);
+				structs.put(key.toLowerCase(), value);
+			}
+//		}
+
+		return structs;
+	}
+
+	boolean firstGetstructsCountProf = true;
+	public HashMap<String, Integer> getProfs() {
+
+		//		if (firstGetstructsCountProf) {
+		//			firstGetstructsCountProf = false;
+		//			def keys = []
+		//			keys.addAll(structsCountProf.keySet());
+		//			for( String key : keys) {
+		//				def value = structsCountProf.get(key);
+		//				structsCountProf.remove(key)
+		//				structsCountProf.put(key.toLowerCase(), value);
+		//			}
+		//		}
+		HashMap<String, Integer> clone = new HashMap<String, Integer>();
+		for (String key : structsMaxProf.keySet()) {
+			if (structsMaxProf.get(key) > 0)
+				clone.put(key, structsMaxProf.get(key)-1);
+			else
+				clone.put(key, 0);
+		}
+		return clone;
+	}
+
+	public void initialize(ArrayList<String> pattributes, HashMap<String, HashSet<String>> sAttributesMap, HashMap<String, Integer> sAttributesProfs) {
+		this.anatypes.addAll(pattributes);
+		for (String s : sAttributesMap.keySet()) {
+			this.structsMaxProf.put(s, sAttributesProfs.get(s));
+			this.structsCountProf.put(s, 0);
+			this.structs.put(s, sAttributesMap.get(s));
+		}
+	}
+	
+	public HashSet<String> getAnatypes() {
+		return anatypes;
+	}
+
+//	public SAttributesListener scanFile(File xmlFile) throws MalformedURLException, IOException, XMLStreamException {
+//		return scanFile(xmlFile, this);
+//	}
+
+	public void setParser(XMLStreamReader parser) {
+		this.parser = parser;
+	}
+
+	/**
+	 * Merge results in the parentListener
+	 * 
+	 * @param xmlFile
+	 * @param parentListener results are appended to the parentListener if any
+	 * @return
+	 * @throws IOException 
+	 * @throws MalformedURLException 
+	 * @throws XMLStreamException 
+	 */
+	public SAttributesListener scanFile(File xmlFile) throws MalformedURLException, IOException, XMLStreamException {
+
+		boolean startText = false;
+		boolean startWord = false;
+		InputStream inputData = xmlFile.toURI().toURL().openStream();
+		XMLInputFactory factory = XMLInputFactory.newInstance();
+		XMLStreamReader parser = factory.createXMLStreamReader(inputData);
+
+//		SAttributesListener listener;
+//		if (parentListener != null) {
+//			listener = parentListener;
+//			listener.setParser(parser);
+//		} else {
+//			listener = new SAttributesListener(parser);
+//		}
+		String TEXT = "text";
+		String ANA = "ana";
+		String TYPE = "type";
+		//HashSet<String> types = new HashSet<String>();
+		this.setParser(parser);
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+			if (event == XMLStreamConstants.START_ELEMENT) { // start elem
+				if (TEXT.equals(parser.getLocalName())) startText = true;
+
+				if (startText) this.startElement(parser.getLocalName());
+
+				if (this.W.equals(parser.getLocalName())) {
+					startWord = true;
+				} else if (startWord && ANA.equals(parser.getLocalName())) { // ana elem
+					for (int i = 0 ; i < parser.getAttributeCount(); i++) { // find @type
+						if (TYPE.equals(parser.getAttributeLocalName(i))) { // @type
+							this.anatypes.add(parser.getAttributeValue(i).substring(1)); //remove the #
+							break;
+						}
+					}
+				}
+			} else if (event == XMLStreamConstants.END_ELEMENT) { // end elem
+				if (startText) this.endElement(parser.getLocalName());
+				if (TEXT.equals(parser.getLocalName())) startText = false;
+
+				if (this.W.equals(parser.getLocalName())) {
+					startWord = false;
+				}
+			}
+		}
+		if (parser != null) parser.close();
+		if (inputData != null) inputData.close();
+
+		return this;
+	}
+
+	/**
+	 * scan the XML files of a directory to list the structures with their properties and levels. Also list the word properties
+	 * @param xmlDirectory
+	 * @param wordTag
+	 * @return
+	 * @throws XMLStreamException 
+	 * @throws IOException 
+	 * @throws MalformedURLException 
+	 */
+	public static SAttributesListener scanFiles(File xmlDirectory, String wordTag) throws MalformedURLException, IOException, XMLStreamException {
+		SAttributesListener listener = new SAttributesListener();
+		listener.W = wordTag;
+		for (File xmlFile : xmlDirectory.listFiles(IOUtils.HIDDENFILE_FILTER)) {
+			if (xmlFile.isFile() && !xmlFile.isHidden() && xmlFile.getName().toLowerCase().endsWith(".xml")) {
+				listener.scanFile(xmlFile); // results saved in 'listener' data
+				//				println "LISTENER RESULT with ${xmlFile.getName()}: "+listener
+				//				println " prof: "+listener.getStructs()
+				//				println " prof: "+listener.getProfs()
+				//				println " path: "+listener.structPath
+			}
+		}
+
+		return listener;
+	}
+}

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

Index: tmp/org.txm.core/src/java/org/txm/importer/xtz/Compiler.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/xtz/Compiler.java	(revision 2786)
+++ tmp/org.txm.core/src/java/org/txm/importer/xtz/Compiler.java	(revision 2787)
@@ -28,13 +28,11 @@
 		inputDirectory = new File(module.getBinaryDirectory(), "txm/"+module.getCorpusName());
 		cqpDirectory = new File(module.getBinaryDirectory(), "cqp");		
 		outputDirectory = new File(module.getBinaryDirectory(), "data");
-		registryDirectory = new File(module.getBinaryDirectory(), "registry");
 		dataDirectory = new File(outputDirectory, module.getCorpusName());
+		registryDirectory = new File(module.getBinaryDirectory(), "registry");
 
 		DeleteDir.deleteDirectory(outputDirectory);
 		outputDirectory.mkdirs();
-		
-		DeleteDir.deleteDirectory(dataDirectory);
 		dataDirectory.mkdirs();
 		
 		DeleteDir.deleteDirectory(registryDirectory);
@@ -42,8 +40,8 @@
 		
 		if (!module.isUpdatingCorpus()) {
 			DeleteDir.deleteDirectory(cqpDirectory);
-			cqpDirectory.mkdir();
-		}
+		} 
+		cqpDirectory.mkdir();
 	}
 
 	@Override
