Index: TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/projects/nov13/CreateTheOtherTurns.groovy
===================================================================
--- TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/projects/nov13/CreateTheOtherTurns.groovy	(revision 3465)
+++ TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/projects/nov13/CreateTheOtherTurns.groovy	(revision 3466)
@@ -146,7 +146,51 @@
 							boolean shouldCloseOtherTurn = false;
 							
 							def m0 = word =~ startAndEndOtherReg
-							if (m0.matches()) {
+							def m1 = word =~ startOtherReg
+							def m2 = word =~ endOtherReg
+							
+							if (word.trim().equals("*")) {
+								if (debug) println "- ligne "+parser.getLocation().getLineNumber()+" : ouverture|fermeture de other avec '$word' -> tours '$turnInfos'"
+								
+								if (other) { // closing *
+									previousOtherStarting = ["word='*' location="+getLocation(true, false, false)]
+									
+									shouldCloseOtherTurn = true;
+									
+									wordToWrite = ""
+								} else {
+									previousOtherStarting = ["word='*' location="+getLocation(true, false, false)]
+									
+									//if (other) { // don't restart a Turn if already in a Other Turn
+										writer.writeEndElement() // current Turn
+										writer.writeCharacters("\n")
+										
+										def tmpInfos = new LinkedHashMap()
+										for (String attr : turnInfos.keySet()) tmpInfos[attr] = turnInfos[attr]
+										tmpInfos["orig-speaker"] = turnInfos["speaker"]
+										
+										if (primarySpeakerIdRegex == null || turnInfos["speaker"] ==~ primarySpeakerIdRegex) { // the current speaker is not the primary speaker
+											tmpInfos["speaker"] = otherNonPrimarySpeakerId
+										} else {
+											tmpInfos["speaker"] = primarySpeakerId
+										}
+										tmpInfos["startTime"] = currentTime
+										writer.writeStartElement("Turn")
+										for (String attr : tmpInfos.keySet()) {
+											writer.writeAttribute(attr, tmpInfos[attr])
+										}
+										writer.writeCharacters("\n")
+										
+										writer.writeStartElement("Sync")
+										writer.writeAttribute("time", tmpInfos["startTime"])
+										writer.writeCharacters("\n")
+										writer.writeEndElement()
+									//}
+									
+									other = true
+									wordToWrite = ""
+								}
+							} else if (m0.matches()) {
 								if (other) {
 									warnings << getLocation(true, false, false)+" with $word: Found a starting&ending * when one 'other' have been started at "+previousOtherStarting
 								}
@@ -188,11 +232,7 @@
 								wordToWrite = m0.group(2)
 								other = false
 								//}
-							}
-							
-							def m1 = word =~ startOtherReg
-							
-							if (!m0.matches() && m1.matches()) { // not and start&end but only a start
+							} else if (m1.matches()) { // not and start&end but only a start
 								
 								if (other) {
 									warnings << getLocation(true, false, false)+" with $word: Found a starting * when one 'other' have been started at "+previousOtherStarting
@@ -236,10 +276,7 @@
 								other = true
 								wordToWrite = m1.group(2)
 								//}
-							}
-							
-							def m2 = word =~ endOtherReg
-							if (!m1.matches() && !m0.matches() && m2.matches()) {
+							} else if (m2.matches()) {
 								if (debug) println "- ligne "+parser.getLocation().getLineNumber()+" : fermeture de other avec '$word' -> tours '$turnInfos'"
 								
 								if (!other) {
Index: TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/SegmentTRSInSectionFromMarkerMacro.groovy
===================================================================
--- TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/SegmentTRSInSectionFromMarkerMacro.groovy	(revision 3465)
+++ TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/SegmentTRSInSectionFromMarkerMacro.groovy	(revision 3466)
@@ -105,12 +105,13 @@
 				String content = null;
 				if (node instanceof String) {
 					content = node
-				} else if (node instanceof groovy.util.Node && node.name() == "w" && node.text().contains(newSectionMarker)) {
+				} else if (node instanceof groovy.util.Node && node.name() == "w") {
 					content = node.text().trim()
 					start = Float.parseFloat(node.@time)
 				}
 				
-				if (content.equals(newSectionMarker)) {
+				if (content != null && (content.equals(newSectionMarker) || content.startsWith(newSectionMarker) || content.endsWith(newSectionMarker))) {
+					
 					if (debug) println "New section at $turn with $node child node"
 					previousSection = currentSection
 					currentSection = new Node(trsEpisode, "Section", new LinkedHashMap(["type":newSectionMarker, "startTime":turn.@startTime, "endTime":previousSection.attributes()["endTime"]]))
@@ -128,13 +129,23 @@
 						newTurn.attributes()["startTime"] = start
 						turn.attributes()["endTime"] = start
 						
+						def syncNode = new Node(newTurn, "Sync", new LinkedHashMap())
+						syncNode.attributes()["time"] = start
 						nFound++
 						
 					}
 					
 					children.remove(i) // remove the mark
 					i--
+					if (content.startsWith(newSectionMarker)) { // remove the marker and keep the tail content
+						node.value = node.text().substring(newSectionMarker.length())
+						newTurn.children().add(node)
+					} else if (content.endsWith(newSectionMarker)) { // remove the marker and keep the head content
+						node.value = node.text().substring(0, node.text().length() - newSectionMarker.length())
+						newTurn.children().add(node)
+					}
 					
+					
 				} else if (newTurn != null) {
 					turn.children().remove(i)
 					i--
Index: TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/Vocapia2Transcriber.groovy
===================================================================
--- TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/Vocapia2Transcriber.groovy	(revision 3465)
+++ TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/Vocapia2Transcriber.groovy	(revision 3466)
@@ -82,8 +82,8 @@
 							case "Speaker": // <Speaker ch="1" dur="531.38" gender="X" spkid="Enquêtrice" lang="fre" lconf="1.00" nw="1586" tconf="0.95"/> -> <Speaker id="spk1" name="enq4" check="no" dialect="native" accent="" scope="local"/>
 							
 								writer.writeStartElement("Speaker")
-								writer.writeAttribute("id", parser.getAttributeValue(null, "spkid"))
-								writer.writeAttribute("name", parser.getAttributeValue(null, "spkid"))
+								writer.writeAttribute("id", parser.getAttributeValue(null, "spkid").trim())
+								writer.writeAttribute("name", parser.getAttributeValue(null, "spkid").trim())
 								writer.writeAttribute("check", "")
 								writer.writeAttribute("dialect", parser.getAttributeValue(null, "lang"))
 								writer.writeAttribute("accent", parser.getAttributeValue(null, "gender"))
@@ -94,8 +94,8 @@
 								/**
 								 * remove the additional speaker if already written
 								 */
-								if (additionalSpeakers.containsKey(parser.getAttributeValue(null, "spkid"))) {
-									additionalSpeakers.remove(parser.getAttributeValue(null, "spkid"))
+								if (additionalSpeakers.containsKey(parser.getAttributeValue(null, "spkid").trim())) {
+									additionalSpeakers.remove(parser.getAttributeValue(null, "spkid").trim())
 								}
 								break;
 								
@@ -119,11 +119,14 @@
 								writer.writeStartElement("Turn")
 								for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
 									String name = parser.getAttributeLocalName(i)
+									String value = parser.getAttributeValue(i)
 									if (name == "stime") name = "startTime"
 									else if (name == "etime") name = "endTime"
-									else if (name == "spkid") name = "speaker"
-									
-									writer.writeAttribute(name, parser.getAttributeValue(i))
+									else if (name == "spkid") {
+										name = "speaker"
+										value = value.trim()
+									}
+									writer.writeAttribute(name, value)
 								}
 							
 								writer.writeCharacters("\n")
Index: TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/CompressCQPIndexes.java
===================================================================
--- TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/CompressCQPIndexes.java	(revision 3465)
+++ TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/CompressCQPIndexes.java	(revision 3466)
@@ -87,12 +87,12 @@
 		
 		ArrayList<String> args = new ArrayList<>(Arrays.asList(huff.getAbsolutePath(), "-T", "-r", registryfile.getParent()));
 		
-//		ReadRegistryFile rrf = new ReadRegistryFile(registryfile);
-//		rrf.read();
-//		for (String p : rrf.pAttributes) {
-//			args.add("-P");
-//			args.add(p);
-//		}
+		//		ReadRegistryFile rrf = new ReadRegistryFile(registryfile);
+		//		rrf.read();
+		//		for (String p : rrf.pAttributes) {
+		//			args.add("-P");
+		//			args.add(p);
+		//		}
 		args.add("-A");
 		args.add(corpusid);
 		
@@ -108,13 +108,13 @@
 		
 		ArrayList<String> args2 = new ArrayList<>(Arrays.asList(rdxcompressor.getAbsolutePath(), "-T", "-r", registryfile.getParent()));
 		
-//		for (String p : rrf.pAttributes) {
-//			File f = new File(dataDirectory, p+".corpus");
-//			if (f.length() > 0) {
-//				args2.add("-P");
-//				args2.add(p);
-//			}
-//		}
+		//		for (String p : rrf.pAttributes) {
+		//			File f = new File(dataDirectory, p+".corpus");
+		//			if (f.length() > 0) {
+		//				args2.add("-P");
+		//				args2.add(p);
+		//			}
+		//		}
 		args2.add("-A");
 		args2.add(corpusid);
 		
@@ -128,26 +128,55 @@
 			return false;
 		}
 		
-		// remove .corpus .corpus.rdx and corpus.rev files
+		// remove .corpus files if the compression was succesful
 		int s = 0;
 		int a = 0;
 		for (File f : dataDirectory.listFiles()) {
-			if (f.getName().endsWith(".corpus") || f.getName().endsWith(".corpus.rdx") ||f.getName().endsWith(".corpus.rev")) {
-				s += f.length();
-				f.delete();
-				if (txm081fix) f.createNewFile();
+			if (f.getName().endsWith(".corpus")) {
+				
+				
+				String path = f.getAbsolutePath();
+				path = path.substring(0, path.length() - 7)+".huf";
+				File cfile = new File(path);
+				if (cfile.exists()) {
+					s += f.length();
+					f.delete();
+					if (txm081fix) f.createNewFile();
+				} else {
+					continue;
+				}
 			}
-			if (f.getName().matches(".+(\\.hcd|\\.huf|\\.huf\\.syn|\\.crc|\\.crx)")) {
+			if (f.getName().matches(".+(\\.hcd|\\.huf|\\.huf\\.syn)")) {
 				a += f.length();
 			}
 		}
 		
+		// remove .corpus.rdx and corpus.rev files if the compression was succesful
+		for (File f : dataDirectory.listFiles()) {
+			if (f.getName().endsWith(".corpus.rdx") ||f.getName().endsWith(".corpus.rev")) {
+				
+				String path = f.getAbsolutePath();
+				path = path.substring(0, path.length() - 7)+".crc";
+				File cfile = new File(path);
+				if (cfile.exists()) {
+					s += f.length();
+					f.delete();
+					if (txm081fix) f.createNewFile();
+				} else {
+					continue;
+				}
+			}
+			if (f.getName().matches(".+(\\.crc|\\.crx)")) {
+				a += f.length();
+			}
+		}
+		
 		System.out.println("cleared: "+s);
 		System.out.println("created: "+a);
 		System.out.println("diff="+(s-a));
 		return true;
 	}
-
+	
 	/**
 	 * The main method.
 	 *
@@ -156,11 +185,11 @@
 	public static void main(String[] args) {
 		try {
 			String userdir = System.getProperty("user.home");
-			File tools = new File(userdir, "workspace-cpp/CWB-lib/src/builds/linux-64"); //$NON-NLS-1$
+			File tools = new File(userdir, "SVN/txm-sf/CWB/cwb-lib/src/builds/linux-64"); //$NON-NLS-1$
 			File registry = new File(userdir, "runtime-rcpapplication.product/corpora/NOV13-P1/registry/nov13-p1"); //$NON-NLS-1$
 			File data = new File(userdir, "runtime-rcpapplication.product/corpora/NOV13-P1/data/NOV13-P1"); //$NON-NLS-1$
 			CompressCQPIndexes.compressAll(tools, registry, "NOV13-P1", data, true);
-
+			
 		} catch (Exception e) {
 			e.printStackTrace();
 		}
