Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorporaDirectory.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorporaDirectory.java	(revision 3384)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorporaDirectory.java	(revision 3385)
@@ -273,7 +273,7 @@
 		// lsd.setInitialSelections(files);
 		lsd.setTitle(TXMUIMessages.LoadBinaryCorporaDirectory_corpusLoad);
 		if (lsd.open() == ListSelectionDialog.OK) {
-			System.out.println(lsd.getResult());
+			//Log.info(lsd.getResult());
 			for (Object o : lsd.getResult()) {
 				selectedFiles.add(new File(o.toString()));
 			}
Index: TXM/trunk/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/data/MatrixImpl.java
===================================================================
--- TXM/trunk/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/data/MatrixImpl.java	(revision 3384)
+++ TXM/trunk/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/data/MatrixImpl.java	(revision 3385)
@@ -27,7 +27,10 @@
 //
 package org.txm.statsengine.r.core.data;
 
+import java.io.BufferedReader;
 import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -43,7 +46,9 @@
 import org.txm.statsengine.r.core.RWorkspace;
 import org.txm.statsengine.r.core.exceptions.RException;
 import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
+import org.txm.utils.CsvReader;
 import org.txm.utils.OSDetector;
+import org.txm.utils.io.IOUtils;
 import org.txm.utils.logger.Log;
 
 import cern.colt.matrix.DoubleMatrix2D;
@@ -287,30 +292,8 @@
 		}
 		// de la liste rows
 	}
-	
-	
-	
+		
 	/**
-	 * Export data.
-	 *
-	 * @param f the f
-	 * @param colseparator the colseparator
-	 * @param txtseparator the txtseparator
-	 */
-	@Deprecated
-	public void exportData(File f, String colseparator, String txtseparator) {
-		try {
-			org.txm.statsengine.r.core.RWorkspace
-					.getRWorkspaceInstance().safeEval(
-							"write.table(" + symbol + ", file=\"" + f.getAbsolutePath().replace("\\", "\\\\") + "\", fileEncoding=\"UTF-8\");"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-		}
-		catch (Exception e1) {
-			org.txm.utils.logger.Log.printStackTrace(e1);
-			RWorkspace.printLastSafeEvalExpr();
-		}
-	}
-	
-	/**
 	 * Filter.
 	 *
 	 * @param freqs the freqs
@@ -680,13 +663,63 @@
 		 * t3 <- t2[1:nrow(t2),];
 		 * colnames(t3) <- header;
 		 */
-		rw.voidEval("tmpmat <- as.matrix(read.table(file=\"" + path + "\", sep=\"" + colseparator + "\", row.names=1, skip=1, fileEncoding=\"" + encoding + "\"));"); //$NON-NLS-1$ //$NON-NLS-2$
-		rw.voidEval("tmpheader <- scan(file=\"" + path + "\", what = character(), nlines=1, sep=\"" + colseparator + "\", fileEncoding=\"" + encoding + "\");"); //$NON-NLS-1$ //$NON-NLS-2$
-		rw.voidEval("tmpheader <- tmpheader[2:length(tmpheader)];"); //$NON-NLS-1$
-		rw.voidEval("tmpmat <- tmpmat[1:nrow(tmpmat),];"); //$NON-NLS-1$
-		rw.voidEval("colnames(tmpmat) <- tmpheader"); //$NON-NLS-1$
+//		rw.voidEval("tmpmat <- as.matrix(read.table(file=\"" + path + "\", sep=\"" + colseparator + "\", row.names=1, skip=1, fileEncoding=\"" + encoding + "\"));"); //$NON-NLS-1$ //$NON-NLS-2$
+//		rw.voidEval("tmpheader <- scan(file=\"" + path + "\", what = character(), nlines=1, sep=\"" + colseparator + "\", fileEncoding=\"" + encoding + "\");"); //$NON-NLS-1$ //$NON-NLS-2$
+//		rw.voidEval("tmpheader <- tmpheader[2:length(tmpheader)];"); //$NON-NLS-1$
+//		rw.voidEval("tmpmat <- tmpmat[1:nrow(tmpmat),];"); //$NON-NLS-1$
+//		rw.voidEval("colnames(tmpmat) <- tmpheader"); //$NON-NLS-1$
+//		rw.eval(symbol + "<- tmpmat"); //$NON-NLS-1$
 		
-		rw.eval(symbol + "<- tmpmat"); //$NON-NLS-1$
+		try {
+			BufferedReader input = IOUtils.getReader(f, encoding);
+			CsvReader reader = new CsvReader(input);
+			reader.readHeaders();
+			String[] header = reader.getHeaders();
+			String[] rheader = new String[header.length-1];
+			System.arraycopy(header, 1, rheader, 0, header.length-1);
+			
+			int ncols = reader.getHeaderCount();
+			if (ncols == 1) {
+				Log.warning("LexicalTable data import : no column found in: "+f);
+				return false;
+			}
+			rw.voidEval("tmpmat <- matrix(ncol="+(ncols-1)+");"); //$NON-NLS-1$ //$NON-NLS-2$
+			
+			ArrayList<String> rownames = new ArrayList<>();
+			while (reader.readRecord()) {
+				
+				rownames.add(reader.get(0));
+				
+				double[] values = new double[ncols-1];
+				for (int i = 1 ; i < ncols ; i++) {
+					String r = reader.get(i);
+					
+					if (r != null) {
+						values[i-1] = Double.parseDouble(r);
+					} else {
+						values[i-1] = 0;
+					}
+				}
+				System.out.println("values="+Arrays.toString(values));
+				rw.addVectorToWorkspace("tmpvec", values);
+				rw.voidEval("tmpmat <- rbind(tmpmat, tmpvec);");
+			}
+			rw.voidEval("tmpmat <- tmpmat[-1,];"); // $NON-NLS-1$ remove the null first line
+			rw.addVectorToWorkspace("tmprownames", rownames.toArray(new String[rownames.size()])); //$NON-NLS-1$
+			rw.addVectorToWorkspace("tmpcolnames", rheader);
+			rw.assignRowNamesToMatrix("tmpmat", "tmprownames");
+			rw.assignColNamesToMatrix("tmpmat", "tmpcolnames");
+			
+			rw.voidEval(symbol + "<- tmpmat;"); //$NON-NLS-1$
+			//rw.voidEval("rm(tmpmat);"); //$NON-NLS-1$
+			reader.close();
+			input.close();
+		}
+		catch (Exception e) {
+			Log.warning("LexicalTable data import : error.");
+			Log.printStackTrace(e);
+			return false;
+		}
 		
 		return true;
 	}
