ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chen...@apache.org
Subject svn commit: r1635555 - /ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/SubjectCleartkAnalysisEngine.java
Date Thu, 30 Oct 2014 17:19:19 GMT
Author: chenpei
Date: Thu Oct 30 17:19:19 2014
New Revision: 1635555

URL: http://svn.apache.org/r1635555
Log:
CTAKES-94: Adding factory method to SubjectCleartkAnalysisEngine.java

Modified:
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/SubjectCleartkAnalysisEngine.java

Modified: ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/SubjectCleartkAnalysisEngine.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/SubjectCleartkAnalysisEngine.java?rev=1635555&r1=1635554&r2=1635555&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/SubjectCleartkAnalysisEngine.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/medfacts/cleartk/SubjectCleartkAnalysisEngine.java
Thu Oct 30 17:19:19 2014
@@ -27,9 +27,12 @@ import org.apache.ctakes.assertion.attri
 import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
 import org.apache.log4j.Level;
 import org.apache.uima.UimaContext;
+import org.apache.uima.analysis_engine.AnalysisEngineDescription;
 import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
+import org.apache.uima.fit.factory.AnalysisEngineFactory;
 import org.apache.uima.resource.ResourceInitializationException;
 import org.cleartk.ml.Instance;
+import org.cleartk.ml.jar.GenericJarClassifierFactory;
 
 public class SubjectCleartkAnalysisEngine extends
     AssertionCleartkAnalysisEngine {
@@ -95,5 +98,17 @@ public class SubjectCleartkAnalysisEngin
         this.featureSelection = createFeatureSelection(this.featureSelectionThreshold);
       }    
   }
+  
+	public static AnalysisEngineDescription createAnnotatorDescription(String modelPath) throws
ResourceInitializationException {
+		  return AnalysisEngineFactory.createEngineDescription(SubjectCleartkAnalysisEngine.class,
+		      AssertionCleartkAnalysisEngine.PARAM_FEATURE_CONFIG,
+	        AssertionCleartkAnalysisEngine.FEATURE_CONFIG.DEP_REGEX,
+		      GenericJarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH,
+		      modelPath);
+		}
+
+		public static AnalysisEngineDescription createAnnotatorDescription() throws ResourceInitializationException
{
+		  return createAnnotatorDescription("/org/apache/ctakes/assertion/models/subject/model.jar");
+		}  
     
 }



Mime
View raw message