You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by tm...@apache.org on 2015/08/28 20:56:30 UTC

svn commit: r1698390 - /ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/RelationExtractorAnnotator.java

Author: tmill
Date: Fri Aug 28 18:56:30 2015
New Revision: 1698390

URL: http://svn.apache.org/r1698390
Log:
Changed API to get Iterable instead of a List of candidate pairs.

Modified:
    ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/RelationExtractorAnnotator.java

Modified: ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/RelationExtractorAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/RelationExtractorAnnotator.java?rev=1698390&r1=1698389&r2=1698390&view=diff
==============================================================================
--- ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/RelationExtractorAnnotator.java (original)
+++ ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/ae/RelationExtractorAnnotator.java Fri Aug 28 18:56:30 2015
@@ -103,7 +103,7 @@ public abstract class RelationExtractorA
    * Selects the relevant mentions/annotations within a covering annotation for
    * relation identification/extraction.
    */
-  protected abstract List<IdentifiedAnnotationPair> getCandidateRelationArgumentPairs(
+  protected abstract Iterable<IdentifiedAnnotationPair> getCandidateRelationArgumentPairs(
       JCas identifiedAnnotationView,
       Annotation coveringAnnotation);
 
@@ -161,12 +161,8 @@ public abstract class RelationExtractorA
     // walk through each sentence in the text
     for (Annotation coveringAnnotation : JCasUtil.select(jCas, coveringClass)) {
 
-      // collect all relevant relation arguments from the sentence
-      List<IdentifiedAnnotationPair> candidatePairs =
-          this.getCandidateRelationArgumentPairs(jCas, coveringAnnotation);
-
       // walk through the pairs of annotations
-      for (IdentifiedAnnotationPair pair : candidatePairs) {
+      for (IdentifiedAnnotationPair pair : this.getCandidateRelationArgumentPairs(jCas, coveringAnnotation)) {
         IdentifiedAnnotation arg1 = pair.getArg1();
         IdentifiedAnnotation arg2 = pair.getArg2();
         // apply all the feature extractors to extract the list of features