@@ -1086,7 +1119,7 @@
 		try {
 			String path = f.getAbsolutePath().replace("\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
 			org.txm.statsengine.r.core.RWorkspace.getRWorkspaceInstance().safeEval(
-					"write.table(" + symbol + ", file=\"" + path + "\""//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+					"write.csv(" + symbol + ", file=\"" + path + "\""//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 							+ ", col.names = NA, row.names = TRUE, fileEncoding=\"" + encoding + "\"" //$NON-NLS-1$ //$NON-NLS-2$
 							+ ", sep=\"" + colseparator + "\");"); //$NON-NLS-1$ //$NON-NLS-2$
 		}
Index: TXM/trunk/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ImportTable.java
===================================================================
--- TXM/trunk/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ImportTable.java	(revision 3384)
+++ TXM/trunk/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ImportTable.java	(revision 3385)
@@ -43,8 +43,11 @@
 import org.txm.core.preferences.TXMPreferences;
 import org.txm.lexicaltable.core.functions.LexicalTable;
 import org.txm.lexicaltable.rcp.editors.LexicalTableEditor;
+import org.txm.rcp.TXMWindows;
 import org.txm.rcp.handlers.BaseAbstractHandler;
 import org.txm.rcp.swt.dialog.LastOpened;
+import org.txm.rcp.utils.SWTEditorsUtils;
+import org.txm.rcp.views.corpora.CorporaView;
 import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
 import org.txm.utils.logger.Log;
 
@@ -73,8 +76,7 @@
 		
 		if (editor instanceof LexicalTableEditor) {
 			LexicalTableEditor LTeditor = (LexicalTableEditor) editor;
-			Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event)
-					.getShell();
+			Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
 			FileDialog d = new FileDialog(shell, SWT.OPEN);
 			if (LastOpened.getFile(ID) != null) {
 				d.setFilterPath(LastOpened.getFolder(ID));
@@ -85,14 +87,22 @@
 				File file = new File(path);
 				LastOpened.set(ID, file.getParent(), file.getName());
 				if (file.exists()) {
-					LTeditor.importData(file);
+					try {
+						LTeditor.getLexicalTable().getData().importData(file, encoding, colseparator, txtseparator);
+						SWTEditorsUtils.closeEditors(LTeditor.getLexicalTable(), true);
+						Log.info("Re-open the lexical table to see the modifications");
+					}
+					catch (Exception e) {
+						System.out.println("Error: data import failed: " + e);
+						Log.printStackTrace(e);
+					}
+					
 				}
 			}
 		}
 		else if (sel instanceof LexicalTable) {
 			LexicalTable lt = (LexicalTable) sel;
-			Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event)
-					.getShell();
+			Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
 			FileDialog d = new FileDialog(shell, SWT.OPEN);
 			if (LastOpened.getFile(ID) != null) {
 				d.setFilterPath(LastOpened.getFolder(ID));
@@ -108,6 +118,8 @@
 						lt.getData().importData(file, encoding, colseparator, txtseparator);
 						lt.setAltered();
 						System.out.println(NLS.bind("Data imported: {0} columns and {1} rows.", lt.getNColumns(), lt.getNRows()));
+						SWTEditorsUtils.closeEditors(lt, true);
+						Log.info("Re-open the lexical table to see the modifications");
 					}
 					catch (Exception e) {
 						System.out.println("Error: data import failed: " + e);
Index: TXM/trunk/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RVariablesView.java
===================================================================
--- TXM/trunk/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RVariablesView.java	(revision 3384)
+++ TXM/trunk/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RVariablesView.java	(revision 3385)
@@ -387,7 +387,7 @@
 		 */
 		@Override
 		public Object[] getElements(Object element) {
-			System.out.println("input: "+element);
+
 			Collection<Project> input = (Collection<Project>) element;
 			Object[] objects = new Object[input.size()];
 			Iterator<Project> it = input.iterator();
Index: TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/stats/AFCMacro.groovy
===================================================================
--- TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/stats/AFCMacro.groovy	(revision 3384)
+++ TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/stats/AFCMacro.groovy	(revision 3385)
@@ -1,278 +0,0 @@
-// STANDARD DECLARATIONS
-package org.txm.macro
-
-import org.kohsuke.args4j.*
-import groovy.transform.Field
-import org.txm.rcpapplication.swt.widget.parameters.*
-import org.txm.searchengine.cqp.clientExceptions.*
-import org.txm.searchengine.cqp.corpus.*
-import org.txm.searchengine.cqp.corpus.query.*
-import org.apache.commons.lang.time.StopWatch
-import java.util.Arrays
-import org.jfree.chart.renderer.xy.*
-import org.jfree.chart.renderer.*
-import org.jfree.chart.plot.*
-import org.jfree.data.xy.*
-import org.jfree.chart.axis.*
-import java.awt.*;
-import java.awt.geom.*;
-import org.jfree.chart.labels.*
-
-import org.txm.ca.core.chartsengine.jfreechart.themes.highcharts.renderers.*
-import org.txm.ca.rcp.editors.*
-import org.txm.libs.office.ReadODS
-import org.txm.ca.core.chartsengine.jfreechart.datasets.*
-import org.jfree.chart.renderer.AbstractRenderer
-
-println "editor: "+editor
-
-if (!(editor instanceof CAEditor)) {
-	println "editor is not a CA editor: $editor, Run the macro with F12 when the editor is selected :-)"
-	return
-}
-
-@Field @Option(name="patternsODSFile", usage="The starting word", widget="FileOpen", required=true, def='patterns.ods')
-		def patternsODSFile
-@Field @Option(name="debug", usage="Show internal variable content", widget="StringArray", metaVar="OFF	ON	ALL	REALLY ALL", required=true, def="OFF")
-		debug
-
-// Open the parameters input dialog box
-if (!ParametersDialog.open(this)) return;
-if (debug == "OFF") debug = 0; else if (debug == "ON") debug = 1; else if (debug == "ALL") debug = 2 else if (debug == "REALLY ALL") debug = 3
-
-if (!patternsODSFile.exists()) {
-	println "Pattern file not found: $patternsODSFile"
-	return false;
-}
-if (!patternsODSFile.isFile() || !patternsODSFile.getName().toLowerCase().endsWith(".ods")) {
-	println "Wrong pattern file: $patternsODSFile"
-	return false;
-}
-
-def data = ReadODS.toTable(patternsODSFile, "rows")
-def keys = data[0]
-def row_styles = [:] // reformat data
-for (int i = 1 ; i < data.size() ; i++) {
-	def h = data[i]
-	def style = [:] // create style entry
-	String s = h[0];
-	row_styles[/$s/] = style // with a regexp pattern as key
-
-	// fill the style
-	for (int j = 1 ; j < h.size() ; j++) {
-		style[keys[j]] = h[j]
-	}
-}
-if (debug > 0) {
-	println "ROW STYLES=$row_styles"
-}
-
-data = ReadODS.toTable(patternsODSFile, "cols")
-keys = data[0]
-def col_styles = [:] // reformat data
-for (int i = 1 ; i < data.size() ; i++) {
-	def h = data[i]
-	def style = [:] // create style entry
-	String s = h[0];
-	col_styles[/$s/] = style // with a regexp pattern as key
-
-	// fill the style
-	for (int j = 1 ; j < h.size() ; j++) {
-		style[keys[j]] = h[j]
-	}
-}
-if (debug > 0) {
-	println "COL STYLES=$col_styles"
-}
-
-ica = editor.getCA()
-ca = ica.getCA()
-
-// http://txm.sourceforge.net/javadoc/TXM/TBX/org/txm/stat/engine/r/function/CA.html
-
-// SOME DATA
-rows = ica.getRowNames()
-rowsinfo = ica.getRowInfos()
-rowscos2 = ca.getRowCos2()
-cols = ica.getColNames()
-println cols
-colssinfo = ica.getColInfos()
-colscos2 = ca.getColCos2()
-D1 = ica.getFirstDimension() -1;
-D2 = ica.getSecondDimension() -1;
-
-shapes = [:]
-shapes["square"] = AbstractRenderer.DEFAULT_SHAPE;
-shapes["circle"] = AbstractRenderer.DEFAULT_SHAPE;
-shapes["triangle"] = AbstractRenderer.DEFAULT_SHAPE;
-shapes["star"] = AbstractRenderer.DEFAULT_SHAPE;
-shapes["disk"] = AbstractRenderer.DEFAULT_SHAPE;
-
-// styles per col index in dataset
-// set col points label
-colLabelStyle = new HashMap<Integer, String>();
-// set col points visibility
-colHiddenStyle = new HashSet<Integer>(); // true false
-// set col font size
-colFontSizeStyle = new HashMap<Integer, Integer>(); // 0.0 to 10.0
-// set col points size
-colSizeStyle = new HashMap<Integer, Double>(); // 0.0 to 10.0
-// set col points RGBA color
-colColorStyle = new HashMap<Integer, Color>();
-// set col points shape (circle, square, triangle, ... + color ? + size ?) -> expert
-colShapeStyle = new HashMap<Integer, Shape>(); // circle, square, triangle, etc.
-
-
-rowLabelStyle = new HashMap<Integer, String>();
-// set row points visibility
-rowHiddenStyle = new HashSet<Integer>(); // true false
-// set row font size
-rowFontSizeStyle = new HashMap<Integer, Integer>(); // 0.0 to 10.0
-// set row points size
-rowSizeStyle = new HashMap<Integer, Double>(); // 0.0 to 10.0
-// set row points RGBA color
-rowColorStyle = new HashMap<Integer, Color>();
-// set row points shape (circle, square, triangle, ... + color ? + size ?) -> expert
-rowShapeStyle = new HashMap<Integer, Shape>(); // circle, square, triangle, etc.
-
-// prepare col style data for the dataset
-for (int i = 0 ; i < cols.length ; i++) {
-	for (def p : col_styles.keySet()) {
-		if (cols[i] ==~ p) {
-			def style = col_styles[p]
-			if (style["shape"] != null && shapes.containsKey(style["shape"])) {
-				colShapeStyle[i] = shapes[style["shape"]]
-			}
-			if (style["color"] != null && style["color"].length() > 0 ) {
-				colColorStyle[i] = new Color(Integer.parseInt(style["color"]), true)
-			}
-			if (style["label"] != null && style["label"].length() > 0) {
-				colLabelStyle[i] = style["label"]
-			}
-			if (style["size"] != null && style["size"].length() > 0) {
-				colSizeStyle[i] = Double.parseDouble(style["size"])
-			}
-			if (style["font-size"] != null && style["font-size"].length() > 0) {
-				colFontSizeStyle[i] = Integer.parseInt(style["font-size"])
-			}
-			if (style["hidden"] != null && style["hidden"].toUpperCase() == "T") {
-				colHiddenStyle << i
-			}
-		}
-	}
-}
-if (debug > 0) {
-	println "COL COL=$colColorStyle"
-	println "COL SHP=$colShapeStyle"
-	println "COL LAB=$colLabelStyle"
-	println "COL FONT-SIZ=$colFontSizeStyle"
-	println "COL SIZ=$colSizeStyle"
-	println "COL VIZ=$colHiddenStyle"
-}
-
-
-
-// UPDATE THE CHART RENDERER
-
-def chartEditor = editor.getEditors()[0]
-def chartComposite = chartEditor.getComposite()
-
-ddebug = debug
-monitor.syncExec( new Runnable() {
-			public void run() {
-				println chartComposite
-				def chart = chartEditor.getChart();
-
-				//println "chart: "+chart
-				//println "Plot: "+chart.getPlot()
-				//println "Dataset: "+chart.getPlot().getDataset()
-				//println "Renderer: "+chart.getPlot().getRenderer()
-
-				def renderer = new CAItemSelectionRenderer(ica, chart) {
-							Area EMPTYAREA = new Area()
-
-							@Override
-							public void initItemLabelGenerator()        {
-								XYItemLabelGenerator generator = new XYItemLabelGenerator() {
-
-											@Override
-											public String generateLabel(XYDataset dataset, int series, int item) {
-												if (series == 0 && rowHiddenStyle.contains(item)) {
-													if (ddebug > 1) println "HIDDING ROW LABEL '$item' '${rows[item]}'"
-													return ""
-												} else if (series == 1 && colHiddenStyle.contains(item)) {
-													if (ddebug > 1) println "HIDDING COL LABEL '$item' '${cols[item]}'"
-													return ""
-												} else if (series == 0 && rowLabelStyle.containsKey(item)) {
-													if (ddebug > 1) println "RENAME ROW LABEL '$item' '${rows[item]}' -> '${rowLabelStyle[item]}'"
-													return rowLabelStyle[item]
-												} else if (series == 1 && colLabelStyle.containsKey(item)) {
-													if (ddebug > 1) println "RENAME COL LABEL '$item' '${cols[item]}' -> '${colLabelStyle[item]}'"
-													return colLabelStyle[item]
-												} else {
-													CAXYDataset caDataset = (CAXYDataset) dataset;
-													return caDataset.getLabel(series, item);
-												}
-											}
-										};
-
-								this.setBaseItemLabelGenerator(generator);
-								this.setBaseItemLabelsVisible(true);
-							}
-
-							@Override
-							public Font getItemLabelFont(int series, int item) {
-								Font d = super.getItemLabelFont(series, item);
-								if (series == 0 && rowFontSizeStyle.containsKey(item)) {
-									if (ddebug > 1) println "FIX ROW FONT-SIZE $item "+rows[item]
-									return new Font(d.getFontName(), d.getStyle(), rowFontSizeStyle[item]);
-								} else if (series == 1 && colFontSizeStyle.containsKey(item)) {
-									if (ddebug > 1) println "FIX COL FONT-SIZE $item "+cols[item]
-									return new Font(d.getFontName(), d.getStyle(), colFontSizeStyle[item]);
-								} else {
-									return d;
-								}
-							}
-
-							@Override
-							public Shape getItemShape(int series, int item) {
-								// Rows (series == 0), Cols (series == 1)
-								if (series == 0 && rowHiddenStyle.contains(item)) {
-									return EMPTYAREA;
-								} else if (series == 1 && colHiddenStyle.contains(item)) {
-									return EMPTYAREA;
-								} else {
-									AffineTransform t = new AffineTransform();
-									Shape shape =  super.getItemShape(series, item);
-									if (series == 0 && rowSizeStyle.containsKey(item)) {
-										t.setToScale(rowSizeStyle.get(item), rowSizeStyle.get(item));
-										shape = t.createTransformedShape(shape);
-									} else if (series == 1 && colSizeStyle.containsKey(item)) {
-										t.setToScale(colSizeStyle.get(item), colSizeStyle.get(item));
-										shape = t.createTransformedShape(shape);
-									}
-									return shape;
-								}
-							}
-
-							@Override
-							public Paint getItemPaint(int series, int item) {
-								if (series == 0 && rowColorStyle.containsKey(item)) {
-									return rowColorStyle.get(item);
-								} else if (series == 1 && colColorStyle.containsKey(item)) {
-									return colColorStyle.get(item);
-								} else {
-									return super.getItemPaint(series, item);
-								}
-							}
-						};
-
-				def cp = editor.editors[0].getChart();
-				renderer.chart = cp
-				renderer.setSeriesVisible(0, ica.isShowVariables()); // Rows
-				renderer.setSeriesVisible(1, ica.isShowIndividuals()); // Columns
-				chart.getXYPlot().setRenderer(renderer)
-
-				ica.getChartCreator().getChartsEngine().getJFCTheme().apply(chart); // need to be call AFTER setRenderer() cause this method changes some renderering parameters
-			}
-		});
\ No newline at end of file
Index: TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/stats/PlotEllipsesMacro.groovy
===================================================================
--- TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/stats/PlotEllipsesMacro.groovy	(revision 3384)
+++ TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/stats/PlotEllipsesMacro.groovy	(revision 3385)
@@ -1,18 +1,18 @@
 // STANDARD DECLARATIONS
 package org.txm.macro
 
-import org.kohsuke.args4j.*
+import org.txm.ca.core.functions.CA
+import org.txm.statsengine.r.core.RWorkspace
 import groovy.transform.Field
-import org.txm.rcpapplication.swt.widget.parameters.*
-import org.txm.functions.ca.CA
-import org.txm.stat.engine.r.RWorkspace
 // BEGINNING OF PARAMETERS
 
 if (!(corpusViewSelection instanceof CA)) {
-	println "selection is not a CA. Please select a CA result in the Corpus view"
+	println "Selection is not a CA. Please select a CA result in the Corpus view"
 	return;
 }
 
+def ca = corpusViewSelection
+
 @Field @Option(name="outputFile", usage="an example file", widget="FileSave", required=true, def="file.svg")
 def outputFile
 
@@ -22,8 +22,8 @@
 if (!ParametersDialog.open(this)) return;
 
 // END OF PARAMETERS
-def ca = corpusViewSelection
-def s = ca.getSymbol()
+
+def s = ca.getRSymbol()
 def RW = RWorkspace.getRWorkspaceInstance()
 
 def script = """
Index: TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/txt/importer.groovy
===================================================================
--- TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/txt/importer.groovy	(revision 3384)
+++ TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/txt/importer.groovy	(revision 3385)
@@ -243,7 +243,7 @@
 			cpb.tick()
 			Sequence S = new Sequence();
 			Filter F1 = new CutHeader();
-			Filter F7 = new TagSentences();
+			Filter F7 = new TagSentences(TokenizerClasses.newTokenizerClasses(project.getPreferencesScope(), lang));
 			Filter F11 = new FusionHeader();
 			S.add(F1);
 			S.add(F7);
Index: TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/TagSentences/TagSentences.groovy
===================================================================
--- TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/TagSentences/TagSentences.groovy	(revision 3384)
+++ TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/TagSentences/TagSentences.groovy	(revision 3385)
@@ -116,8 +116,51 @@
 		corr_tags = tc.corr_tags;
 		
 		strongPunct = tc.punct_strong;
+		
+		reg_comment = /\A\s*<!--.*-->\s*\Z/
+		reg_out_of_sentence = /^(.*)<s( [^>]*)?>(.*)$/
+		reg_sentence_with_no_n_attribute = /<s( [^>]*)?>/
+		reg_end_of_sentence = /^(.*)<\/s>(.*)$/
+		reg_punct = /^(.*)<w type="pon"[^>]*>.*<\/w>(.*)$/
+		reg_strong_punct = /^(.*)<w [^>]*>$strongPunct<\/w>(.*)/
+		reg_word = /^(.*)<w .*<\/w>(.*)/
+		reg_corr_tags_no_seg = /^\s*(<($corr_tags_no_seg)( [^>\/]*)?>)\s*$/
+		reg_corr_tags_no_seg_alone = "<($corr_tags_no_seg)>"
+		reg_corr_tags_no_seg2 = /^(.*)<\/($corr_tags_no_seg)>(.*)$/
+		reg_block_tags = /^(.*)<\/($div_tags|$q_tags)>(.*)$/
+		reg_block_tag_alone = "<($div_tags|$q_tags)>"
 	}
 	
+	public TagSentences(TokenizerClasses tc) {
+		
+		/** The div_tags. */
+		div_tags = tc.div_tags;
+		
+		/** The q_tags. */
+		q_tags = tc.q_tags;
+		
+		/** The corr_tags_no_seg. */
+		corr_tags_no_seg = tc.corr_tags_no_seg;
+		
+		/** The corr_tags. */
+		corr_tags = tc.corr_tags;
+		
+		strongPunct = tc.punct_strong;
+		
+		reg_comment = /\A\s*<!--.*-->\s*\Z/
+		reg_out_of_sentence = /^(.*)<s( [^>]*)?>(.*)$/
+		reg_sentence_with_no_n_attribute = /<s( [^>]*)?>/
+		reg_end_of_sentence = /^(.*)<\/s>(.*)$/
+		reg_punct = /^(.*)<w type="pon"[^>]*>.*<\/w>(.*)$/
+		reg_strong_punct = /^(.*)<w [^>]*>$strongPunct<\/w>(.*)/
+		reg_word = /^(.*)<w .*<\/w>(.*)/
+		reg_corr_tags_no_seg = /^\s*(<($corr_tags_no_seg)( [^>\/]*)?>)\s*$/
+		reg_corr_tags_no_seg_alone = "<($corr_tags_no_seg)>"
+		reg_corr_tags_no_seg2 = /^(.*)<\/($corr_tags_no_seg)>(.*)$/
+		reg_block_tags = /^(.*)<\/($div_tags|$q_tags)>(.*)$/
+		reg_block_tag_alone = "<($div_tags|$q_tags)>"
+	}
+	
 	/* (non-Javadoc)
 	 * @see org.txm.importer.filters.Filter#SetUsedParam(java.lang.Object)
 	 */
Index: TXM/trunk/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/statsengine/data/ILexicalTable.java
===================================================================
--- TXM/trunk/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/statsengine/data/ILexicalTable.java	(revision 3384)
+++ TXM/trunk/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/statsengine/data/ILexicalTable.java	(revision 3385)
@@ -189,15 +189,6 @@
 	 */
 	public abstract List<Integer> getFreqs();
 	
-	/**
-	 * Export data.
-	 *
-	 * @param file the file
-	 * @param colseparator the colseparator
-	 * @param txtseparator the txtseparator
-	 */
-	public abstract void exportData(File file, String colseparator, String txtseparator);
-	
 	public abstract boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator);
 	
 	/**
