Revision: 17807
http://sourceforge.net/p/gate/code/17807
Author: markagreenwood
Date: 2014-04-11 09:10:51 +0000 (Fri, 11 Apr 2014)
Log Message:
-----------
updated the tests to match the annie changes although I'm still struggling to
fix the annotation diff test
Modified Paths:
--------------
gate/trunk/src/test/gate/creole/TestPR.java
gate/trunk/src/test/gate/creole/gazetteer/TestGazetteer.java
Modified: gate/trunk/src/test/gate/creole/TestPR.java
===================================================================
--- gate/trunk/src/test/gate/creole/TestPR.java 2014-04-11 09:10:02 UTC (rev
17806)
+++ gate/trunk/src/test/gate/creole/TestPR.java 2014-04-11 09:10:51 UTC (rev
17807)
@@ -22,6 +22,7 @@
import gate.Document;
import gate.Factory;
import gate.FeatureMap;
+import gate.corpora.DocumentStaxUtils;
import gate.corpora.TestDocument;
import gate.creole.gazetteer.DefaultGazetteer;
import gate.creole.orthomatcher.OrthoMatcher;
@@ -34,6 +35,7 @@
import gate.jape.constraint.MetaPropertyAccessor;
import gate.util.AnnotationDiffer;
+import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
@@ -192,7 +194,7 @@
//
doc1.getAnnotations().get(ANNIEConstants.LOOKUP_ANNOTATION_TYPE).size()== 60);
assertEquals("Wrong number of annotations produced in " +
doc1.getSourceUrl().getFile(),
- 129,
+ 130,
doc1.getAnnotations().get(ANNIEConstants.LOOKUP_ANNOTATION_TYPE).size());
// assertTrue("Found in "+ doc2.getSourceUrl().getFile()+ " "+
@@ -201,7 +203,7 @@
//
doc2.getAnnotations().get(ANNIEConstants.LOOKUP_ANNOTATION_TYPE).size()== 134);
assertEquals("Wrong number of annotations produced in " +
doc2.getSourceUrl().getFile(),
- 221,
+ 227,
doc2.getAnnotations().get(ANNIEConstants.LOOKUP_ANNOTATION_TYPE).size());
// assertTrue("Found in "+ doc3.getSourceUrl().getFile()+ " "+
@@ -210,7 +212,7 @@
//
doc3.getAnnotations().get(ANNIEConstants.LOOKUP_ANNOTATION_TYPE).size()== 144);
assertEquals("Wrong number of annotations produced in " +
doc3.getSourceUrl().getFile(),
- 269,
+ 271,
doc3.getAnnotations().get(ANNIEConstants.LOOKUP_ANNOTATION_TYPE).size());
}//testGazetteer
@@ -346,7 +348,7 @@
// assertions for doc 1
assertTrue("Found in "+ doc1.getSourceUrl().getFile()+ " "+
doc1.getAnnotations().get(ANNIEConstants.ORGANIZATION_ANNOTATION_TYPE).size() +
- " Organization annotations, instead of the expected 27",
+ " Organization annotations, instead of the expected 28",
doc1.getAnnotations().get(ANNIEConstants.ORGANIZATION_ANNOTATION_TYPE).size()==
27);
assertTrue("Found in "+doc1.getSourceUrl().getFile()+ " "+
doc1.getAnnotations().get(ANNIEConstants.LOCATION_ANNOTATION_TYPE).size() +
@@ -390,8 +392,8 @@
// assertions for doc 3
assertTrue("Found in "+doc3.getSourceUrl().getFile()+ " "+
doc3.getAnnotations().get(ANNIEConstants.ORGANIZATION_ANNOTATION_TYPE).size() +
- " Organization annotations, instead of the expected 27",
-
doc3.getAnnotations().get(ANNIEConstants.ORGANIZATION_ANNOTATION_TYPE).size()==
27);
+ " Organization annotations, instead of the expected 28",
+
doc3.getAnnotations().get(ANNIEConstants.ORGANIZATION_ANNOTATION_TYPE).size()==
28);
assertTrue("Found in "+doc3.getSourceUrl().getFile()+ " "+
doc3.getAnnotations().get(ANNIEConstants.LOCATION_ANNOTATION_TYPE).size() +
" Location annotations, instead of the expected 11",
@@ -636,6 +638,7 @@
public void compareAnnots(Document keyDocument, Document responseDocument)
throws Exception{
// organization type
+ //DocumentStaxUtils.writeDocument(responseDocument, new
File("/home/mark/"+responseDocument.getName()+".xml"));
Iterator<String> iteratorTypes = annotationTypes.iterator();
while (iteratorTypes.hasNext()){
// get the type of annotation
@@ -652,8 +655,9 @@
annotDiffer.setSignificantFeaturesSet(significantFeatures);
annotDiffer.calculateDiff(keyDocument.getAnnotations().get(annotType),
responseDocument.getAnnotations().get(annotType));
- if(DEBUG) annotDiffer.printMissmatches();
-
+
+ annotDiffer.printMissmatches();
+
assertTrue(annotType+ " precision strict in "+
responseDocument.getSourceUrl().getFile()+
" is "+ annotDiffer.getPrecisionStrict()+ " instead of 1.0 ",
Modified: gate/trunk/src/test/gate/creole/gazetteer/TestGazetteer.java
===================================================================
--- gate/trunk/src/test/gate/creole/gazetteer/TestGazetteer.java
2014-04-11 09:10:02 UTC (rev 17806)
+++ gate/trunk/src/test/gate/creole/gazetteer/TestGazetteer.java
2014-04-11 09:10:51 UTC (rev 17807)
@@ -55,20 +55,20 @@
//test with default parameters
gaz.execute();
AnnotationSet resultAS = doc.getAnnotations("GazetteerAS");
- assertEquals("Wrong number of annotations produced",60, resultAS.size());
+ assertEquals("Wrong number of annotations produced",63, resultAS.size());
resultAS.clear();
//test with partial words
gaz.setWholeWordsOnly(false);
gaz.execute();
- assertEquals("Wrong number of annotations produced", 388, resultAS.size());
+ assertEquals("Wrong number of annotations produced", 390, resultAS.size());
gaz.setWholeWordsOnly(true);
resultAS.clear();
//test with prefix matching
gaz.setLongestMatchOnly(false);
gaz.execute();
- assertEquals("Wrong number of annotations produced", 73, resultAS.size());
+ assertEquals("Wrong number of annotations produced", 77, resultAS.size());
gaz.setLongestMatchOnly(true);
resultAS.clear();
Factory.deleteResource(gaz);
@@ -81,7 +81,7 @@
gaz.setDocument(doc);
gaz.setAnnotationSetName("GazetteerAS");
gaz.execute();
- assertEquals("Wrong number of annotations generated", 97, resultAS.size());
+ assertEquals("Wrong number of annotations generated", 100,
resultAS.size());
gaz.setCaseSensitive(true);
resultAS.clear();
Factory.deleteResource(gaz);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs