Index: TXM/trunk/org.txm.treesearch.core/build.properties
===================================================================
--- TXM/trunk/org.txm.treesearch.core/build.properties	(revision 0)
+++ TXM/trunk/org.txm.treesearch.core/build.properties	(revision 3313)
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               schema/

Property changes on: TXM/trunk/org.txm.treesearch.core/build.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.treesearch.core/plugin.xml
===================================================================
--- TXM/trunk/org.txm.treesearch.core/plugin.xml	(revision 0)
+++ TXM/trunk/org.txm.treesearch.core/plugin.xml	(revision 3313)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension-point id="org.txm.treesearch.TreeSearchSelector" name="org.txm.treesearch.TreeSearchSelector" schema="schema/org.txm.treesearch.TreeSearchSelector.exsd"/>
+   <extension
+         point="org.eclipse.core.runtime.preferences">
+      <initializer
+            class="org.txm.treesearch.preferences.TreeSearchPreferences">
+      </initializer>
+   </extension>
+
+</plugin>

Property changes on: TXM/trunk/org.txm.treesearch.core/plugin.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.treesearch.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- TXM/trunk/org.txm.treesearch.core/.settings/org.eclipse.jdt.core.prefs	(revision 0)
+++ TXM/trunk/org.txm.treesearch.core/.settings/org.eclipse.jdt.core.prefs	(revision 3313)
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8

Property changes on: TXM/trunk/org.txm.treesearch.core/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.treesearch.core/.classpath
===================================================================
--- TXM/trunk/org.txm.treesearch.core/.classpath	(revision 0)
+++ TXM/trunk/org.txm.treesearch.core/.classpath	(revision 3313)
@@ -0,0 +1,11 @@
+<?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-1.8"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Property changes on: TXM/trunk/org.txm.treesearch.core/.classpath
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.treesearch.core/META-INF/MANIFEST.MF
===================================================================
--- TXM/trunk/org.txm.treesearch.core/META-INF/MANIFEST.MF	(revision 0)
+++ TXM/trunk/org.txm.treesearch.core/META-INF/MANIFEST.MF	(revision 3313)
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.txm.treesearch.core
+Bundle-SymbolicName: org.txm.treesearch.core;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Automatic-Module-Name: org.txm.treesearch.rcp
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Export-Package: org.txm.treesearch.function,
+ org.txm.treesearch.preferences
+Require-Bundle: org.txm.core;bundle-version="0.8.2";visibility:=reexport,
+ org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport

Property changes on: TXM/trunk/org.txm.treesearch.core/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.treesearch.core/schema/org.txm.treesearch.TreeSearchSelector.exsd
===================================================================
--- TXM/trunk/org.txm.treesearch.core/schema/org.txm.treesearch.TreeSearchSelector.exsd	(revision 0)
+++ TXM/trunk/org.txm.treesearch.core/schema/org.txm.treesearch.TreeSearchSelector.exsd	(revision 3313)
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.txm.treesearch.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appinfo>
+         <meta.schema plugin="org.txm.treesearch.core" id="org.txm.treesearch.TreeSearchSelector" name="org.txm.treesearch.TreeSearchSelector"/>
+      </appinfo>
+      <documentation>
+         [Enter description of this extension point.]
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element />
+         </appinfo>
+      </annotation>
+      <complexType>
+         <choice>
+            <element ref="TreeSearchSelector"/>
+         </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="TreeSearchSelector">
+      <complexType>
+         <attribute name="class" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="java" basedOn="org.txm.treesearch.TreeSearchSelector:"/>
+               </appinfo>
+            </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>

Property changes on: TXM/trunk/org.txm.treesearch.core/schema/org.txm.treesearch.TreeSearchSelector.exsd
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.treesearch.core/preferences/TreeSearchPreferencePage.java
===================================================================
--- TXM/trunk/org.txm.treesearch.core/preferences/TreeSearchPreferencePage.java	(revision 0)
+++ TXM/trunk/org.txm.treesearch.core/preferences/TreeSearchPreferencePage.java	(revision 3313)
@@ -0,0 +1,33 @@
+package org.txm.tigersearch.rcp.preferences;
+
+import org.eclipse.ui.IWorkbench;
+import org.txm.rcp.IImageKeys;
+import org.txm.rcp.preferences.TXMPreferencePage;
+import org.txm.rcp.preferences.TXMPreferenceStore;
+
+/**
+ * TIGERSearch preference page
+ * @author mdecorde
+ *
+ */
+public class TreeSearchPreferencePage extends TXMPreferencePage {
+
+	@Override
+	public void createFieldEditors() {
+//		this.addField(new ComboFieldEditor(TIGERSearchPreferences.METHOD, "Method", methods, chartsTab));
+//		this.addField(new BooleanFieldEditor(TIGERSearchPreferences.GROUP_BY_TEXTS, "Group by words", chartsTab));
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+	 */
+	@Override
+	public void init(IWorkbench workbench) {
+		this.setPreferenceStore(new TXMPreferenceStore(TreeSearchPreferences.getInstance().getPreferencesNodeQualifier()));
+		this.setDescription("Syntax Tree");
+		this.setImageDescriptor(IImageKeys.getImageDescriptor(this.getClass(), "icons/functions/Tree.png"));
+	}
+}
\ No newline at end of file

Property changes on: TXM/trunk/org.txm.treesearch.core/preferences/TreeSearchPreferencePage.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.treesearch.core/preferences/TreeSearchPreferences.java
===================================================================
--- TXM/trunk/org.txm.treesearch.core/preferences/TreeSearchPreferences.java	(revision 0)
+++ TXM/trunk/org.txm.treesearch.core/preferences/TreeSearchPreferences.java	(revision 3313)
@@ -0,0 +1,47 @@
+package org.txm.tigersearch.rcp.preferences;
+
+
+import org.osgi.service.prefs.Preferences;
+import org.txm.core.preferences.TXMPreferences;
+
+/**
+ * Preferences initializer and manager.
+ * 
+ * @author mdecorde
+ *
+ */
+public class TreeSearchPreferences extends TXMPreferences {
+	
+	
+	public static String VERSION = "version";
+	
+	public static String USESUBMATCHES = "use_sub_matches";
+	
+	public static String UDPREFIX = "ud_prefix";
+	
+	/**
+	 * Gets the instance.
+	 * 
+	 * @return the instance
+	 */
+	public static TXMPreferences getInstance() {
+		if (!TXMPreferences.instances.containsKey(TreeSearchPreferences.class)) {
+			new TreeSearchPreferences();
+		}
+		return TXMPreferences.instances.get(TreeSearchPreferences.class);
+	}
+	
+	
+	@Override
+	public void initializeDefaultPreferences() {
+		super.initializeDefaultPreferences();
+		
+		Preferences preferences = this.getDefaultPreferencesNode();
+		preferences.putBoolean(USESUBMATCHES, true);
+		preferences.put(UDPREFIX, "ud-");
+		// preferences.putBoolean(GROUP_BY_TEXTS, true);
+		// preferences.putInt(METHOD, 2);
+	}
+}
+
+

Property changes on: TXM/trunk/org.txm.treesearch.core/preferences/TreeSearchPreferences.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.treesearch.core/.project
===================================================================
--- TXM/trunk/org.txm.treesearch.core/.project	(revision 0)
+++ TXM/trunk/org.txm.treesearch.core/.project	(revision 3313)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.treesearch.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>

Property changes on: TXM/trunk/org.txm.treesearch.core/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.treesearch.core/src/org/txm/treesearch/function/TreeSearch.java
===================================================================
--- TXM/trunk/org.txm.treesearch.core/src/org/txm/treesearch/function/TreeSearch.java	(revision 0)
+++ TXM/trunk/org.txm.treesearch.core/src/org/txm/treesearch/function/TreeSearch.java	(revision 3313)
@@ -0,0 +1,145 @@
+package org.txm.treesearch.function;
+
+import java.io.File;
+
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.core.results.Parameter;
+import org.txm.core.results.TXMParameters;
+import org.txm.core.results.TXMResult;
+import org.txm.searchengine.core.IQuery;
+import org.txm.searchengine.cqp.corpus.CQPCorpus;
+import org.txm.treesearch.preferences.TreeSearchPreferences;
+
+public abstract class TreeSearch extends TXMResult {
+	
+	protected CQPCorpus corpus;
+	
+	/**
+	 * from 0 to N-1 sentences
+	 */
+	@Parameter(key = TXMPreferences.INDEX)
+	protected int index;
+	
+	/**
+	 * from 0 to N-1 sentence subgraphs
+	 */
+	@Parameter(key = TXMPreferences.SUB_INDEX)
+	protected int subIndex;
+
+	@Parameter(key = TXMPreferences.QUERY)
+	protected IQuery pQuery;
+	
+	@Parameter(key = TreeSearchPreferences.TFEATURE)
+	protected String T;
+	
+	@Parameter(key = TreeSearchPreferences.NTFEATURE)
+	protected String NT;
+	
+
+	public TreeSearch(CQPCorpus corpus) {
+		
+		this(null, corpus);
+	}
+	
+	public TreeSearch(String parentNodePath) {
+		
+		this(parentNodePath, null);
+	}
+	
+	public TreeSearch(String parentNodePath, CQPCorpus corpus) {
+		
+		super(parentNodePath, corpus);
+	}
+	
+	@Override
+	public boolean canCompute() {
+		
+		return corpus != null; // && pQuery != null && pQuery.length() > 0; // if pQuery is empty/null set a default query
+	}
+	
+	public abstract String[] getAvailableNTProperties();
+	
+	public abstract String[] getAvailableTProperties();
+	
+	public CQPCorpus getCorpus() {
+		
+		return corpus;
+	}
+	
+	@Override
+	public String getDetails() {
+		
+		if (pQuery != null) {
+			return pQuery.toString();
+		}
+		return "no query";
+	}
+	
+	@Override
+	public String getName() {
+		
+		if (pQuery != null) {
+			return pQuery.toString();
+		}
+		return "no query";
+	}
+	
+	public abstract int getNSentences();
+	
+	public abstract int getNSubGraph(int matchNo);
+	
+	public final String getNT() {
+		return NT;
+	}
+	
+	public abstract String getQuery();
+	
+	@Override
+	public String getSimpleName() {
+		
+		if (pQuery != null) {
+			return pQuery.toString();
+		}
+		return "no query";
+	}
+	
+	public abstract int getSub(int matchNo);
+	
+	public final String getT() {
+		return T;
+	}
+	
+	public abstract boolean hasSubMatchesStrategy();
+	
+	@Override
+	public abstract boolean setParameters(TXMParameters parameters);
+	
+	public abstract boolean toSVG(File svgFile, int sent, int sub, String T, String NT);
+
+	public abstract boolean isReady();
+
+	public abstract void setIndexAndSubIndex(int sent, int sub);
+
+	public abstract boolean isComputed();
+
+	public abstract boolean isDrawn();
+
+	public abstract String getEngine();
+
+	public abstract TreeSearchSelector getSelector();
+	
+	public abstract String[] getTextAndWordIDSOfCurrentSentence() throws Exception;
+	
+	public abstract String getIconPath();
+
+	public int getCurrentMatchIndex() {
+		
+		return index;
+	}
+
+	public int getCurrentSubMatchIndex() {
+		
+		return this.subIndex;
+	}
+	
+}

Property changes on: TXM/trunk/org.txm.treesearch.core/src/org/txm/treesearch/function/TreeSearch.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.treesearch.core/src/org/txm/treesearch/function/TreeSearchSelector.java
===================================================================
--- TXM/trunk/org.txm.treesearch.core/src/org/txm/treesearch/function/TreeSearchSelector.java	(revision 0)
+++ TXM/trunk/org.txm.treesearch.core/src/org/txm/treesearch/function/TreeSearchSelector.java	(revision 3313)
@@ -0,0 +1,19 @@
+package org.txm.treesearch.function;
+
+import org.txm.searchengine.core.Query;
+import org.txm.searchengine.cqp.corpus.CQPCorpus;
+
+public abstract class TreeSearchSelector {
+	
+	public TreeSearchSelector() {
+		
+	}
+	
+	public abstract String getEngine();
+	
+	public abstract boolean canComputeWith(CQPCorpus corpus);
+
+	public abstract TreeSearch getTreeSearch(CQPCorpus corpus);
+
+	public abstract Class<? extends Query> getQueryClass();
+}

Property changes on: TXM/trunk/org.txm.treesearch.core/src/org/txm/treesearch/function/TreeSearchSelector.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.treesearch.core/src/org/txm/treesearch/preferences/TreeSearchPreferences.java
===================================================================
--- TXM/trunk/org.txm.treesearch.core/src/org/txm/treesearch/preferences/TreeSearchPreferences.java	(revision 0)
+++ TXM/trunk/org.txm.treesearch.core/src/org/txm/treesearch/preferences/TreeSearchPreferences.java	(revision 3313)
@@ -0,0 +1,42 @@
+package org.txm.treesearch.preferences;
+
+
+import org.osgi.service.prefs.Preferences;
+import org.txm.core.preferences.TXMPreferences;
+
+/**
+ * Preferences initializer and manager.
+ * 
+ * @author mdecorde
+ *
+ */
+public class TreeSearchPreferences extends TXMPreferences {
+	
+	public static final String VERSION = "version";
+	
+	public static final String DEFAULT_REPRESENTATION = "default_representation";
+	
+	public static final String TFEATURE = "t";
+	
+	public static final String NTFEATURE = "nt";
+	
+	/**
+	 * Gets the instance.
+	 * 
+	 * @return the instance
+	 */
+	public static TXMPreferences getInstance() {
+		if (!TXMPreferences.instances.containsKey(TreeSearchPreferences.class)) {
+			new TreeSearchPreferences();
+		}
+		return TXMPreferences.instances.get(TreeSearchPreferences.class);
+	}
+	
+	@Override
+	public void initializeDefaultPreferences() {
+		super.initializeDefaultPreferences();
+		
+		Preferences preferences = this.getDefaultPreferencesNode();
+		preferences.put(DEFAULT_REPRESENTATION, "TIGER");
+	}
+}

Property changes on: TXM/trunk/org.txm.treesearch.core/src/org/txm/treesearch/preferences/TreeSearchPreferences.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

