ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlig...@apache.org
Subject svn commit: r1768576 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/nn/data/EventTimeRelPositionPrinter.java
Date Mon, 07 Nov 2016 19:27:19 GMT
Author: dligach
Date: Mon Nov  7 19:27:18 2016
New Revision: 1768576

URL: http://svn.apache.org/viewvc?rev=1768576&view=rev
Log:
removed unused methods (they are in ArgContextProvider now anyway)

Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/nn/data/EventTimeRelPositionPrinter.java

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/nn/data/EventTimeRelPositionPrinter.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/nn/data/EventTimeRelPositionPrinter.java?rev=1768576&r1=1768575&r2=1768576&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/nn/data/EventTimeRelPositionPrinter.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/nn/data/EventTimeRelPositionPrinter.java
Mon Nov  7 19:27:18 2016
@@ -232,84 +232,6 @@ public class EventTimeRelPositionPrinter
   }
 
   /**
-   * Print words from left to right.
-   * @param contextSize number of tokens to include on the left of arg1 and on the right
of arg2
-   */
-  public static String getTokenContext(
-      JCas jCas, 
-      Sentence sent, 
-      Annotation left,
-      String leftType,
-      Annotation right,
-      String rightType,
-      int contextSize) {
-
-    List<String> tokens = new ArrayList<>();
-    for(BaseToken baseToken :  JCasUtil.selectPreceding(jCas, BaseToken.class, left, contextSize))
{
-      if(sent.getBegin() <= baseToken.getBegin()) {
-        tokens.add(baseToken.getCoveredText()); 
-      }
-    }
-    tokens.add("<" + leftType + ">");
-    tokens.add(left.getCoveredText());
-    tokens.add("</" + leftType + ">");
-    for(BaseToken baseToken : JCasUtil.selectBetween(jCas, BaseToken.class, left, right))
{
-      tokens.add(baseToken.getCoveredText());
-    }
-    tokens.add("<" + rightType + ">");
-    tokens.add(right.getCoveredText());
-    tokens.add("</" + rightType + ">");
-    for(BaseToken baseToken : JCasUtil.selectFollowing(jCas, BaseToken.class, right, contextSize))
{
-      if(baseToken.getEnd() <= sent.getEnd()) {
-        tokens.add(baseToken.getCoveredText());
-      }
-    }
-
-    return String.join(" ", tokens).replaceAll("[\r\n]", " ");
-  }
-
-  /**
-   * Print POS tags from left to right.
-   * @param contextSize number of tokens to include on the left of arg1 and on the right
of arg2
-   */
-  public static String getPosContext(
-      JCas jCas, 
-      Sentence sent, 
-      Annotation left,
-      String leftType,
-      Annotation right,
-      String rightType,
-      int contextSize) {
-
-    List<String> tokens = new ArrayList<>();
-    for(BaseToken baseToken :  JCasUtil.selectPreceding(jCas, BaseToken.class, left, contextSize))
{
-      if(sent.getBegin() <= baseToken.getBegin()) {
-        tokens.add(baseToken.getPartOfSpeech()); 
-      }
-    }
-    tokens.add("<" + leftType + ">");
-    for(BaseToken baseToken : JCasUtil.selectCovered(jCas, BaseToken.class, left)) {
-      tokens.add(baseToken.getPartOfSpeech());
-    }
-    tokens.add("</" + leftType + ">");
-    for(BaseToken baseToken : JCasUtil.selectBetween(jCas, BaseToken.class, left, right))
{
-      tokens.add(baseToken.getPartOfSpeech());
-    }
-    tokens.add("<" + rightType + ">");
-    for(BaseToken baseToken : JCasUtil.selectCovered(jCas, BaseToken.class, right)) {
-      tokens.add(baseToken.getPartOfSpeech());
-    }
-    tokens.add("</" + rightType + ">");
-    for(BaseToken baseToken : JCasUtil.selectFollowing(jCas, BaseToken.class, right, contextSize))
{
-      if(baseToken.getEnd() <= sent.getEnd()) {
-        tokens.add(baseToken.getPartOfSpeech());
-      }
-    }
-
-    return String.join(" ", tokens).replaceAll("[\r\n]", " ");
-  }
-  
-  /**
    * Print indices
    * @param contextSize number of tokens to include on the left of arg1 and on the right
of arg2
    */



Mime
View raw message