Revision: 17946
          http://sourceforge.net/p/gate/code/17946
Author:   ian_roberts
Date:     2014-05-10 22:34:46 +0000 (Sat, 10 May 2014)
Log Message:
-----------
Merged ORG changes from trunk

Modified Paths:
--------------
    gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/build.xml
    gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/creole.xml
    
gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/resources/exampleApp.xgapp
    
gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/src/gate/clone/ql/OntoRootGaz.java
    gate/branches/release-8.0/src/main/gate/gui/GazetteerEditor.java

Removed Paths:
-------------
    
gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/src/gate/clone/ql/FakeSentenceSplitter.java

Property Changed:
----------------
    gate/branches/release-8.0/
    gate/branches/release-8.0/plugins/
    gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/
    
gate/branches/release-8.0/plugins/Ontology_Tools/src/com/ontotext/gate/vr/Gaze.java
    
gate/branches/release-8.0/plugins/Ontology_Tools/src/com/ontotext/gate/vr/GeneralEditorException.java
    
gate/branches/release-8.0/plugins/Ontology_Tools/src/com/ontotext/gate/vr/MappingTreeView.java
    gate/branches/release-8.0/plugins/TermRaider/
    gate/branches/release-8.0/src/

Index: gate/branches/release-8.0
===================================================================
--- gate/branches/release-8.0   2014-05-10 22:32:58 UTC (rev 17945)
+++ gate/branches/release-8.0   2014-05-10 22:34:46 UTC (rev 17946)

Property changes on: gate/branches/release-8.0
___________________________________________________________________
Modified: svn:mergeinfo
## -3,3 +3,4 ##
 /gate/branches/release-7.1:16361,16363
 /gate/branches/sawdust:17055-17079
 /gate/tags/release-7.0:15399-15407
+/gate/trunk:17943-17944
\ No newline at end of property
Index: gate/branches/release-8.0/plugins
===================================================================
--- gate/branches/release-8.0/plugins   2014-05-10 22:32:58 UTC (rev 17945)
+++ gate/branches/release-8.0/plugins   2014-05-10 22:34:46 UTC (rev 17946)

Property changes on: gate/branches/release-8.0/plugins
___________________________________________________________________
Modified: svn:mergeinfo
## -2,4 +2,4 ##
 /gate/branches/release-7.0/plugins:15335-15398
 /gate/branches/sawdust/plugins:17055-17079
 /gate/tags/release-7.0/plugins:15399-15407
-/gate/trunk/plugins:3-390
+/gate/trunk/plugins:3-390,17944
\ No newline at end of property
Index: gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based
===================================================================
--- gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based  2014-05-10 
22:32:58 UTC (rev 17945)
+++ gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based  2014-05-10 
22:34:46 UTC (rev 17946)

Property changes on: gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based
___________________________________________________________________
Modified: svn:mergeinfo
## -1,3 +1,4 ##
 /gate/branches/new-ontology-api/plugins/Ontology_Based_Gazetteer:10584-11598
 /gate/branches/sawdust/plugins/Gazetteer_Ontology_Based:17055-17079
+/gate/trunk/plugins/Gazetteer_Ontology_Based:17944
 /gate/trunk/plugins/Ontology_Based_Gazetteer:3-390
\ No newline at end of property
Modified: gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/build.xml
===================================================================
--- gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/build.xml        
2014-05-10 22:32:58 UTC (rev 17945)
+++ gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/build.xml        
2014-05-10 22:34:46 UTC (rev 17946)
@@ -41,7 +41,7 @@
   <target name="compile" depends="init"
         description="compile the source " >
     <!-- Compile the java code from ${src} into ${build} -->
-    <javac srcdir="${src}" destdir="${build}" debug="true" source="1.6" 
target="1.6">
+    <javac srcdir="${src}" destdir="${build}" debug="true" source="1.7" 
target="1.7">
      <classpath refid="classpath"/> 
         <compilerarg value="-Xmaxwarns" />
         <compilerarg value="${gate.compile.maxwarnings}" />

Modified: gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/creole.xml
===================================================================
--- gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/creole.xml       
2014-05-10 22:32:58 UTC (rev 17945)
+++ gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/creole.xml       
2014-05-10 22:34:46 UTC (rev 17946)
@@ -1,136 +1,6 @@
 <?xml version="1.0"?>
 <!-- creole.xml for Ontology_Based_Gazetteer plugin -->
 <CREOLE-DIRECTORY>
-  <CREOLE>   
-  <JAR>obg.jar</JAR>
+  <JAR SCAN="true">obg.jar</JAR>
   <JAR>lib/oro-2.0.8.jar</JAR>
-       <!-- creole.xml for Onto Root gazetteer -->
-       <RESOURCE>
-               <NAME>Onto Root Gazetteer</NAME>
-               <CLASS>gate.clone.ql.OntoRootGaz</CLASS>
-               <COMMENT>
-                       A ontology  lookup component
-               </COMMENT>
-    <HELPURL>http://gate.ac.uk/userguide/sec:gazetteers:ontoRootGaz</HELPURL>
-       <PARAMETER NAME="ontology"
-                       COMMENT="The Ontology to be used" 
-                       >gate.creole.ontology.Ontology
-       </PARAMETER>
-       <PARAMETER NAME="tokeniser"
-               COMMENT="The internal tokeniser">
-               gate.creole.tokeniser.DefaultTokeniser
-       </PARAMETER>
-       <PARAMETER NAME="posTagger"
-               COMMENT="The internal POS Tagger">
-               gate.creole.POSTagger
-       </PARAMETER>
-       <PARAMETER NAME="morpher"
-               COMMENT="The internal Morphological Analyser">
-               gate.creole.morph.Morph
-       </PARAMETER>                    
-       <PARAMETER NAME="document" RUNTIME="true"
-                       COMMENT="The document to be processed">
-                       gate.Document
-       </PARAMETER>
-       <PARAMETER NAME="separateCamelCasedWords"
-                       DEFAULT="true"
-       COMMENT="Should this gazetteer separate camelCased words, e.g. 
ProjectName into Project Name">
-       java.lang.Boolean
-       </PARAMETER>
-       <PARAMETER NAME="considerHeuristicRules"
-                       DEFAULT="false"
-       COMMENT="Should this gazetteer consider several heuristic rules or not:
-       the words containing spaces will be split; for example, if
-    'pos tagger for spanish' would be analysed, 'for' would be consider as a 
stop
-    word; heuristically derived would be
-    'pos tagger' and this would be further used to add 'pos tagger' with
-    heuristical level 0, and 'tagger' with hl 1 to the gazetteer list;
-    at runtime lower heuristical level should be prefered">
-       java.lang.Boolean
-       </PARAMETER>
-       <PARAMETER NAME="useResourceUri"
-                       DEFAULT="true"
-       COMMENT="Should this gazetteer use resource URIs or not">
-       java.lang.Boolean
-       </PARAMETER>
-    <PARAMETER NAME="considerProperties"
-                       DEFAULT="true"
-       COMMENT="Should this gazetteer consider properties or not">
-       java.lang.Boolean
-       </PARAMETER>
-       <PARAMETER NAME="propertiesToInclude" OPTIONAL="true"
-                       DEFAULT=""
-       COMMENT="The list of property names to be included, comma separated">
-       java.lang.String
-       </PARAMETER>
-       <PARAMETER NAME="propertiesToExclude" OPTIONAL="true"
-               DEFAULT=""
-       COMMENT="The list of property names to be excluded, comma separated">
-       java.lang.String
-       </PARAMETER>
-       <PARAMETER NAME="typesToConsider" OPTIONAL="true"
-               DEFAULT="class;instance;property"
-       COMMENT="The list of types to be included. Possible values: instance, 
class, property">
-       java.util.Set
-       </PARAMETER>
-       <PARAMETER NAME="caseSensitive"
-       DEFAULT="false"
-       COMMENT="Should this gazetteer diferentiate on case">
-       java.lang.Boolean
-       </PARAMETER>
-       <PARAMETER NAME="annotationSetName" RUNTIME="true"
-       COMMENT="The annotation set to be used for the generated annotations"
-       OPTIONAL="true">
-       java.lang.String
-       </PARAMETER>
-       <PARAMETER NAME="wholeWordsOnly"
-       DEFAULT="true"
-               COMMENT="Should this gazetteer only match whole words"
-       RUNTIME="true">
-               java.lang.Boolean
-       </PARAMETER>
-       <PARAMETER NAME="longestMatchOnly"
-       DEFAULT="true"
-       COMMENT="Should this gazetteer only match the longest string starting 
from any offset?"
-       RUNTIME="true">
-       java.lang.Boolean
-       </PARAMETER>
-               <ICON>gazetteer</ICON>
-       </RESOURCE>    
-   </CREOLE>
-   
-    <!-- creole.xml for Fake Sentence Splitter-->
-    <RESOURCE>
-       <NAME>Fake Sentence Splitter</NAME>
-       <COMMENT>
-               Fake Sentence Splitter is used by Onto Root Gazetteer 
internally as it 
-    creates 'fake' annotation type 'Sentence' without analysing the text by 
-    a proper Sentence Splitter. The reason for doing this is enabling the
-    POS Tagger to work properly, as the input text is usually not a proper 
-    sentence (i.e. ontology resource name or label). 'Faking' sentence 
splitting
-    optimises the processing as Onto Root Gazetteer usually does not process 
-    internally any multisentence text.
-       </COMMENT>
-       <CLASS>gate.clone.ql.FakeSentenceSplitter</CLASS>
-       <PARAMETER COMMENT="The document to be processed"
-               NAME="document" RUNTIME="true">
-               gate.Document
-       </PARAMETER>
-       <PARAMETER NAME="inputASName"
-               COMMENT="The name used for the temporary annotation set"
-               RUNTIME="true" OPTIONAL="true">
-               java.lang.String
-       </PARAMETER>
-       <PARAMETER NAME="outputASName"
-               COMMENT="The name used for the temporary annotation set"
-               RUNTIME="true" OPTIONAL="true">
-               java.lang.String
-       </PARAMETER>
-       <PARAMETER NAME="encoding"
-               COMMENT="The encoding used for reading the definition files"
-               DEFAULT="UTF-8">
-               java.lang.String
-       </PARAMETER>
-       <ICON>sentence-splitter</ICON>
-    </RESOURCE>
 </CREOLE-DIRECTORY>

