Revision: 19298
http://sourceforge.net/p/gate/code/19298
Author: markagreenwood
Date: 2016-05-11 11:12:47 +0000 (Wed, 11 May 2016)
Log Message:
-----------
okay this is likely to break things as GATE is now a Maven project (yikes);
currently the main jar builds and you can run GATE, but all the tests in
gate-core have been disabled and the version/build number stuff isn't working,
but you know other than that everything is just fine :)
Modified Paths:
--------------
gate/branches/sawdust2/.classpath
gate/branches/sawdust2/.project
gate/branches/sawdust2/build/deploy/maven/gate-core.pom.template
gate/branches/sawdust2/build/launcher/src/gate/Launcher.java
gate/branches/sawdust2/src/main/java/gate/Main.java
gate/branches/sawdust2/src/test/disabled/gate/TestGate.java
gate/branches/sawdust2/src/test/disabled/gate/creole/TestControllers.java
gate/branches/sawdust2/src/test/disabled/gate/creole/TestCreoleAnnotationHandler.java
gate/branches/sawdust2/src/test/disabled/gate/creole/annic/test/TestAnnic.java
Added Paths:
-----------
gate/branches/sawdust2/plugins/ANNIE/src/test/java/gate/creole/ProfilePRs.java
gate/branches/sawdust2/src/main/java/
gate/branches/sawdust2/src/main/java/gate/
gate/branches/sawdust2/src/main/java/gate/resources/
gate/branches/sawdust2/src/main/java/gate/resources/img/
gate/branches/sawdust2/src/main/java/gate/resources/img/svg/
gate/branches/sawdust2/src/main/resources/
gate/branches/sawdust2/src/main/resources/META-INF/
gate/branches/sawdust2/src/main/resources/gate/
gate/branches/sawdust2/src/main/resources/gate/resources/
gate/branches/sawdust2/src/test/disabled/
gate/branches/sawdust2/src/test/disabled/gate/
gate/branches/sawdust2/src/test/resources/
gate/branches/sawdust2/src/test/resources/gate/
gate/branches/sawdust2/src/test/resources/gate/resources/
Removed Paths:
-------------
gate/branches/sawdust2/src/main/META-INF/
gate/branches/sawdust2/src/main/gate/
gate/branches/sawdust2/src/main/java/gate/resources/
gate/branches/sawdust2/src/main/resources/gate/resources/img/svg/
gate/branches/sawdust2/src/test/disabled/gate/creole/ProfilePRs.java
gate/branches/sawdust2/src/test/disabled/gate/resources/
gate/branches/sawdust2/src/test/gate/
Modified: gate/branches/sawdust2/.classpath
===================================================================
--- gate/branches/sawdust2/.classpath 2016-05-11 09:02:37 UTC (rev 19297)
+++ gate/branches/sawdust2/.classpath 2016-05-11 11:12:47 UTC (rev 19298)
@@ -1,8 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main"/>
- <classpathentry kind="src" path="src/test"/>
- <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
- <classpathentry exported="true" kind="con"
path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=GATE&ivyXmlPath=ivy.xml&confs=*"/>
- <classpathentry kind="output" path="classes/test"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="src" output="target/classes" path="src/main/java">
+ <attributes>
+ <attribute name="optional" value="true"/>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry excluding="**" kind="src" output="target/classes"
path="src/main/resources">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="src" output="target/test-classes"
path="src/test/java">
+ <attributes>
+ <attribute name="optional" value="true"/>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry excluding="**" kind="src" output="target/test-classes"
path="src/test/resources">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con"
path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: gate/branches/sawdust2/.project
===================================================================
--- gate/branches/sawdust2/.project 2016-05-11 09:02:37 UTC (rev 19297)
+++ gate/branches/sawdust2/.project 2016-05-11 11:12:47 UTC (rev 19298)
@@ -15,10 +15,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
- <nature>org.apache.ivyde.eclipse.ivynature</nature>
</natures>
</projectDescription>
Modified: gate/branches/sawdust2/build/deploy/maven/gate-core.pom.template
===================================================================
--- gate/branches/sawdust2/build/deploy/maven/gate-core.pom.template
2016-05-11 09:02:37 UTC (rev 19297)
+++ gate/branches/sawdust2/build/deploy/maven/gate-core.pom.template
2016-05-11 11:12:47 UTC (rev 19298)
@@ -32,49 +32,49 @@
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-api</artifactId>
<version>1.1.0</version>
- <scope>runtime</scope>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-util</artifactId>
<version>1.1.0</version>
- <scope>runtime</scope>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-impl</artifactId>
<version>1.1.0</version>
- <scope>runtime</scope>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-connector-basic</artifactId>
<version>1.1.0</version>
- <scope>runtime</scope>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-transport-file</artifactId>
<version>1.1.0</version>
- <scope>runtime</scope>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-transport-http</artifactId>
<version>1.1.0</version>
- <scope>runtime</scope>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-transport-wagon</artifactId>
<version>1.1.0</version>
- <scope>runtime</scope>
+ <scope>compile</scope>
</dependency>
@@ -82,14 +82,14 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-aether-provider</artifactId>
<version>3.3.9</version>
- <scope>runtime</scope>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.10</version>
- <scope>runtime</scope>
+ <scope>compile</scope>
</dependency>
<!-- needed to ensure the same version across configurations -->
@@ -152,7 +152,7 @@
<groupId>org.apache.tika</groupId>
<artifactId>tika-parsers</artifactId>
<version>1.7</version>
- <scope>runtime</scope>
+ <scope>compile</scope>
<exclusions>
<!-- we don't currently use the RSS/ATOM aspects of Tika so we
don't need ROME -->
Modified: gate/branches/sawdust2/build/launcher/src/gate/Launcher.java
===================================================================
--- gate/branches/sawdust2/build/launcher/src/gate/Launcher.java
2016-05-11 09:02:37 UTC (rev 19297)
+++ gate/branches/sawdust2/build/launcher/src/gate/Launcher.java
2016-05-11 11:12:47 UTC (rev 19298)
@@ -144,11 +144,11 @@
if(!"".equals(entry)) addUrlsForFile(new File(entry), urls);
}
}
- File binDir = new File(gateHome, "bin");
+ File binDir = new File(gateHome, "target");
// gate/bin (for log4j.properties)
addUrlsForFile(binDir, urls);
// bin/gate.jar
- addUrlsForFile(new File(binDir, "gate.jar"), urls);
+ addUrlsForFile(new File(binDir, "*"), urls);
// and lib/*.jar
File libDir = new File(gateHome, "lib");
addUrlsForFile(new File(libDir, "*"), urls);
Copied:
gate/branches/sawdust2/plugins/ANNIE/src/test/java/gate/creole/ProfilePRs.java
(from rev 19297, gate/branches/sawdust2/src/test/gate/creole/ProfilePRs.java)
===================================================================
---
gate/branches/sawdust2/plugins/ANNIE/src/test/java/gate/creole/ProfilePRs.java
(rev 0)
+++
gate/branches/sawdust2/plugins/ANNIE/src/test/java/gate/creole/ProfilePRs.java
2016-05-11 11:12:47 UTC (rev 19298)
@@ -0,0 +1,217 @@
+/*
+ * ProfilePRs.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).
+ *
+ * Kalina Bontcheva, 04/10/2001
+ *
+ * $Id$
+ */
+
+package gate.creole;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import gate.Document;
+import gate.Factory;
+import gate.FeatureMap;
+import gate.Gate;
+import gate.LanguageAnalyser;
+import gate.util.GateException;
+import gate.util.Out;
+import gate.util.profile.Profiler;
+//import java.text.NumberFormat;
+
+/**
+ * This class provides a main function that:
+ * <UL>
+ * <LI>
+ * initialises the GATE library, and creates all PRs
+ * <LI>
+ * takes a directory name as argument
+ * <LI>
+ * for each .html file in that directory:
+ * <BR> create a GATE document from the file
+ * <BR> run the PRs on the document
+ * <BR> dump some statistics in the end
+ * </UL>
+ */
+public class ProfilePRs {
+
+ /** String to print when wrong command-line args */
+ private static String usage =
+ "usage: ProfilePRs [-dir directory-name | file(s)]";
+
+ private static double totalDocLength = 0;
+ private static int docs = 0;
+ private static Profiler prof = new Profiler();
+ private static double maxDocLength = 0;
+
+ /** Main function */
+ public static void main(String[] args) throws Exception {
+ // say "hi"
+ Out.prln("processing command line arguments");
+
+ // check we have a directory name or list of files
+ List<File> inputFiles = null;
+ if(args.length < 1) throw new GateException(usage);
+ if(args[0].equals("-dir")) { // list all the files in the dir
+ if(args.length < 2) throw new GateException(usage);
+ File dir = new File(args[1]);
+ File[] filesArray = dir.listFiles();
+ if(filesArray == null)
+ throw new GateException(
+ dir.getPath() + " is not a directory; " + usage
+ );
+ inputFiles = Arrays.asList(filesArray);
+ } else { // all args should be file names
+ inputFiles = new ArrayList<File>();
+ for(int i = 0; i < args.length; i++)
+ inputFiles.add(new File(args[i]));
+ }
+
+ prof.initRun("Measuring performance on directory " + args[1]);
+// prof.enable(false);
+// prof.enableGCCalling(false);
+
+ // initialise GATE
+ prof.checkPoint("Before GATE.init()");
+ Gate.init();
+ //tell GATE we're in batch mode
+// gate.Main.batchMode = true;
+
+
+ // create some processing resources
+ prof.checkPoint("Before creating the processing resources");
+
+ //create a default tokeniser
+ FeatureMap params = Factory.newFeatureMap();
+ LanguageAnalyser tokeniser = (LanguageAnalyser) Factory.createResource(
+ "gate.creole.tokeniser.DefaultTokeniser", params);
+ prof.checkPoint("Tokeniser initialised");
+
+ //create a default gazetteer
+ params = Factory.newFeatureMap();
+ LanguageAnalyser gaz = (LanguageAnalyser) Factory.createResource(
+ "gate.creole.gazetteer.DefaultGazetteer", params);
+ prof.checkPoint("Gazetteer initialised");
+
+ //create a splitter
+ params = Factory.newFeatureMap();
+ LanguageAnalyser splitter = (LanguageAnalyser) Factory.createResource(
+ "gate.creole.splitter.SentenceSplitter", params);
+ prof.checkPoint("Sentence splitter initialised");
+
+ //create a tagger
+ params = Factory.newFeatureMap();
+ LanguageAnalyser tagger = (LanguageAnalyser) Factory.createResource(
+ "gate.creole.POSTagger", params);
+ prof.checkPoint("POSTagger initialised");
+
+ //create a grammar
+ params = Factory.newFeatureMap();
+ LanguageAnalyser transducer = (LanguageAnalyser) Factory.createResource(
+ "gate.creole.ANNIETransducer", params);
+ prof.checkPoint("Grammars initialised");
+
+ //create an orthomatcher
+ params = Factory.newFeatureMap();
+ LanguageAnalyser orthomatcher = (LanguageAnalyser) Factory.createResource(
+ "gate.creole.orthomatcher.OrthoMatcher", params);
+ prof.checkPoint("Orthomatcher initialised");
+
+
+ // for each document
+ // create a gate doc
+ // set as the document for hte PRs
+ // run the PRs
+ // dump output from the doc
+ // delete the doc
+ Out.prln("\nLooping on input files list");
+ Iterator<File> filesIter = inputFiles.iterator();
+ docs = inputFiles.size();
+ int fileNo=0;
+ while(filesIter.hasNext()) {
+ File inFile = filesIter.next(); // the current file
+ fileNo++;
+
+ // set the source URL parameter to a "file:..." URL string
+ params.clear();
+ params.put(Document.DOCUMENT_URL_PARAMETER_NAME,
inFile.toURI().toURL().toExternalForm());
+ params.put(Document.DOCUMENT_ENCODING_PARAMETER_NAME, "");
+
+ // create the document
+ Document doc = (Document) Factory.createResource(
+ "gate.corpora.DocumentImpl", params
+ );
+ totalDocLength += doc.getContent().size().longValue();
+
+ if (maxDocLength < doc.getContent().size().longValue())
+ maxDocLength = doc.getContent().size().longValue();
+
+ // set the document param on the PRs
+ tokeniser.setDocument(doc);
+ prof.checkPoint("Processing file " + inFile.getPath() +
+ ", #" + fileNo + "/" + docs, new String[0], true, false, false);
+ tokeniser.execute();
+ prof.checkPoint("", new String[] {"Tokenizer", "Processing"}, false,
false, false);
+
+ //run gazetteer
+ gaz.setDocument(doc);
+ gaz.execute();
+ prof.checkPoint("", new String[] {"Gazettier", "Processing"}, false,
false, false);
+
+ //run splitter
+ splitter.setDocument(doc);
+ splitter.execute();
+ prof.checkPoint("", new String[] {"Splitter", "Processing"}, false,
false, false);
+
+ //run the tagger
+ tagger.setDocument(doc);
+ tagger.execute();
+ prof.checkPoint("", new String[] {"Tagger", "Processing"}, false, false,
false);
+
+ //run the transducer
+ transducer.setDocument(doc);
+ transducer.execute();
+ prof.checkPoint("", new String[] {"JAPE grammars", "Processing"}, false,
false, false);
+
+ // run the orthomatcher
+ orthomatcher.setDocument(doc);
+ orthomatcher.execute();
+ prof.checkPoint("", new String[] {"Orthomatcher", "Processing"}, false,
false, false);
+
+ // make the doc a candidate for garbage collection
+ Factory.deleteResource(doc);
+
+ } // input files loop
+
+ prof.checkPoint("Done!");
+
+ totalDocLength = totalDocLength/1024;
+ Out.prln("\nTotal KBytes processed: " + (long)totalDocLength);
+ Out.prln("\nMax document size in bytes: " + (long)maxDocLength +
+ " (" + (long) maxDocLength/1024 + " Kb)");
+
+
+ prof.printCategAvg("Processing", docs, totalDocLength, "kb");
+ prof.printCategAvg("Tokenizer", docs, totalDocLength, "kb");
+ prof.printCategAvg("Gazettier", docs, totalDocLength, "kb");
+ prof.printCategAvg("Splitter", docs, totalDocLength, "kb");
+ prof.printCategAvg("Tagger", docs, totalDocLength, "kb");
+ prof.printCategAvg("JAPE grammars", docs, totalDocLength, "kb");
+ prof.printCategAvg("Orthomatcher", docs, totalDocLength, "kb");
+ } // main
+
+
+} // class ProfilePRs
Modified: gate/branches/sawdust2/src/main/java/gate/Main.java
===================================================================
--- gate/branches/sawdust2/src/main/gate/Main.java 2016-05-11 09:02:37 UTC
(rev 19297)
+++ gate/branches/sawdust2/src/main/java/gate/Main.java 2016-05-11 11:12:47 UTC
(rev 19298)
@@ -355,7 +355,7 @@
reader = new BomStrippingInputStreamReader(ver, "UTF-8");
temp = reader.readLine();
} catch(IOException ioe) {
- temp = "8.0";
+ temp = "VERSION UNKNOWN";
} finally {
IOUtils.closeQuietly(reader);
}
Modified: gate/branches/sawdust2/src/test/disabled/gate/TestGate.java
===================================================================
--- gate/branches/sawdust2/src/test/gate/TestGate.java 2016-05-11 09:02:37 UTC
(rev 19297)
+++ gate/branches/sawdust2/src/test/disabled/gate/TestGate.java 2016-05-11
11:12:47 UTC (rev 19298)
@@ -16,6 +16,11 @@
package gate;
+import java.io.File;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+
import gate.annotation.TestAnnotation;
import gate.config.TestConfig;
import gate.corpora.TestCorpus;
@@ -26,11 +31,8 @@
import gate.creole.TestControllers;
import gate.creole.TestCreole;
import gate.creole.TestCreoleAnnotationHandler;
-import gate.creole.TestPR;
import gate.creole.TestXSchema;
import gate.creole.annic.test.TestAnnic;
-import gate.creole.gazetteer.TestFlexibleGazetteer;
-import gate.creole.morph.TestMorph;
import gate.creole.test.DynamicRegistrationTest;
import gate.email.TestEmail;
import gate.html.TestHtml;
@@ -50,12 +52,6 @@
import gate.util.TestTools;
import gate.xml.TestRepositioningInfo;
import gate.xml.TestXml;
-
-import java.io.File;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -188,8 +184,10 @@
suite.addTest(TestFeatureMap.suite());
suite.addTest(TestTools.suite());
suite.addTest(TestCreoleAnnotationHandler.suite());
- suite.addTest(TestPR.suite());
+ //moved into ANNIE
+ //suite.addTest(TestPR.suite());
+
//Moved nito the Tools plugin
//suite.addTest(TestMorph.suite());
Deleted: gate/branches/sawdust2/src/test/disabled/gate/creole/ProfilePRs.java
===================================================================
--- gate/branches/sawdust2/src/test/gate/creole/ProfilePRs.java 2016-05-11
09:02:37 UTC (rev 19297)
+++ gate/branches/sawdust2/src/test/disabled/gate/creole/ProfilePRs.java
2016-05-11 11:12:47 UTC (rev 19298)
@@ -1,214 +0,0 @@
-/*
- * ProfilePRs.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).
- *
- * Kalina Bontcheva, 04/10/2001
- *
- * $Id$
- */
-
-package gate.creole;
-
-import java.io.File;
-import java.util.*;
-
-import gate.*;
-import gate.creole.gazetteer.DefaultGazetteer;
-import gate.creole.orthomatcher.OrthoMatcher;
-import gate.creole.splitter.SentenceSplitter;
-import gate.creole.tokeniser.DefaultTokeniser;
-import gate.util.GateException;
-import gate.util.Out;
-import gate.util.profile.Profiler;
-//import java.text.NumberFormat;
-
-/**
- * This class provides a main function that:
- * <UL>
- * <LI>
- * initialises the GATE library, and creates all PRs
- * <LI>
- * takes a directory name as argument
- * <LI>
- * for each .html file in that directory:
- * <BR> create a GATE document from the file
- * <BR> run the PRs on the document
- * <BR> dump some statistics in the end
- * </UL>
- */
-public class ProfilePRs {
-
- /** String to print when wrong command-line args */
- private static String usage =
- "usage: ProfilePRs [-dir directory-name | file(s)]";
-
- private static double totalDocLength = 0;
- private static int docs = 0;
- private static Profiler prof = new Profiler();
- private static double maxDocLength = 0;
-
- /** Main function */
- public static void main(String[] args) throws Exception {
- // say "hi"
- Out.prln("processing command line arguments");
-
- // check we have a directory name or list of files
- List<File> inputFiles = null;
- if(args.length < 1) throw new GateException(usage);
- if(args[0].equals("-dir")) { // list all the files in the dir
- if(args.length < 2) throw new GateException(usage);
- File dir = new File(args[1]);
- File[] filesArray = dir.listFiles();
- if(filesArray == null)
- throw new GateException(
- dir.getPath() + " is not a directory; " + usage
- );
- inputFiles = Arrays.asList(filesArray);
- } else { // all args should be file names
- inputFiles = new ArrayList<File>();
- for(int i = 0; i < args.length; i++)
- inputFiles.add(new File(args[i]));
- }
-
- prof.initRun("Measuring performance on directory " + args[1]);
-// prof.enable(false);
-// prof.enableGCCalling(false);
-
- // initialise GATE
- prof.checkPoint("Before GATE.init()");
- Gate.init();
- //tell GATE we're in batch mode
-// gate.Main.batchMode = true;
-
-
- // create some processing resources
- prof.checkPoint("Before creating the processing resources");
-
- //create a default tokeniser
- FeatureMap params = Factory.newFeatureMap();
- DefaultTokeniser tokeniser = (DefaultTokeniser) Factory.createResource(
- "gate.creole.tokeniser.DefaultTokeniser", params);
- prof.checkPoint("Tokeniser initialised");
-
- //create a default gazetteer
- params = Factory.newFeatureMap();
- DefaultGazetteer gaz = (DefaultGazetteer) Factory.createResource(
- "gate.creole.gazetteer.DefaultGazetteer", params);
- prof.checkPoint("Gazetteer initialised");
-
- //create a splitter
- params = Factory.newFeatureMap();
- SentenceSplitter splitter = (SentenceSplitter) Factory.createResource(
- "gate.creole.splitter.SentenceSplitter", params);
- prof.checkPoint("Sentence splitter initialised");
-
- //create a tagger
- params = Factory.newFeatureMap();
- POSTagger tagger = (POSTagger) Factory.createResource(
- "gate.creole.POSTagger", params);
- prof.checkPoint("POSTagger initialised");
-
- //create a grammar
- params = Factory.newFeatureMap();
- ANNIETransducer transducer = (ANNIETransducer) Factory.createResource(
- "gate.creole.ANNIETransducer", params);
- prof.checkPoint("Grammars initialised");
-
- //create an orthomatcher
- params = Factory.newFeatureMap();
- OrthoMatcher orthomatcher = (OrthoMatcher) Factory.createResource(
- "gate.creole.orthomatcher.OrthoMatcher", params);
- prof.checkPoint("Orthomatcher initialised");
-
-
- // for each document
- // create a gate doc
- // set as the document for hte PRs
- // run the PRs
- // dump output from the doc
- // delete the doc
- Out.prln("\nLooping on input files list");
- Iterator<File> filesIter = inputFiles.iterator();
- docs = inputFiles.size();
- int fileNo=0;
- while(filesIter.hasNext()) {
- File inFile = filesIter.next(); // the current file
- fileNo++;
-
- // set the source URL parameter to a "file:..." URL string
- params.clear();
- params.put(Document.DOCUMENT_URL_PARAMETER_NAME,
inFile.toURI().toURL().toExternalForm());
- params.put(Document.DOCUMENT_ENCODING_PARAMETER_NAME, "");
-
- // create the document
- Document doc = (Document) Factory.createResource(
- "gate.corpora.DocumentImpl", params
- );
- totalDocLength += doc.getContent().size().longValue();
-
- if (maxDocLength < doc.getContent().size().longValue())
- maxDocLength = doc.getContent().size().longValue();
-
- // set the document param on the PRs
- tokeniser.setDocument(doc);
- prof.checkPoint("Processing file " + inFile.getPath() +
- ", #" + fileNo + "/" + docs, new String[0], true, false, false);
- tokeniser.execute();
- prof.checkPoint("", new String[] {"Tokenizer", "Processing"}, false,
false, false);
-
- //run gazetteer
- gaz.setDocument(doc);
- gaz.execute();
- prof.checkPoint("", new String[] {"Gazettier", "Processing"}, false,
false, false);
-
- //run splitter
- splitter.setDocument(doc);
- splitter.execute();
- prof.checkPoint("", new String[] {"Splitter", "Processing"}, false,
false, false);
-
- //run the tagger
- tagger.setDocument(doc);
- tagger.execute();
- prof.checkPoint("", new String[] {"Tagger", "Processing"}, false, false,
false);
-
- //run the transducer
- transducer.setDocument(doc);
- transducer.execute();
- prof.checkPoint("", new String[] {"JAPE grammars", "Processing"}, false,
false, false);
-
- // run the orthomatcher
- orthomatcher.setDocument(doc);
- orthomatcher.execute();
- prof.checkPoint("", new String[] {"Orthomatcher", "Processing"}, false,
false, false);
-
- // make the doc a candidate for garbage collection
- Factory.deleteResource(doc);
-
- } // input files loop
-
- prof.checkPoint("Done!");
-
- totalDocLength = totalDocLength/1024;
- Out.prln("\nTotal KBytes processed: " + (long)totalDocLength);
- Out.prln("\nMax document size in bytes: " + (long)maxDocLength +
- " (" + (long) maxDocLength/1024 + " Kb)");
-
-
- prof.printCategAvg("Processing", docs, totalDocLength, "kb");
- prof.printCategAvg("Tokenizer", docs, totalDocLength, "kb");
- prof.printCategAvg("Gazettier", docs, totalDocLength, "kb");
- prof.printCategAvg("Splitter", docs, totalDocLength, "kb");
- prof.printCategAvg("Tagger", docs, totalDocLength, "kb");
- prof.printCategAvg("JAPE grammars", docs, totalDocLength, "kb");
- prof.printCategAvg("Orthomatcher", docs, totalDocLength, "kb");
- } // main
-
-
-} // class ProfilePRs
Modified:
gate/branches/sawdust2/src/test/disabled/gate/creole/TestControllers.java
===================================================================
--- gate/branches/sawdust2/src/test/gate/creole/TestControllers.java
2016-05-11 09:02:37 UTC (rev 19297)
+++ gate/branches/sawdust2/src/test/disabled/gate/creole/TestControllers.java
2016-05-11 11:12:47 UTC (rev 19298)
@@ -18,14 +18,21 @@
import java.net.URL;
-import junit.framework.*;
-
-import gate.*;
+import gate.Annotation;
+import gate.AnnotationSet;
+import gate.Controller;
+import gate.CreoleRegister;
+import gate.Document;
+import gate.Factory;
+import gate.FeatureMap;
+import gate.Gate;
+import gate.ProcessingResource;
import gate.corpora.TestDocument;
-import gate.creole.gazetteer.DefaultGazetteer;
-import gate.creole.tokeniser.DefaultTokeniser;
import gate.util.GateException;
import gate.util.Out;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
/** Tests for controller classes
*/
@@ -82,14 +89,14 @@
//create a default tokeniser
params = Factory.newFeatureMap();
- params.put(DefaultTokeniser.DEF_TOK_DOCUMENT_PARAMETER_NAME, doc);
+ params.put("document", doc);
ProcessingResource tokeniser = (ProcessingResource) Factory.createResource(
"gate.creole.tokeniser.DefaultTokeniser", params
);
//create a default gazetteer
params = Factory.newFeatureMap();
- params.put(DefaultGazetteer.DEF_GAZ_DOCUMENT_PARAMETER_NAME, doc);
+ params.put("document", doc);
ProcessingResource gaz = (ProcessingResource) Factory.createResource(
"gate.creole.gazetteer.DefaultGazetteer", params
);
Modified:
gate/branches/sawdust2/src/test/disabled/gate/creole/TestCreoleAnnotationHandler.java
===================================================================
---
gate/branches/sawdust2/src/test/gate/creole/TestCreoleAnnotationHandler.java
2016-05-11 09:02:37 UTC (rev 19297)
+++
gate/branches/sawdust2/src/test/disabled/gate/creole/TestCreoleAnnotationHandler.java
2016-05-11 11:12:47 UTC (rev 19298)
@@ -16,21 +16,28 @@
package gate.creole;
import java.net.URL;
-import gate.Gate;
-import gate.corpora.TestDocument;
-import gate.util.GateException;
-import junit.framework.*;
-import org.custommonkey.xmlunit.*;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.ElementNameQualifier;
+import org.custommonkey.xmlunit.XMLUnit;
import org.jdom.input.SAXBuilder;
import org.jdom.output.DOMOutputter;
+import org.jdom.output.Format;
import org.jdom.output.XMLOutputter;
-import org.jdom.output.Format;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
+import gate.Gate;
+import gate.Plugin;
+import gate.corpora.TestDocument;
+import gate.util.GateException;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
/**
* Test for the CreoleAnnotationHandler, compares the XML produced by the
* annotation handler to an expected result.
@@ -66,7 +73,7 @@
URL originalUrl = new
URL(TestDocument.getTestServerName()+"tests/creole-annotation-handler/initial-creole.xml");
org.jdom.Document creoleXml =
jdomBuilder.build(originalUrl.openStream());
- CreoleAnnotationHandler processor = new
CreoleAnnotationHandler(originalUrl);
+ CreoleAnnotationHandler processor = new CreoleAnnotationHandler(new
Plugin.Directory(new
URL(TestDocument.getTestServerName()+"tests/creole-annotation-handler/")));
processor.processAnnotations(creoleXml);
URL expectedURL = new
URL(TestDocument.getTestServerName()+"tests/creole-annotation-handler/expected-creole.xml");
Modified:
gate/branches/sawdust2/src/test/disabled/gate/creole/annic/test/TestAnnic.java
===================================================================
--- gate/branches/sawdust2/src/test/gate/creole/annic/test/TestAnnic.java
2016-05-11 09:02:37 UTC (rev 19297)
+++
gate/branches/sawdust2/src/test/disabled/gate/creole/annic/test/TestAnnic.java
2016-05-11 11:12:47 UTC (rev 19298)
@@ -7,22 +7,21 @@
*/
package gate.creole.annic.test;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import gate.Corpus;
import gate.Document;
import gate.Factory;
import gate.Gate;
+import gate.LanguageAnalyser;
import gate.creole.annic.Constants;
import gate.creole.annic.Hit;
import gate.creole.annic.Parser;
import gate.creole.annic.lucene.LuceneSearcher;
-import gate.creole.splitter.SentenceSplitter;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
@@ -103,10 +102,12 @@
}
AnnicIndexing annicPR = new AnnicIndexing();
- SentenceSplitter splitter = (SentenceSplitter)Factory
+ LanguageAnalyser splitter = (LanguageAnalyser)Factory
.createResource("gate.creole.splitter.SentenceSplitter");
- splitter.setInputASName("Key");
- splitter.setOutputASName("Key");
+ splitter.setParameterValue("inputASName", "Key");
+ splitter.setParameterValue("outputASName", "Key");
+ //splitter.setInputASName("Key");
+ //splitter.setOutputASName("Key");
for(int i = 0; i < testCorpus.size(); i++) {
splitter.setDocument(testCorpus.get(i));
splitter.execute();
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs