Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/ReferencePattern.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/ReferencePattern.java	(revision 3012)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/ReferencePattern.java	(revision 3013)
@@ -32,6 +32,8 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import org.apache.commons.lang.StringUtils;
 import org.txm.core.messages.TXMCoreMessages;
@@ -40,6 +42,7 @@
 import org.txm.searchengine.cqp.corpus.StructuralUnit;
 import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
 import org.txm.searchengine.cqp.corpus.VirtualProperty;
+import org.txm.searchengine.cqp.corpus.WordProperty;
 import org.txm.utils.logger.Log;
 
 import com.google.gson.Gson;
@@ -64,9 +67,27 @@
 	 */
 	@SuppressWarnings("unlikely-arg-type")
 	public static ReferencePattern stringToReferencePattern(CQPCorpus corpus, String v) {
+		ReferencePattern ref = fromGSonString(corpus, v);
+		if (ref == null) {
+			ref = fromPatternString(corpus, v);
+		}
+		if (ref == null) {
+			ref = fromTabulatedString(corpus, v);
+		}
+		return ref;
+	}
+	
+	/**
+	 * 
+	 * @param corpus
+	 * @param v
+	 * @return a list of word and structure properties read from a String
+	 */
+	@SuppressWarnings("unlikely-arg-type")
+	public static ReferencePattern fromGSonString(CQPCorpus corpus, String v) {
 		try {
 			Gson gson = new Gson();
-
+			
 			HashMap<?, ?> values = gson.fromJson(v, HashMap.class);
 			Object oProperties = values.get("properties");
 			Object oFormat = values.get("format");
@@ -104,12 +125,99 @@
 			return props;
 		}
 		catch (Exception e) {
-			System.out.println("Error: " + v + " property not found in " + corpus);
+			// System.out.println("Error: " + v + " property not found in " + corpus);
 			return null;
 		}
 	}
 	
 	/**
+	 * 
+	 * @param corpus
+	 * @param v "${strct_prop} like string"
+	 * @return
+	 */
+	protected static ReferencePattern fromPatternString(CQPCorpus corpus, String v) {
+		try {
+			ReferencePattern props = new ReferencePattern();
+			if (v == null) return props;
+			if (v.length() == 0) return props;
+			
+			Pattern pattern = Pattern.compile("\\$\\{([^\\}]+)\\}");
+			Matcher matcher = pattern.matcher(v);
+			int nPropExpected = 0;
+			while (matcher.find()) {
+				nPropExpected++;
+				String gg = matcher.group(1).trim();
+				String[] split = gg.split("_");
+				if (split.length == 2) {
+					String sstruct = split[0];
+					String sprop = split[1];
+					StructuralUnit struct = corpus.getStructuralUnit(sstruct);
+					if (struct != null) {
+						StructuralUnitProperty prop = struct.getProperty(sprop);
+						if (prop != null) {
+							props.addProperty(prop);
+						}
+					}
+				}
+				else if (split.length == 1) {
+					String sprop = split[0];
+					WordProperty prop = corpus.getProperty(sprop);
+					if (prop != null) {
+						props.addProperty(prop);
+					}
+				}
+			}
+			
+			if (nPropExpected > 0 && props.getProperties().size() == nPropExpected) {
+				props.setPattern(matcher.replaceAll("%s"));
+				return props;
+			}
+			else {
+				return null;
+			}
+		}
+		catch (Exception e) {
+			// System.out.println("Error: " + v + " property not found in " + corpus);
+			return null;
+		}
+	}
+	
+	protected static ReferencePattern fromTabulatedString(CQPCorpus corpus, String v) {
+		try {
+			ReferencePattern props = new ReferencePattern();
+			if (v == null) return props;
+			if (v.length() == 0) return props;
+			
+			String[] split = v.split("\t");
+			for (String s : split) {
+				s = s.trim();
+				if (s.contains("_")) {
+					String[] split2 = s.split("_", 2);
+					StructuralUnit su = corpus.getStructuralUnit(split2[0]);
+					if (su != null) {
+						Property prop = su.getProperty(split2[1]);
+						if (prop != null) {
+							props.addProperty(prop);
+						}
+					}
+				}
+				else {
+					Property prop = corpus.getProperty(s);
+					if (prop != null) {
+						props.addProperty(prop);
+					}
+				}
+			}
+			return props;
+		}
+		catch (Exception e) {
+			// System.out.println("Error: " + v + " property not found in " + corpus);
+			return null;
+		}
+	}
+	
+	/**
 	 * Instantiates a new reference pattern.
 	 */
 	public ReferencePattern() {
@@ -254,7 +362,8 @@
 		}
 		if (title.length() == 0) {
 			title = TXMCoreMessages.common_reference;
-		} else {
+		}
+		else {
 			title = title.substring(0, title.length() - 2);
 		}
 		return title;
@@ -267,7 +376,7 @@
 		}
 		
 		Gson gson = new Gson();
-		HashMap<String, Object> values = new HashMap<String, Object>();
+		HashMap<String, Object> values = new HashMap<>();
 		values.put("properties", names);
 		values.put("format", pattern.getPattern());
 		return gson.toJson(values);