Modified: 
gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/resources/exampleApp.xgapp
===================================================================
--- 
gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/resources/exampleApp.xgapp
       2014-05-10 22:32:58 UTC (rev 17945)
+++ 
gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/resources/exampleApp.xgapp
       2014-05-10 22:34:46 UTC (rev 17946)
@@ -2,19 +2,19 @@
   <urlList class="gate.util.persistence.CollectionPersistence">
     <localList>
       <gate.util.persistence.PersistenceManager-URLHolder>
-        <urlString>$relpath$../../Tools</urlString>
+        <urlString>$relpath$../../Tools/</urlString>
       </gate.util.persistence.PersistenceManager-URLHolder>
       <gate.util.persistence.PersistenceManager-URLHolder>
-        <urlString>$relpath$../../ANNIE</urlString>
+        <urlString>$relpath$../../ANNIE/</urlString>
       </gate.util.persistence.PersistenceManager-URLHolder>
       <gate.util.persistence.PersistenceManager-URLHolder>
-        <urlString>$relpath$../../Ontology_Tools</urlString>
+        <urlString>$relpath$../../Ontology_Tools/</urlString>
       </gate.util.persistence.PersistenceManager-URLHolder>
      <gate.util.persistence.PersistenceManager-URLHolder>
-        <urlString>$relpath$../../Ontology</urlString>
+        <urlString>$relpath$../../Ontology/</urlString>
       </gate.util.persistence.PersistenceManager-URLHolder>      
       <gate.util.persistence.PersistenceManager-URLHolder>
-        <urlString>$relpath$../../Gazetteer_Ontology_Based</urlString>
+        <urlString>$relpath$../</urlString>
       </gate.util.persistence.PersistenceManager-URLHolder>
     </localList>
     <collectionType>java.util.ArrayList</collectionType>
@@ -197,18 +197,33 @@
                     <mapType>gate.util.SimpleFeatureMapImpl</mapType>
                     <localMap>
                       <entry>
-                        <string>tokeniser</string>
-                        <gate.util.persistence.LanguageAnalyserPersistence 
reference="../../../../../../../../../gate.util.persistence.LanguageAnalyserPersistence"/>
+                        <string>rootFinderApplication</string>
+                        
<gate.util.persistence.SerialAnalyserControllerPersistence>
+                          <prList 
class="gate.util.persistence.CollectionPersistence">
+                            <localList>
+                              
<gate.util.persistence.LanguageAnalyserPersistence 
reference="../../../../../../../../../../../../gate.util.persistence.LanguageAnalyserPersistence"/>
+                              
<gate.util.persistence.LanguageAnalyserPersistence 
reference="../../../../../../../../../../../../gate.util.persistence.LanguageAnalyserPersistence[3]"/>
+                              <gate.util.persistence.PRPersistence 
reference="../../../../../../../../../../../../gate.util.persistence.PRPersistence[2]"/>
+                            </localList>
+                            
<collectionType>java.util.ArrayList</collectionType>
+                          </prList>
+                          
<resourceType>gate.creole.SerialAnalyserController</resourceType>
+                          <resourceName>Root finder application for 
OntoRootGazetteer</resourceName>
+                          <initParams 
class="gate.util.persistence.MapPersistence">
+                            <mapType>gate.util.SimpleFeatureMapImpl</mapType>
+                            <localMap/>
+                          </initParams>
+                          <features 
class="gate.util.persistence.MapPersistence">
+                            <mapType>gate.util.SimpleFeatureMapImpl</mapType>
+                            <localMap/>
+                          </features>
+                        
</gate.util.persistence.SerialAnalyserControllerPersistence>
                       </entry>
                       <entry>
                         <string>caseSensitive</string>
                         <boolean>false</boolean>
                       </entry>
                       <entry>
-                        <string>morpher</string>
-                        <gate.util.persistence.PRPersistence 
reference="../../../../../../../../../gate.util.persistence.PRPersistence[2]"/>
-                      </entry>
-                      <entry>
                         <string>ontology</string>
                         <gate.util.persistence.LRPersistence>
                           
<resourceType>gate.creole.ontology.owlim.OWLIMOntologyLR</resourceType>
@@ -231,10 +246,6 @@
                         </gate.util.persistence.LRPersistence>
                       </entry>
                       <entry>
-                        <string>posTagger</string>
-                        <gate.util.persistence.LanguageAnalyserPersistence 
reference="../../../../../../../../../gate.util.persistence.LanguageAnalyserPersistence[3]"/>
-                      </entry>
-                      <entry>
                         <string>useResourceUri</string>
                         <boolean>true</boolean>
                       </entry>

Deleted: 
gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/src/gate/clone/ql/FakeSentenceSplitter.java
===================================================================
--- 
gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/src/gate/clone/ql/FakeSentenceSplitter.java
      2014-05-10 22:32:58 UTC (rev 17945)
+++ 
gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/src/gate/clone/ql/FakeSentenceSplitter.java
      2014-05-10 22:34:46 UTC (rev 17946)
@@ -1,124 +0,0 @@
-/*
- *  FakeSentenceSplitter.java
- *
- *  Copyright (c) 1995-2012, The University of Sheffield. See the file
- *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
- *
- *  This file is part of GATE (see http://gate.ac.uk/), and is free
- *  software, licenced under the GNU Library General Public License,
- *  Version 2, June 1991 (in the distribution as file licence.html,
- *  and also available at http://gate.ac.uk/gate/licence.html).
- */
-package gate.clone.ql;
-
-import gate.AnnotationSet;
-import gate.Factory;
-import gate.Resource;
-import gate.creole.AbstractLanguageAnalyser;
-import gate.creole.ExecutionException;
-import gate.creole.ResourceInstantiationException;
-import gate.util.GateRuntimeException;
-import gate.util.InvalidOffsetException;
-
-/**
- * This class serves to simulate running of default SentenceSplitter: it will
- * always create one sentence out of any document. It is created so that in
- * cases when processing one sentence always, we don't need to run regular
- * Sentence Splitter, in order to run a POS Tagger.
- * 
- * @author Danica Damljanovic
- * 
- */
-public class FakeSentenceSplitter extends AbstractLanguageAnalyser {
-
-  private static final long serialVersionUID = 9202556754479248757L;
-
-  public static final String SPLIT_DOCUMENT_PARAMETER_NAME = "document";
-
-  public static final String SPLIT_INPUT_AS_PARAMETER_NAME = "inputASName";
-
-  public static final String SPLIT_OUTPUT_AS_PARAMETER_NAME = "outputASName";
-
-  public static final String SPLIT_ENCODING_PARAMETER_NAME = "encoding";
-
-  public static final String SPLIT_GAZ_URL_PARAMETER_NAME = 
"gazetteerListsURL";
-
-  public static final String SPLIT_TRANSD_URL_PARAMETER_NAME = "transducerURL";
-
-  public Resource init() throws ResourceInstantiationException {
-    return this;
-  }
-
-  public void execute() throws ExecutionException {
-    interrupted = false;
-    // set the runtime parameters
-    if(inputASName != null && inputASName.equals("")) inputASName = null;
-    if(outputASName != null && outputASName.equals("")) outputASName = null;
-
-    // get pointers to the annotation sets
-    AnnotationSet inputAS =
-      (inputASName == null) ? document.getAnnotations() : document
-        .getAnnotations(inputASName);
-
-    AnnotationSet outputAS =
-      (outputASName == null) ? document.getAnnotations() : document
-        .getAnnotations(outputASName);
-
-    // copy the results to the output set if they are different
-    if(inputAS != outputAS) {
-      outputAS.addAll(inputAS.get(SENTENCE_ANNOTATION_TYPE));
-    }
-
-    // create one big sentence if none were found
-    AnnotationSet sentences = outputAS.get(SENTENCE_ANNOTATION_TYPE);
-    if(sentences == null || sentences.isEmpty()) {
-      // create an annotation covering the entire content
-      try {
-        outputAS.add(new Long(0), document.getContent().size(),
-          SENTENCE_ANNOTATION_TYPE, Factory.newFeatureMap());
-      }
-      catch(InvalidOffsetException ioe) {
-        throw new GateRuntimeException(ioe);
-      }
-    }
-  }// execute()
-
-  /**
-   * Notifies all the PRs in this controller that they should stop their
-   * execution as soon as possible.
-   */
-  public synchronized void interrupt() {
-    interrupted = true;
-  }
-
-  private String encoding;
-
-  public void setEncoding(String newEncoding) {
-    encoding = newEncoding;
-  }
-
-  public String getEncoding() {
-    return encoding;
-  }
-
-  public void setInputASName(String newInputASName) {
-    inputASName = newInputASName;
-  }
-
-  public String getInputASName() {
-    return inputASName;
-  }
-
-  public void setOutputASName(String newOutputASName) {
-    outputASName = newOutputASName;
-  }
-
-  public String getOutputASName() {
-    return outputASName;
-  }
-
-  private String inputASName;
-
-  private String outputASName;
-
-}

Modified: 
gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/src/gate/clone/ql/OntoRootGaz.java
===================================================================
--- 
gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/src/gate/clone/ql/OntoRootGaz.java
       2014-05-10 22:32:58 UTC (rev 17945)
+++ 
gate/branches/release-8.0/plugins/Gazetteer_Ontology_Based/src/gate/clone/ql/OntoRootGaz.java
       2014-05-10 22:34:46 UTC (rev 17946)
@@ -12,11 +12,13 @@
 
 import gate.Annotation;
 import gate.Corpus;
+import gate.CorpusController;
 import gate.Document;
 import gate.Factory;
 import gate.FeatureMap;
 import gate.Gate;
 import gate.Resource;
+import gate.Utils;
 import gate.clone.ql.regex.ExpressionFinder;
 import gate.creole.ANNIEConstants;
 import gate.creole.ExecutionException;
@@ -27,12 +29,19 @@
 import gate.creole.gazetteer.FSMState;
 import gate.creole.gazetteer.LinearDefinition;
 import gate.creole.gazetteer.Lookup;
+import gate.creole.metadata.CreoleParameter;
+import gate.creole.metadata.CreoleResource;
+import gate.creole.metadata.HiddenCreoleParameter;
+import gate.creole.metadata.Optional;
+import gate.creole.metadata.RunTime;
 import gate.creole.morph.Morph;
 import gate.creole.ontology.InvalidURIException;
 import gate.creole.ontology.Ontology;
 import gate.creole.tokeniser.DefaultTokeniser;
+import gate.util.InvalidOffsetException;
 import gate.util.OffsetComparator;
 
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -48,18 +57,23 @@
 /**
  * @author Danica Damljanovic
  */
+@CreoleResource(name = "Onto Root Gazetteer",
+    comment = "An ontology lookup component",
+    helpURL = "http://gate.ac.uk/userguide/sec:gazetteers:ontoRootGaz";,
+    icon = "gazetteer")
 public class OntoRootGaz extends DefaultGazetteer {
   private static final long serialVersionUID = 0L;
 
+  @Deprecated
   protected POSTagger posTagger;
 
+  @Deprecated
   protected DefaultTokeniser tokeniser;
 
-  protected FakeSentenceSplitter sentenceSplitter;
-
+  @Deprecated
   protected Morph morpher;
 
-  protected SerialAnalyserController rootFinderApplication;
+  protected CorpusController rootFinderApplication;
 
   protected OffsetComparator offsetComparator;
 
@@ -132,6 +146,10 @@
     return typesToConsider;
   }
 
+  @RunTime
+  @CreoleParameter(defaultValue = "class;instance;property",
+      comment = "The list of types to be included. Possible values: "
+          + "instance, class, property")
   public void setTypesToConsider(Set<String> typesToConsider) {
     this.typesToConsider = typesToConsider;
   }
@@ -160,19 +178,21 @@
     long startedInit = System.currentTimeMillis();
     List<String> propertiesToIncludeList = new ArrayList<String>();
     List<String> propertiesToExcludeList = new ArrayList<String>();
-    if(tokeniser == null)
-      throw new ResourceInstantiationException("No tokeniser provided!");
-    if(sentenceSplitter == null) {
-      sentenceSplitter =
-          (FakeSentenceSplitter)Factory
-              .createResource("gate.clone.ql.FakeSentenceSplitter");
+    if(rootFinderApplication == null) {
+      if(tokeniser != null && posTagger != null & morpher != null) {
+        logger.warn("No rootFinderApplication provided, but found old-style "
+            + "separate parameters for tokeniser, POS tagger and morpher. "
+            + "Constructing an application from these.");
+        rootFinderApplication =
+            (CorpusController)Factory.createResource(
+                "gate.creole.SerialAnalyserController",
+                Factory.newFeatureMap(), Factory.newFeatureMap(),
+                "Root finder application for " + getName());
+        ((SerialAnalyserController)rootFinderApplication).add(tokeniser);
+        ((SerialAnalyserController)rootFinderApplication).add(posTagger);
+        ((SerialAnalyserController)rootFinderApplication).add(morpher);
+      }
     }
-    if(posTagger == null)
-      throw new ResourceInstantiationException(
-          "No Part-of-speach Tagger provided!");
-    if(morpher == null)
-      throw new ResourceInstantiationException(
-          "No Morphological Analyzer provided!");
     if(ontology == null) {
       throw new ResourceInstantiationException("No ontology provided!");
     } else {
@@ -191,17 +211,6 @@
     }
     fsmStates = new HashSet<FSMState>();
     initialState = new FSMState(this);
-    /* set the hidden feature to true */
-    FeatureMap features = Factory.newFeatureMap();
-    FeatureMap parameters = Factory.newFeatureMap();
-    Gate.setHiddenAttribute(features, true);
-    rootFinderApplication =
-        (SerialAnalyserController)Factory.createResource(
-            "gate.creole.SerialAnalyserController", parameters, features);
-    rootFinderApplication.add(tokeniser);
-    rootFinderApplication.add(sentenceSplitter);
-    rootFinderApplication.add(posTagger);
-    rootFinderApplication.add(morpher);
     /* create a corpus and hide it inside the GATE GUI */
     FeatureMap corpusParams = Factory.newFeatureMap();
     corpusParams.put("name", this.getClass().getCanonicalName());
@@ -210,7 +219,6 @@
     applicationCorpus =
         (Corpus)Factory.createResource("gate.corpora.CorpusImpl", corpusParams,
             corpusFeatures);
-    rootFinderApplication.setCorpus(applicationCorpus);
     offsetComparator = new OffsetComparator();
     /*
      * move properties to include and exclude from the list of CSV to the 
actual
@@ -517,14 +525,6 @@
     /* release GATE resources */
     Factory.deleteResource(applicationCorpus);
     applicationCorpus = null;
-    rootFinderApplication.remove(morpher);
-    rootFinderApplication.remove(posTagger);
-    rootFinderApplication.remove(sentenceSplitter);
-    Factory.deleteResource(sentenceSplitter);
-    sentenceSplitter = null;
-    rootFinderApplication.remove(tokeniser);
-    Factory.deleteResource(rootFinderApplication);
-    rootFinderApplication = null;
     long currentTime = System.currentTimeMillis();
     logger.info("OntoRootGaz initialized for:" + (currentTime - startedInit)
         + " ms");
@@ -660,9 +660,21 @@
           aDocument =
               (Document)Factory.createResource("gate.corpora.DocumentImpl",
                   docParams, docFeatures);
+          // add spanning Sentence annotation
+          aDocument.getAnnotations().add(Utils.start(aDocument),
+              Utils.end(aDocument), SENTENCE_ANNOTATION_TYPE,
+              Factory.newFeatureMap());
           applicationCorpus.add(aDocument);
-          rootFinderApplication.execute();
-        } catch(ExecutionException ee) {
+          // be nice - save the old corpus parameter from the RFA and restore
+          // it after running
+          Corpus rootFinderCorpus = rootFinderApplication.getCorpus();
+          try {
+            rootFinderApplication.setCorpus(applicationCorpus);
+            rootFinderApplication.execute();
+          } finally {
+            rootFinderApplication.setCorpus(rootFinderCorpus);
+          }
+        } catch(ExecutionException | InvalidOffsetException ee) {
           throw new ResourceInstantiationException(ee);
         }
         Iterator<Document> it = applicationCorpus.iterator();
@@ -721,34 +733,41 @@
     return lookupsToBeReturned;
   }
 
-  public Morph getMorpher() {
-    return morpher;
-  }
-
+  @Deprecated
   public void setMorpher(Morph morpher) {
     this.morpher = morpher;
   }
 
-  public POSTagger getPosTagger() {
-    return posTagger;
-  }
-
+  @Deprecated
   public void setPosTagger(POSTagger posTagger) {
     this.posTagger = posTagger;
   }
 
-  public DefaultTokeniser getTokeniser() {
-    return tokeniser;
-  }
-
+  @Deprecated
   public void setTokeniser(DefaultTokeniser tokeniser) {
     this.tokeniser = tokeniser;
   }
 
+  public CorpusController getRootFinderApplication() {
+    return rootFinderApplication;
+  }
+
+  @CreoleParameter(comment = "Application to find the roots that go into the "
+      + "gazetteer.  Executed over a document containing a single "
+      + SENTENCE_ANNOTATION_TYPE + " annotation spanning the whole document, "
+      + "this application should produce Token annotations with category (POS "
+      + "tag) and root (morphological root) features.  Typically that means a "
+      + "tokeniser, POS tagger and morphological analyser, but any "
+      + "application producing the correct features will work")
+  public void setRootFinderApplication(CorpusController rootFinderApplication) 
{
+    this.rootFinderApplication = rootFinderApplication;
+  }
+
   public Ontology getOntology() {
     return ontology;
   }
 
+  @CreoleParameter(comment = "The ontology to be used")
   public void setOntology(Ontology ontology) {
     this.ontology = ontology;
   }
@@ -757,6 +776,8 @@
     return considerProperties;
   }
 
+  @CreoleParameter(comment = "Should this gazetteer consider properties or 
not",
+      defaultValue = "true")
   public void setConsiderProperties(Boolean considerProperties) {
     this.considerProperties = considerProperties;
   }
@@ -765,6 +786,8 @@
     return useResourceUri;
   }
 
