Revision: 17820
http://sourceforge.net/p/gate/code/17820
Author: markagreenwood
Date: 2014-04-11 18:01:40 +0000 (Fri, 11 Apr 2014)
Log Message:
-----------
a null pointer check so we can return a slightly more useful error message --
the message could be better but I'm not quite sure what it should be
Modified Paths:
--------------
gate/trunk/plugins/Learning/src/gate/learning/LightWeightLearningApi.java
Modified:
gate/trunk/plugins/Learning/src/gate/learning/LightWeightLearningApi.java
===================================================================
--- gate/trunk/plugins/Learning/src/gate/learning/LightWeightLearningApi.java
2014-04-11 17:52:42 UTC (rev 17819)
+++ gate/trunk/plugins/Learning/src/gate/learning/LightWeightLearningApi.java
2014-04-11 18:01:40 UTC (rev 17820)
@@ -1186,6 +1186,11 @@
}
for(int i = 0; i < annotationArray.size(); ++i) {
if(selectedLabels[i] < 0) continue;
+
+ if (labelsAndId.id2Label.get(selectedLabels[i] + 1) == null) {
+ throw new RuntimeException("Required feature '"+featName+"' is
missing");
+ }
+
FeatureMap features = Factory.newFeatureMap();
Annotation ann = annotationArray.get(i);
features.putAll(ann.getFeatures()); //GG: put all instance features on
output
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