You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2017/10/30 17:27:34 UTC
svn commit: r1813807 - in
/uima/uv3/uimaj-v3/trunk/uimaj-examples/src/main/java/org/apache/uima/examples:
PrintAnnotations.java SofaExampleApplication.java
Author: schor
Date: Mon Oct 30 17:27:34 2017
New Revision: 1813807
URL: http://svn.apache.org/viewvc?rev=1813807&view=rev
Log:
[UIMA-5625] uv3 idioms in examples
Modified:
uima/uv3/uimaj-v3/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/PrintAnnotations.java
uima/uv3/uimaj-v3/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/SofaExampleApplication.java
Modified: uima/uv3/uimaj-v3/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/PrintAnnotations.java
URL: http://svn.apache.org/viewvc/uima/uv3/uimaj-v3/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/PrintAnnotations.java?rev=1813807&r1=1813806&r2=1813807&view=diff
==============================================================================
--- uima/uv3/uimaj-v3/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/PrintAnnotations.java (original)
+++ uima/uv3/uimaj-v3/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/PrintAnnotations.java Mon Oct 30 17:27:34 2017
@@ -62,7 +62,7 @@ public class PrintAnnotations {
public static void printAnnotations(CAS aCAS, PrintStream aOut) {
// Version 3 using select with Stream support
- aCAS.getAnnotationIndex().select(Annotation.class).forEach(fs -> printFS(fs, aCAS, 0, aOut));
+ aCAS.select(Annotation.class).forEach(fs -> printFS(fs, aCAS, 0, aOut));
// // Version 3 using select with extended for
// for (Annotation fs : aCAS.getAnnotationIndex().select(Annotation.class)) {
Modified: uima/uv3/uimaj-v3/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/SofaExampleApplication.java
URL: http://svn.apache.org/viewvc/uima/uv3/uimaj-v3/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/SofaExampleApplication.java?rev=1813807&r1=1813806&r2=1813807&view=diff
==============================================================================
--- uima/uv3/uimaj-v3/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/SofaExampleApplication.java (original)
+++ uima/uv3/uimaj-v3/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/SofaExampleApplication.java Mon Oct 30 17:27:34 2017
@@ -95,13 +95,13 @@ public class SofaExampleApplication {
System.out.println("---Printing all annotations for German Sofa---");
- germanView.select(Annotation.class).forEach(annot -> {
+ for (Annotation annot : germanView.select(Annotation.class)) {
System.out.println(" " + annot.getType().getName() + ": " + annot.getCoveredText());
if (annot.getType() == cross) {
Annotation crossAnnot = (Annotation) annot.getFeatureValue(other);
System.out.println(" other annotation feature: " + crossAnnot.getCoveredText());
}
- });
+ }
// // and annotator iterator for the German CAS View