+  @CreoleParameter(comment = "Should this gazetteer use resource URIs or not",
+      defaultValue = "true")
   public void setUseResourceUri(Boolean useResourceUri) {
     this.useResourceUri = useResourceUri;
   }
@@ -780,6 +803,8 @@
    * @param separateCamelCasedWords
    *          the separateCamelCasedWords to set
    */
+  @CreoleParameter(comment = "Should this gazetteer separate camelCased "
+      + "words, e.g. ProjectName into Project Name", defaultValue = "true")
   public void setSeparateCamelCasedWords(Boolean separateCamelCasedWords) {
     this.separateCamelCasedWords = separateCamelCasedWords;
   }
@@ -795,6 +820,9 @@
    * @param propertiesToExclude
    *          the propertiesToExclude to set
    */
+  @Optional
+  @CreoleParameter(comment = "The list of property names to be excluded, "
+      + "comma separated", defaultValue = "")
   public void setPropertiesToExclude(String propertiesToExclude) {
     this.propertiesToExclude = propertiesToExclude;
   }
@@ -810,6 +838,9 @@
    * @param propertiesToInclude
    *          the propertiesToInclude to set
    */
+  @Optional
+  @CreoleParameter(comment = "The list of property names to be included, "
+      + "comma separated", defaultValue = "")
   public void setPropertiesToInclude(String propertiesToInclude) {
     this.propertiesToInclude = propertiesToInclude;
   }
@@ -824,6 +855,14 @@
   /**
    * @param considerHeuristicRules
    */
+  @CreoleParameter(comment = "Should this gazetteer consider several "
+      + "heuristic rules or not: the words containing spaces will be split; "
+      + "for example, if 'pos tagger for spanish' would be analysed, 'for' "
+      + "would be consider as a stop word; heuristically derived would be "
+      + "'pos tagger' and this would be further used to add 'pos tagger' with "
+      + "heuristical level 0, and 'tagger' with hl 1 to the gazetteer list; "
+      + "at runtime lower heuristical level should be prefered",
+      defaultValue = "false")
   public void setConsiderHeuristicRules(Boolean considerHeuristicRules) {
     this.considerHeuristicRules = considerHeuristicRules;
   }
@@ -838,4 +877,20 @@
   public LinearDefinition getLinearDefinition() {
     return new LinearDefinition();
   }
+
+  // hidden parameters
+  @HiddenCreoleParameter
+  public void setListsURL(URL u) {
+    super.setListsURL(u);
+  }
+
+  @HiddenCreoleParameter
+  public void setGazetteerFeatureSeparator(String sep) {
+    super.setGazetteerFeatureSeparator(sep);
+  }
+
+  @HiddenCreoleParameter
+  public void setEncoding(String encoding) {
+    super.setEncoding(encoding);
+  }
 }

Index: 
gate/branches/release-8.0/plugins/Ontology_Tools/src/com/ontotext/gate/vr/Gaze.java
===================================================================
--- 
gate/branches/release-8.0/plugins/Ontology_Tools/src/com/ontotext/gate/vr/Gaze.java
 2014-05-10 22:32:58 UTC (rev 17945)
+++ 
gate/branches/release-8.0/plugins/Ontology_Tools/src/com/ontotext/gate/vr/Gaze.java
 2014-05-10 22:34:46 UTC (rev 17946)

Property changes on: 
gate/branches/release-8.0/plugins/Ontology_Tools/src/com/ontotext/gate/vr/Gaze.java
___________________________________________________________________
Deleted: svn:mergeinfo
## -1,6 +0,0 ##
-/gate/branches/cl-experiment/src/main/com/ontotext/gate/vr/Gaze.java:15466-15613
-/gate/branches/new-ontology-api/src/main/com/ontotext/gate/vr/Gaze.java:10584-11598
-/gate/branches/release-7.0/src/main/com/ontotext/gate/vr/Gaze.java:15335-15398
-/gate/branches/sawdust/src/main/com/ontotext/gate/vr/Gaze.java:17055-17079
-/gate/tags/release-7.0/src/main/com/ontotext/gate/vr/Gaze.java:15399-15407
-/gate/trunk/src/main/com/ontotext/gate/vr/Gaze.java:3-7
\ No newline at end of property
Index: 
gate/branches/release-8.0/plugins/Ontology_Tools/src/com/ontotext/gate/vr/GeneralEditorException.java
===================================================================
--- 
gate/branches/release-8.0/plugins/Ontology_Tools/src/com/ontotext/gate/vr/GeneralEditorException.java
       2014-05-10 22:32:58 UTC (rev 17945)
+++ 
gate/branches/release-8.0/plugins/Ontology_Tools/src/com/ontotext/gate/vr/GeneralEditorException.java
       2014-05-10 22:34:46 UTC (rev 17946)

