Revision: 18396 http://sourceforge.net/p/gate/code/18396 Author: ian_roberts Date: 2014-10-20 20:24:50 +0000 (Mon, 20 Oct 2014) Log Message: ----------- Handle the possibility that "answer" might be missing.
Modified Paths: -------------- gate/trunk/plugins/Crowd_Sourcing/src/gate/crowdsource/ne/EntityAnnotationResultsImporter.java Modified: gate/trunk/plugins/Crowd_Sourcing/src/gate/crowdsource/ne/EntityAnnotationResultsImporter.java =================================================================== --- gate/trunk/plugins/Crowd_Sourcing/src/gate/crowdsource/ne/EntityAnnotationResultsImporter.java 2014-10-20 17:11:31 UTC (rev 18395) +++ gate/trunk/plugins/Crowd_Sourcing/src/gate/crowdsource/ne/EntityAnnotationResultsImporter.java 2014-10-20 20:24:50 UTC (rev 18396) @@ -204,7 +204,7 @@ for(JsonElement judgmentElt : judgments) { JsonObject judgment = judgmentElt.getAsJsonObject(); JsonObject data = judgment.getAsJsonObject("data"); - JsonArray answer = data.get("answer").getAsJsonArray(); + JsonArray answer = data.getAsJsonArray("answer"); Long judgmentId = judgment.get("id").getAsLong(); Double trust = judgment.get("trust").getAsDouble(); Long workerId = judgment.get("worker_id").getAsLong(); @@ -217,7 +217,7 @@ } } } - if(answer.size() > 0) { + if(answer != null && answer.size() > 0) { // judgment says there are some entities to annotate. Look for // sequences of consecutive token indices and create one result // annotation for each such sequence This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://p.sf.net/sfu/Zoho _______________________________________________ GATE-cvs mailing list GATE-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gate-cvs