Revision: 19172
          http://sourceforge.net/p/gate/code/19172
Author:   markagreenwood
Date:     2016-04-01 09:55:03 +0000 (Fri, 01 Apr 2016)
Log Message:
-----------
moved the creole metadata for the tokenizer and sentence splitter out of 
creole.xml into annotations on the class files

Modified Paths:
--------------
    gate/trunk/plugins/Lang_Welsh/creole.xml
    gate/trunk/plugins/Lang_Welsh/src/wnlt/WelshSentenceSplitter.java
    gate/trunk/plugins/Lang_Welsh/src/wnlt/WelshTokeniser.java

Modified: gate/trunk/plugins/Lang_Welsh/creole.xml
===================================================================
--- gate/trunk/plugins/Lang_Welsh/creole.xml    2016-04-01 09:35:51 UTC (rev 
19171)
+++ gate/trunk/plugins/Lang_Welsh/creole.xml    2016-04-01 09:55:03 UTC (rev 
19172)
@@ -2,57 +2,11 @@
 <!-- $Id: creole.xml 30100 2016-03-19 10:00:45Z andreasvlachidis $ -->
 <!-- creole.xml for Welsh Natural Language Toolkit PR-->
 <CREOLE-DIRECTORY>
-  <!-- Processing Resources -->
-  <CREOLE>
+
     <JAR SCAN="true">wnlt.jar</JAR>
-    <!-- Tokenizer Processing Resource -->
+    <REQUIRES>../ANNIE</REQUIRES>
+
     <RESOURCE>
-      <NAME>Welsh Tokeniser</NAME>
-      <CLASS>wnlt.WelshTokeniser</CLASS>
-      <COMMENT>A customisable Welsh tokeniser.</COMMENT>
-      <PARAMETER NAME="document" COMMENT="The document to be tokenised"
-        RUNTIME="true">gate.Document</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="tokeniserRulesURL"
-        DEFAULT="resources/Tokeniser/WelshTokeniser.rules"
-        COMMENT="The URL for the rules file" SUFFIXES="rules" >
-        java.net.URL</PARAMETER>     
-      <PARAMETER NAME="encoding"
-        COMMENT="The encoding used for reading the definitions" 
DEFAULT="UTF-8">
-        java.lang.String</PARAMETER>
-      <PARAMETER NAME="transducerGrammarURL"
-        DEFAULT="resources/Tokeniser/postprocess.jape"
-        COMMENT="The URL for the postprocessing transducer" SUFFIXES="jape">
-        java.net.URL</PARAMETER>
-      <ICON>welsh_tokenizer.png</ICON>
-    </RESOURCE>
-    <RESOURCE>
-    <!-- Sentence Splitter Processing Resource -->
-      <NAME>Welsh Sentence Splitter</NAME>
-      <CLASS>wnlt.WelshSentenceSplitter</CLASS>
-      <COMMENT>A customisable Sentence Splitter.</COMMENT>
-      <PARAMETER NAME="inputASName"
-        COMMENT="The name of the annotation set used for input"
-        RUNTIME="true" OPTIONAL="true">java.lang.String</PARAMETER>
-      <PARAMETER NAME="outputASName"
-        COMMENT="The name of the annotation set used for output"
-        RUNTIME="true" OPTIONAL="true">java.lang.String</PARAMETER>
-      <PARAMETER NAME="gazetteerListsURL"
-        DEFAULT="resources/sentenceSplitter/gazetteer/lists.def"
-        COMMENT="The URL for the gazetteer file" SUFFIXES="def" >
-        java.net.URL</PARAMETER>     
-      <PARAMETER NAME="encoding"
-        COMMENT="The encoding used for reading the definitions" 
DEFAULT="UTF-8">
-        java.lang.String</PARAMETER>
-       <PARAMETER NAME="transducerURL"
-        DEFAULT="resources/sentenceSplitter/grammar/main-single-nl.jape"
-        COMMENT="The URL for the transducer" SUFFIXES="jape">
-        java.net.URL</PARAMETER>
-      <ICON>welsh_splitter.png</ICON>
-    </RESOURCE>
-    <RESOURCE>
     <!-- Part of Speech Tagger Processing Resource -->
       <NAME>Welsh POS Tagger</NAME>
       <COMMENT>Mark Hepple's Brill-style POS tagger, adapted for 
Welsh</COMMENT>
@@ -142,5 +96,5 @@
         java.net.URL</PARAMETER>
        <ICON>welsh_lemmatiser.png</ICON>       
     </RESOURCE>
- </CREOLE>
+
 </CREOLE-DIRECTORY>

Modified: gate/trunk/plugins/Lang_Welsh/src/wnlt/WelshSentenceSplitter.java
===================================================================
--- gate/trunk/plugins/Lang_Welsh/src/wnlt/WelshSentenceSplitter.java   
2016-04-01 09:35:51 UTC (rev 19171)
+++ gate/trunk/plugins/Lang_Welsh/src/wnlt/WelshSentenceSplitter.java   
2016-04-01 09:55:03 UTC (rev 19172)
@@ -7,14 +7,18 @@
  */
 package wnlt;
 
+import gate.creole.metadata.CreoleParameter;
+import gate.creole.metadata.CreoleResource;
 import gate.creole.splitter.SentenceSplitter;
 
+import java.net.URL;
+
 /**
  * This class extends the original SentenceSplitter class of ANNIE.
  * @author Andreas Vlachidis 20/03/2016
  * 
  */
-
+@CreoleResource(name="Welsh Sentence Splitter", icon="welsh_splitter.png")
 public class WelshSentenceSplitter extends SentenceSplitter {
 
        private static final long serialVersionUID = 1L;

Modified: gate/trunk/plugins/Lang_Welsh/src/wnlt/WelshTokeniser.java
===================================================================
--- gate/trunk/plugins/Lang_Welsh/src/wnlt/WelshTokeniser.java  2016-04-01 
09:35:51 UTC (rev 19171)
+++ gate/trunk/plugins/Lang_Welsh/src/wnlt/WelshTokeniser.java  2016-04-01 
09:55:03 UTC (rev 19172)
@@ -7,16 +7,31 @@
  */
 package wnlt;
 
+import gate.creole.metadata.CreoleParameter;
+import gate.creole.metadata.CreoleResource;
 import gate.creole.tokeniser.DefaultTokeniser;
 
+import java.net.URL;
+
 /**
  * This class extends the DefaultTokeniser class of ANNIE.
  * @author Andreas Vlachidis 20/03/2016
  * 
  */
+@CreoleResource(name="Welsh Tokeniser", icon="welsh_tokenizer.png")
 public class WelshTokeniser extends DefaultTokeniser {
 
        private static final long serialVersionUID = 1L;
 
+  @Override
+  @CreoleParameter(defaultValue = "resources/Tokeniser/WelshTokeniser.rules")
+  public void setTokeniserRulesURL(URL tokeniserRulesURL) {
+    super.setTokeniserRulesURL(tokeniserRulesURL);
+  }
 
+  @Override
+  @CreoleParameter(defaultValue = "resources/Tokeniser/postprocess.jape")
+  public void setTransducerGrammarURL(URL transducerGrammarURL) {
+    super.setTransducerGrammarURL(transducerGrammarURL);
+  }
 }
\ No newline at end of file

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


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to