Skip to content

Commit 9f3d140

Browse files
committed
Ignore trivial annots
1 parent c48db79 commit 9f3d140

1 file changed

Lines changed: 55 additions & 54 deletions

File tree

src/main/webapp/import.jsp

Lines changed: 55 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -287,59 +287,60 @@ try{
287287
ArrayList<Task> tasks=new ArrayList<Task>();
288288
HashMap<String,String> annotTypesByTask=new HashMap<String,String>();
289289
for(Annotation annot:enc.getAnnotations()){
290-
String viewpoint="null";
291-
String iaClass="null";
292-
if(annot.getViewpoint()!=null)viewpoint=annot.getViewpoint();
293-
if(annot.getIAClass()!=null)iaClass=annot.getIAClass();
294-
HashMap<String,String> thisMap=new HashMap<String,String>();
295-
thisMap.put(iaClass,viewpoint);
296-
if(!annotsMap.containsKey(thisMap)){
297-
annotsMap.put(thisMap,Integer.parseInt("1"));
298-
numAnnotations++;
299-
}
300-
else{
301-
Integer numInts = annotsMap.get(thisMap);
302-
numInts = new Integer(numInts.intValue() + 1);
303-
annotsMap.put(thisMap,numInts);
304-
numAnnotations++;
305-
}
306-
if(annot.getMatchAgainst())numMatchAgainst++;
307-
308-
//let's look for match results we can easily link for the user
309-
List<Task> relatedTasks = Task.getTasksFor(annot, myShepherd);
310-
311-
312-
if(relatedTasks!=null && relatedTasks.size()>0){
313-
314-
315-
316-
for(Task task:relatedTasks){
317-
318-
if(task.getParent()!=null && task.getParent().getChildren().size()==1 && task.getParameters()!=null && task.getParameters().has("ibeis.identification")){
319-
//System.out.println("I am a task with only one algorithm");
320-
if(!tasks.contains(task)){
321-
tasks.add(task);
322-
annotTypesByTask.put(task.getId(),iaClass);
323-
}
324-
}
325-
else if(task.getChildren()!=null && task.getChildren().size()>0 && (task.getParent()!=null && task.getParent().getChildren().size()<=1)){
326-
//System.out.println("I am a task with child ID tasks.");
327-
if(!tasks.contains(task)){
328-
tasks.add(task);
329-
annotTypesByTask.put(task.getId(),iaClass);
330-
}
331-
}
332-
else if(task.getChildren()!=null && task.getChildren().size()>2 && task.getParent()==null){
333-
//System.out.println("I am a task with child ID tasks.");
334-
if(!tasks.contains(task)){
335-
tasks.add(task);
336-
annotTypesByTask.put(task.getId(),iaClass);
337-
}
338-
}
339-
}
340-
}
341-
342-
290+
if(!annot.isTrivial()){
291+
String viewpoint="null";
292+
String iaClass="null";
293+
if(annot.getViewpoint()!=null)viewpoint=annot.getViewpoint();
294+
if(annot.getIAClass()!=null)iaClass=annot.getIAClass();
295+
HashMap<String,String> thisMap=new HashMap<String,String>();
296+
thisMap.put(iaClass,viewpoint);
297+
if(!annotsMap.containsKey(thisMap)){
298+
annotsMap.put(thisMap,Integer.parseInt("1"));
299+
numAnnotations++;
300+
}
301+
else{
302+
Integer numInts = annotsMap.get(thisMap);
303+
numInts = new Integer(numInts.intValue() + 1);
304+
annotsMap.put(thisMap,numInts);
305+
numAnnotations++;
306+
}
307+
if(annot.getMatchAgainst())numMatchAgainst++;
308+
309+
//let's look for match results we can easily link for the user
310+
List<Task> relatedTasks = Task.getTasksFor(annot, myShepherd);
311+
312+
313+
if(relatedTasks!=null && relatedTasks.size()>0){
314+
315+
316+
317+
for(Task task:relatedTasks){
318+
319+
if(task.getParent()!=null && task.getParent().getChildren().size()==1 && task.getParameters()!=null && task.getParameters().has("ibeis.identification")){
320+
//System.out.println("I am a task with only one algorithm");
321+
if(!tasks.contains(task)){
322+
tasks.add(task);
323+
annotTypesByTask.put(task.getId(),iaClass);
324+
}
325+
}
326+
else if(task.getChildren()!=null && task.getChildren().size()>0 && (task.getParent()!=null && task.getParent().getChildren().size()<=1)){
327+
//System.out.println("I am a task with child ID tasks.");
328+
if(!tasks.contains(task)){
329+
tasks.add(task);
330+
annotTypesByTask.put(task.getId(),iaClass);
331+
}
332+
}
333+
else if(task.getChildren()!=null && task.getChildren().size()>2 && task.getParent()==null){
334+
//System.out.println("I am a task with child ID tasks.");
335+
if(!tasks.contains(task)){
336+
tasks.add(task);
337+
annotTypesByTask.put(task.getId(),iaClass);
338+
}
339+
}
340+
}
341+
}
342+
343+
} //end if
343344
} //end for
344345
345346
out.println("<td>");
@@ -353,7 +354,7 @@ try{
353354
});
354355
Collections.reverse(tasks);
355356
356-
357+
System.out.println("Num tasks: "+tasks.size());
357358
out.println(" <ul>");
358359
//for(Task task:tasks){
359360
out.println(" <li><a target=\"_blank\" href=\"iaResults.jsp?taskId="+tasks.get(0).getId()+"\" >"+annotTypesByTask.get(tasks.get(0).getId())+"</a>");

0 commit comments

Comments
 (0)