ref 11746: NLP Hub with empty output
https://support.d4science.org/issues/11746 Fixed error when algorithm result is undefined git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-analysis/nlphub@167385 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c0e071095e
commit
7860fc347b
|
@ -780,7 +780,8 @@ buildAlgortihmList = function() {
|
||||||
$("#algorithm-params-div").empty();
|
$("#algorithm-params-div").empty();
|
||||||
|
|
||||||
for (var i = 0; i < jsonContent.output.result.length; i++) {
|
for (var i = 0; i < jsonContent.output.result.length; i++) {
|
||||||
if (jsonContent.output.result[i] === undefined) {
|
if (typeof jsonContent.output.result[i] === 'undefined'
|
||||||
|
|| jsonContent.output.result[i] == null) {
|
||||||
console.log("No result for " + i);
|
console.log("No result for " + i);
|
||||||
} else {
|
} else {
|
||||||
var cb = "<div class='alg-info-p'><input type='checkbox' name='foo-ner-algs' checked named='"
|
var cb = "<div class='alg-info-p'><input type='checkbox' name='foo-ner-algs' checked named='"
|
||||||
|
@ -980,12 +981,17 @@ filterAlgorithmsByAnnotation = function() {
|
||||||
*/
|
*/
|
||||||
checkAnnotation = function(annotation) {
|
checkAnnotation = function(annotation) {
|
||||||
for (var i = 0; i < jsonContent.output.result.length; i++) {
|
for (var i = 0; i < jsonContent.output.result.length; i++) {
|
||||||
var entities = jsonContent.output.result[i].entities;
|
if (typeof jsonContent.output.result[i] === 'undefined'
|
||||||
for (var j = 0; j < entities.length; j++) {
|
|| jsonContent.output.result[i] == null) {
|
||||||
a = entities[j][annotation];
|
console.log("No result for " + i);
|
||||||
if (typeof a != 'undefined') {
|
} else {
|
||||||
if (a.length > 0)
|
var entities = jsonContent.output.result[i].entities;
|
||||||
return true;
|
for (var j = 0; j < entities.length; j++) {
|
||||||
|
a = entities[j][annotation];
|
||||||
|
if (typeof a != 'undefined') {
|
||||||
|
if (a.length > 0)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue