ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1688259 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
Date Mon, 29 Jun 2015 16:38:01 GMT
Author: clin
Date: Mon Jun 29 16:38:01 2015
New Revision: 1688259

URL: http://svn.apache.org/r1688259
Log:
modify polarity to allow "UNKOWN" status in Anafora XML writer

Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java?rev=1688259&r1=1688258&r2=1688259&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
Mon Jun 29 16:38:01 2015
@@ -73,6 +73,7 @@ import org.apache.ctakes.temporal.ae.I2B
 import org.apache.ctakes.temporal.ae.THYMEAnaforaXMLReader;
 import org.apache.ctakes.temporal.ae.THYMEKnowtatorXMLReader;
 import org.apache.ctakes.temporal.ae.THYMETreebankReader;
+import org.apache.ctakes.typesystem.type.constants.CONST;
 import org.apache.ctakes.typesystem.type.relation.TemporalTextRelation;
 import org.apache.ctakes.typesystem.type.syntax.BaseToken;
 import org.apache.ctakes.typesystem.type.syntax.Chunk;
@@ -1065,7 +1066,10 @@ org.cleartk.eval.Evaluation_ImplBase<Int
 						Element degreeE = doc.createElement("Degree");
 						degreeE.setTextContent("N/A");
 						Element polarityE = doc.createElement("Polarity");
-						String polarity = event.getPolarity()==0? "POS":"NEG";
+						String polarity = "UNKNOWN";
+						int polarityInt = event.getPolarity();
+						if(polarityInt == CONST.NE_POLARITY_NEGATION_ABSENT) polarity= "POS";
+						else if(polarityInt == CONST.NE_POLARITY_NEGATION_PRESENT) polarity = "NEG";
 						polarityE.setTextContent(polarity);
 						Element ctexModE = doc.createElement("ContextualModality");
 						ctexModE.setTextContent(event.getEvent().getProperties().getContextualModality());



Mime
View raw message