You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by dl...@apache.org on 2014/10/15 20:30:23 UTC
svn commit: r1632161 -
/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/pipelines/RelationAnnotationViewer.java
Author: dligach
Date: Wed Oct 15 18:30:22 2014
New Revision: 1632161
URL: http://svn.apache.org/r1632161
Log:
removed a few lines no longer appicable
Modified:
ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/pipelines/RelationAnnotationViewer.java
Modified: ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/pipelines/RelationAnnotationViewer.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/pipelines/RelationAnnotationViewer.java?rev=1632161&r1=1632160&r2=1632161&view=diff
==============================================================================
--- ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/pipelines/RelationAnnotationViewer.java (original)
+++ ctakes/trunk/ctakes-relation-extractor/src/main/java/org/apache/ctakes/relationextractor/pipelines/RelationAnnotationViewer.java Wed Oct 15 18:30:22 2014
@@ -77,37 +77,23 @@ public class RelationAnnotationViewer {
@Override
public void process(JCas jCas) throws AnalysisEngineProcessException {
-
+
JCas systemView;
try {
systemView = jCas.getView(CAS.NAME_DEFAULT_SOFA);
} catch (CASException e) {
throw new AnalysisEngineProcessException(e);
}
-
+
for(BinaryTextRelation binaryTextRelation : JCasUtil.select(systemView, BinaryTextRelation.class)) {
IdentifiedAnnotation entity1 = (IdentifiedAnnotation) binaryTextRelation.getArg1().getArgument();
IdentifiedAnnotation entity2 = (IdentifiedAnnotation) binaryTextRelation.getArg2().getArgument();
String category = binaryTextRelation.getCategory();
- if(! category.equals("location_of")) {
- continue;
- }
-
+
String arg1 = entity1.getCoveredText().toLowerCase();
String arg2 = entity2.getCoveredText().toLowerCase();
- int type1 = entity1.getTypeID();
- int type2 = entity2.getTypeID();
-
- // first argument has to be an anatomical site
- if(type1 != CONST.NE_TYPE_ID_ANATOMICAL_SITE) {
- continue;
- }
- // skip location_of(anatomical site, anatomical site)
- if(type1 == CONST.NE_TYPE_ID_ANATOMICAL_SITE && type2 == CONST.NE_TYPE_ID_ANATOMICAL_SITE) {
- continue;
- }
List<Sentence> enclosingSentences = JCasUtil.selectCovering(
systemView,
@@ -115,7 +101,7 @@ public class RelationAnnotationViewer {
entity1.getBegin(),
entity2.getEnd());
- System.out.format("%s|%s|%s\n", arg1, arg2, enclosingSentences.get(0).getCoveredText());
+ System.out.format("%s|%s|%s|%s\n", category, arg1, arg2, enclosingSentences.get(0).getCoveredText());
}
}
}