Hi,

It is more like a java question than KIM, but would be grateful if anyone
can help.

I am annotating a string using KIM API using the code snippet below. It is
creating the annotations and features but I want the annotations to sorted
by 'id' or 'start'. Is there a easy way to get the KIMAnnotation in sorted
order?


apiSemAnn.execute(kdocFromText);

 KIMAnnotationSet kimASet = kdocFromText.getAnnotations();

Set typesSet = kimASet.getAllTypes();

 Iterator iterator = typesSet.iterator();

*while* (iterator.hasNext()){

Object key = iterator.next();

KIMAnnotationSet kimFilteredASet = kimASet.get(String.*valueOf*(key));

Iterator annIterator = kimFilteredASet.iterator();

System.*out*.println("Annotations of type ["+String.*valueOf*(key) + "] :");

*while* (annIterator.hasNext()){

KIMAnnotation kimAnnotation = (KIMAnnotation)annIterator.next();

System.*out*.println(kimAnnotation.toString());

}

}


Thanks
-- 
Mehnaz
_______________________________________________
Kim-discussion mailing list
[email protected]
http://ontotext.com/mailman/listinfo/kim-discussion

Reply via email to