From 987641eb31e6e3117cc5c9013c8edf606abcb2e6 Mon Sep 17 00:00:00 2001 From: Johann Petrak Date: Tue, 12 Jun 2018 21:04:12 +0100 Subject: [PATCH 1/2] Test pipeline and resources for investigating issue #5 --- tests/test-virtual1.xgapp | 227 ++++++++++++++++++++++++++++++++++++++ tests/virtual1-doc1.txt | 6 + tests/virtual1.def | 1 + tests/virtual1.lst | 5 + 4 files changed, 239 insertions(+) create mode 100644 tests/test-virtual1.xgapp create mode 100644 tests/virtual1-doc1.txt create mode 100644 tests/virtual1.def create mode 100644 tests/virtual1.lst diff --git a/tests/test-virtual1.xgapp b/tests/test-virtual1.xgapp new file mode 100644 index 0000000..113fb0b --- /dev/null +++ b/tests/test-virtual1.xgapp @@ -0,0 +1,227 @@ + + + + + uk.ac.gate.plugins + stringannotation + 4.1-SNAPSHOT + + + uk.ac.gate.plugins + annie + 8.5 + + + + uk.ac.gate.plugins + tools + 8.5 + + + + java.util.Collections$UnmodifiableSet + + + + + + gate.corpora.DocumentImpl + virtual1-doc1.txt_0001A + + gate.util.SimpleFeatureMapImpl + + + encoding + UTF-8 + + + sourceUrl + + $relpath$virtual1-doc1.txt + + + + stringContent + + + + + + + gate.corpora.CorpusImpl + Corpus for virtual1-doc1.txt_0001A + + gate.util.SimpleFeatureMapImpl + + + + + + + 1 + + + + + gate.util.SimpleFeatureMapImpl + + + gate.creole.annotdelete.AnnotationDeletePR + Document Reset PR + + gate.util.SimpleFeatureMapImpl + + + + gate.util.SimpleFeatureMapImpl + + + + + + 1 + + + + + gate.util.SimpleFeatureMapImpl + + + gate.creole.tokeniser.DefaultTokeniser + ANNIE English Tokeniser + + gate.util.SimpleFeatureMapImpl + + + + gate.util.SimpleFeatureMapImpl + + + + + + 1 + + + + + gate.util.SimpleFeatureMapImpl + + + gate.creole.splitter.SentenceSplitter + ANNIE Sentence Splitter + + gate.util.SimpleFeatureMapImpl + + + + gate.util.SimpleFeatureMapImpl + + + + + + 1 + + + + + gate.util.SimpleFeatureMapImpl + + + gate.creole.POSTagger + ANNIE POS Tagger + + gate.util.SimpleFeatureMapImpl + + + + gate.util.SimpleFeatureMapImpl + + + + + + 1 + + + + + gate.util.SimpleFeatureMapImpl + + + gate.creole.morph.Morph + GATE Morphological analyser 00019 + + gate.util.SimpleFeatureMapImpl + + + + gate.util.SimpleFeatureMapImpl + + + + + + 1 + + + + + gate.util.SimpleFeatureMapImpl + + + textFeature + root + + + + com.jpetrak.gate.stringannotation.extendedgazetteer.ExtendedGazetteer + ExtendedGazetteer + + gate.util.SimpleFeatureMapImpl + + + caseSensitive + false + + + configFileURL + + $relpath$virtual1.def + + + + + + gate.util.SimpleFeatureMapImpl + + + + + + java.util.ArrayList + + + + + + + + + + + java.util.ArrayList + + gate.creole.ConditionalSerialAnalyserController + test-virtual1 + + gate.util.SimpleFeatureMapImpl + + + + gate.util.SimpleFeatureMapImpl + + + + \ No newline at end of file diff --git a/tests/virtual1-doc1.txt b/tests/virtual1-doc1.txt new file mode 100644 index 0000000..6be2a53 --- /dev/null +++ b/tests/virtual1-doc1.txt @@ -0,0 +1,6 @@ +Some word1 a b and c d. +c d at the start. +at the end: b c +and: c d +and: c d. +and: c d e. diff --git a/tests/virtual1.def b/tests/virtual1.def new file mode 100644 index 0000000..c51f748 --- /dev/null +++ b/tests/virtual1.def @@ -0,0 +1 @@ +virtual1.lst:major:minor:lang:OutType diff --git a/tests/virtual1.lst b/tests/virtual1.lst new file mode 100644 index 0000000..b30a993 --- /dev/null +++ b/tests/virtual1.lst @@ -0,0 +1,5 @@ +word1 f1=v1 +a b f1=v2 +c d f1=v3 +c d f1=v4 +b c f1=v5 From 9a334e421d33da90b378b75c940b623870af86c8 Mon Sep 17 00:00:00 2001 From: Johann Petrak Date: Thu, 27 Sep 2018 19:00:31 +0100 Subject: [PATCH 2/2] Make it use ResourceReference instead of URL. Should fix #18 --- .../gate/stringannotation/regexp/JavaRegexpAnnotator.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/jpetrak/gate/stringannotation/regexp/JavaRegexpAnnotator.java b/src/main/java/com/jpetrak/gate/stringannotation/regexp/JavaRegexpAnnotator.java index a87b578..14d9245 100644 --- a/src/main/java/com/jpetrak/gate/stringannotation/regexp/JavaRegexpAnnotator.java +++ b/src/main/java/com/jpetrak/gate/stringannotation/regexp/JavaRegexpAnnotator.java @@ -66,13 +66,13 @@ public class JavaRegexpAnnotator extends AbstractLanguageAnalyser private static final long serialVersionUID = 1L; @CreoleParameter(comment = "The URL of the regular expression annotator list") - public void setPatternFileURL(URL patternfileurl) { + public void setPatternFileURL(ResourceReference patternfileurl) { patternFileURL = patternfileurl; } - public URL getPatternFileURL() { + public ResourceReference getPatternFileURL() { return patternFileURL; } - protected URL patternFileURL = null; + protected ResourceReference patternFileURL = null; @CreoleParameter(comment = "The annotation set where to create the annotations", @@ -501,7 +501,7 @@ protected void annotateMatch(PatternRule rule, AnnotationSet outputAS, TextChunk } // for(anndescs) } - List loadRulesList(URL patternFile) throws UnsupportedEncodingException, IOException, ResourceInstantiationException { + List loadRulesList(ResourceReference patternFile) throws UnsupportedEncodingException, IOException, ResourceInstantiationException { List patternrules = new ArrayList(); BufferedReader reader = new BomStrippingInputStreamReader(patternFile.openStream(), "UTF-8");