ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From james-mas...@apache.org
Subject svn commit: r1784036 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/EventPropertyExtractor.java
Date Wed, 22 Feb 2017 16:50:20 GMT
Author: james-masanz
Date: Wed Feb 22 16:50:19 2017
New Revision: 1784036

URL: http://svn.apache.org/viewvc?rev=1784036&view=rev
Log:
CTAKES-419 Catch CASRuntimeException if there is no UriView

Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/EventPropertyExtractor.java

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/EventPropertyExtractor.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/EventPropertyExtractor.java?rev=1784036&r1=1784035&r2=1784036&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/EventPropertyExtractor.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/feature/EventPropertyExtractor.java
Wed Feb 22 16:50:19 2017
@@ -84,11 +84,12 @@ public class EventPropertyExtractor impl
 		List<Feature> features = new ArrayList<>();
 		
 		//get Document ID:
+		String fname;
 		try {
 			String docID = ViewUriUtil.getURI(view).toString();
 			
 			int begin = docID.lastIndexOf("_");
-			String fname = docID.substring(begin+1);
+			fname = docID.substring(begin+1);
 			features.add(new Feature("docName", fname));
 			
 			if(fname.equals("RAD")||fname.equals("SP")){
@@ -98,8 +99,14 @@ public class EventPropertyExtractor impl
 			}
 			
 		} catch (AnalysisEngineProcessException e) {
-			// TODO Auto-generated catch block
 			e.printStackTrace();
+			fname = "AnalysisEngineProcessException.UnableToGetDocIdFromUriView";
+			features.add(new Feature("docName", fname));
+			
+		} catch (org.apache.uima.cas.CASRuntimeException e) { // for unit tests that don't set
up the UriView 
+			e.printStackTrace();
+			fname = "CASRuntimeException.UnableToGetDocIdFromUriView";
+			features.add(new Feature("docName", fname));
 		}
 
 		//1 get event:



Mime
View raw message