Revision: 19833
          http://sourceforge.net/p/gate/code/19833
Author:   markagreenwood
Date:     2016-11-28 11:00:58 +0000 (Mon, 28 Nov 2016)
Log Message:
-----------
moved the creole metadata from creole.xml into the class files

Modified Paths:
--------------
    
gate/branches/sawdust2/plugins/Annotation_Merging/src/main/java/gate/merger/AnnotationMergingMain.java
    
gate/branches/sawdust2/plugins/Annotation_Merging/src/main/resources/creole.xml

Modified: 
gate/branches/sawdust2/plugins/Annotation_Merging/src/main/java/gate/merger/AnnotationMergingMain.java
===================================================================
--- 
gate/branches/sawdust2/plugins/Annotation_Merging/src/main/java/gate/merger/AnnotationMergingMain.java
      2016-11-28 10:48:52 UTC (rev 19832)
+++ 
gate/branches/sawdust2/plugins/Annotation_Merging/src/main/java/gate/merger/AnnotationMergingMain.java
      2016-11-28 11:00:58 UTC (rev 19833)
@@ -1,5 +1,11 @@
 package gate.merger;
 
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Set;
+import java.util.Vector;
+
 import gate.Annotation;
 import gate.AnnotationSet;
 import gate.Factory;
@@ -8,16 +14,14 @@
 import gate.creole.AbstractLanguageAnalyser;
 import gate.creole.ExecutionException;
 import gate.creole.ResourceInstantiationException;
+import gate.creole.metadata.CreoleParameter;
+import gate.creole.metadata.CreoleResource;
+import gate.creole.metadata.Optional;
+import gate.creole.metadata.RunTime;
 import gate.util.AnnotationMerging;
 import gate.util.InvalidOffsetException;
 
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Set;
-import java.util.Vector;
-//import gate.util.IaaCalculation;
-
+@CreoleResource(name="Annotation Merging PR", comment="Merge Annotations from 
different annotators.", 
helpURL="http://gate.ac.uk/userguide/sec:misc-creole:merging";)
 public class AnnotationMergingMain extends AbstractLanguageAnalyser implements
                                                                    
ProcessingResource {
 
@@ -199,9 +203,9 @@
 
   }
 
-  
-
-
+  @Optional
+  @RunTime
+  @CreoleParameter(comment="Annotation sets names used for merging. Example: 
'as1;as2;as3'. If not defined, use all the annotation sets but the default 
annotation set.")
   public void setAnnSetsForMerging(String annSetSeq) {
     this.annSetsForMerging = annSetSeq;
   }
@@ -210,6 +214,8 @@
     return this.annSetsForMerging;
   }
 
+  @RunTime
+  @CreoleParameter(comment="Annotation set name used for storing the merged 
annotations")
   public void setAnnSetOutput(String annSet) {
     this.annSetOutput = annSet;
   }
@@ -218,6 +224,9 @@
     return this.annSetOutput;
   }
 
+  @RunTime
+  @Optional
+  @CreoleParameter(comment="Annotation types names and optionally features 
used for merging. Example: 'Location;Organisation->type'.")
   public void setAnnTypesAndFeats(String annTypeSeq) {
     this.annTypesAndFeats = annTypeSeq;
   }
@@ -230,6 +239,8 @@
     return this.mergingMethod;
   }
 
+  @RunTime
+  @CreoleParameter(comment="MergingByAnnotatorNum selects the annotation on 
which at least minimalAnnNum annotators agree and MajorityVoting selects the 
annotation that the majority of annotators support.", 
defaultValue="MajorityVoting")
   public void setMergingMethod(MergingMethodsEnum m) {
     this.mergingMethod = m;
   }
@@ -238,6 +249,9 @@
     return this.minimalAnnNum;
   }
 
+  @RunTime
+  @Optional
+  @CreoleParameter(comment="Minimal number of annotators who must agree to 
merge the annotation with MergingByAnnotatorNum mergingMethod", 
defaultValue="1")
   public void setMinimalAnnNum(String n) {
     this.minimalAnnNum = n;
   }
@@ -246,6 +260,8 @@
     return this.keepSourceForMergedAnnotations;
   }
 
+  @RunTime
+  @CreoleParameter(comment="Should source annotations be kept when merged?", 
defaultValue="true" )
   public void setkeepSourceForMergedAnnotations(Boolean b) {
     this.keepSourceForMergedAnnotations = b;
   }

Modified: 
gate/branches/sawdust2/plugins/Annotation_Merging/src/main/resources/creole.xml
===================================================================
--- 
gate/branches/sawdust2/plugins/Annotation_Merging/src/main/resources/creole.xml 
    2016-11-28 10:48:52 UTC (rev 19832)
+++ 
gate/branches/sawdust2/plugins/Annotation_Merging/src/main/resources/creole.xml 
    2016-11-28 11:00:58 UTC (rev 19833)
@@ -1,54 +1,5 @@
 <?xml version="1.0"?>
-<!-- $Id$ -->
 <CREOLE-DIRECTORY>
-  <!-- Processing Resources -->
-  <CREOLE>    
-    <!-- creole.xml for the Learning PR -->
-    <RESOURCE>
-      <NAME>Annotation Merging PR</NAME>
-      <COMMENT>Merge Annotations from different annotators.</COMMENT>
-               
<HELPURL>http://gate.ac.uk/userguide/sec:misc-creole:merging</HELPURL>
-      <CLASS>gate.merger.AnnotationMergingMain</CLASS>
 
-      <PARAMETER NAME="annSetsForMerging"
-        COMMENT="Annotation sets names used for merging. Example: 
'as1;as2;as3'.
-If not defined, use all the annotation sets but the default annotation set."
-        RUNTIME="true"
-        OPTIONAL="true">java.lang.String</PARAMETER>
-
-       <PARAMETER NAME="annTypesAndFeats"
-        COMMENT="Annotation types names and optionally features used for
-merging. Example: 'Location;Organisation->type'."
-        RUNTIME="true" OPTIONAL="true">java.lang.String</PARAMETER>
-
-      <PARAMETER NAME="annSetOutput"
-        COMMENT="Annotation set name used for storing the merged annotations"
-        RUNTIME="true" OPTIONAL="false">java.lang.String</PARAMETER>
-
-      <PARAMETER NAME="document" COMMENT="Document to be processed"
-        RUNTIME="true" OPTIONAL="false">gate.Document</PARAMETER>
-
-      <PARAMETER NAME="mergingMethod"
-        COMMENT="MergingByAnnotatorNum selects the annotation on which at least
-minimalAnnNum annotators agree and MajorityVoting selects the
-annotation that the majority of annotators support."
-        RUNTIME="true" DEFAULT="MajorityVoting"
-        OPTIONAL="false">gate.merger.MergingMethodsEnum</PARAMETER>
-
-      <PARAMETER NAME="minimalAnnNum"
-        COMMENT="Minimal number of annotators who must agree to merge
-the annotation with MergingByAnnotatorNum mergingMethod"
-         RUNTIME="true" DEFAULT="1" 
OPTIONAL="true">java.lang.String</PARAMETER>
-
-      <PARAMETER NAME="keepSourceForMergedAnnotations" DEFAULT="true"
-        COMMENT="Should source annotations be kept when merged?"
-        RUNTIME="true" OPTIONAL="false">
-        java.lang.Boolean
-      </PARAMETER>
-     </RESOURCE>
-     
-  </CREOLE>
-  
-  
 </CREOLE-DIRECTORY>
 

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


------------------------------------------------------------------------------
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to