Property changes on: 
gate/branches/release-8.0/plugins/Ontology_Tools/src/com/ontotext/gate/vr/GeneralEditorException.java
___________________________________________________________________
Deleted: svn:mergeinfo
## -1,6 +0,0 ##
-/gate/branches/cl-experiment/src/main/com/ontotext/gate/vr/GeneralEditorException.java:15466-15613
-/gate/branches/new-ontology-api/src/main/com/ontotext/gate/vr/GeneralEditorException.java:10584-11598
-/gate/branches/release-7.0/src/main/com/ontotext/gate/vr/GeneralEditorException.java:15335-15398
-/gate/branches/sawdust/src/main/com/ontotext/gate/vr/GeneralEditorException.java:17055-17079
-/gate/tags/release-7.0/src/main/com/ontotext/gate/vr/GeneralEditorException.java:15399-15407
-/gate/trunk/src/main/com/ontotext/gate/vr/GeneralEditorException.java:3-7
\ No newline at end of property
Index: 
gate/branches/release-8.0/plugins/Ontology_Tools/src/com/ontotext/gate/vr/MappingTreeView.java
===================================================================
--- 
gate/branches/release-8.0/plugins/Ontology_Tools/src/com/ontotext/gate/vr/MappingTreeView.java
      2014-05-10 22:32:58 UTC (rev 17945)
+++ 
gate/branches/release-8.0/plugins/Ontology_Tools/src/com/ontotext/gate/vr/MappingTreeView.java
      2014-05-10 22:34:46 UTC (rev 17946)

Property changes on: 
gate/branches/release-8.0/plugins/Ontology_Tools/src/com/ontotext/gate/vr/MappingTreeView.java
___________________________________________________________________
Deleted: svn:mergeinfo
## -1,6 +0,0 ##
-/gate/branches/cl-experiment/src/main/com/ontotext/gate/vr/MappingTreeView.java:15466-15613
-/gate/branches/new-ontology-api/src/main/com/ontotext/gate/vr/MappingTreeView.java:10584-11598
-/gate/branches/release-7.0/src/main/com/ontotext/gate/vr/MappingTreeView.java:15335-15398
-/gate/branches/sawdust/src/main/com/ontotext/gate/vr/MappingTreeView.java:17055-17079
-/gate/tags/release-7.0/src/main/com/ontotext/gate/vr/MappingTreeView.java:15399-15407
-/gate/trunk/src/main/com/ontotext/gate/vr/MappingTreeView.java:3-7
\ No newline at end of property
Index: gate/branches/release-8.0/plugins/TermRaider
===================================================================
--- gate/branches/release-8.0/plugins/TermRaider        2014-05-10 22:32:58 UTC 
(rev 17945)
+++ gate/branches/release-8.0/plugins/TermRaider        2014-05-10 22:34:46 UTC 
(rev 17946)

Property changes on: gate/branches/release-8.0/plugins/TermRaider
___________________________________________________________________
Deleted: svn:mergeinfo
## -1,5 +0,0 ##
-/gate/branches/new-ontology-api/plugins/TermRaider:10584-11598
-/gate/branches/release-7.0/plugins/TermRaider:15335-15398
-/gate/branches/sawdust/plugins/TermRaider:17055-17079
-/gate/tags/release-7.0/plugins/TermRaider:15399-15407
-/gate/trunk/plugins/TermRaider:3-390
\ No newline at end of property
Index: gate/branches/release-8.0/src
===================================================================
--- gate/branches/release-8.0/src       2014-05-10 22:32:58 UTC (rev 17945)
+++ gate/branches/release-8.0/src       2014-05-10 22:34:46 UTC (rev 17946)

Property changes on: gate/branches/release-8.0/src
___________________________________________________________________
Modified: svn:mergeinfo
## -3,4 +3,4 ##
 /gate/branches/release-7.0/src:15335-15398
 /gate/branches/sawdust/src:17055-17079
 /gate/tags/release-7.0/src:15399-15407
-/gate/trunk/src:3-7
+/gate/trunk/src:3-7,17943-17944
\ No newline at end of property
Modified: gate/branches/release-8.0/src/main/gate/gui/GazetteerEditor.java
===================================================================
--- gate/branches/release-8.0/src/main/gate/gui/GazetteerEditor.java    
2014-05-10 22:32:58 UTC (rev 17945)
+++ gate/branches/release-8.0/src/main/gate/gui/GazetteerEditor.java    
2014-05-10 22:34:46 UTC (rev 17946)
@@ -834,10 +834,9 @@
             && !linearDefinition.getLists().contains(name);
         }
       });
-      String[] filenames = new String[files.length];
-      int i = 0;
-      for (File file : files) {
-        filenames[i++] = file.getName();
+      String[] filenames = new String[files == null ? 0 : files.length];
+      for (int i = 0; i < filenames.length; i++) {
+        filenames[i] = files[i].getName();
       }
       Arrays.sort(filenames, collator);
       newListComboBox.setModel(new DefaultComboBoxModel<String>(filenames));

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to