ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1590238 - /ctakes/trunk/ctakes-pos-tagger/src/main/java/org/apache/ctakes/postagger/POSTagger.java
Date Sat, 26 Apr 2014 13:53:51 GMT
Author: tmill
Date: Sat Apr 26 13:53:51 2014
New Revision: 1590238

URL: http://svn.apache.org/r1590238
Log:
CTAKES-297: Added method for getting default descriptor & model-specifying descriptor
for POSTagger.

Modified:
    ctakes/trunk/ctakes-pos-tagger/src/main/java/org/apache/ctakes/postagger/POSTagger.java

Modified: ctakes/trunk/ctakes-pos-tagger/src/main/java/org/apache/ctakes/postagger/POSTagger.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-pos-tagger/src/main/java/org/apache/ctakes/postagger/POSTagger.java?rev=1590238&r1=1590237&r2=1590238&view=diff
==============================================================================
--- ctakes/trunk/ctakes-pos-tagger/src/main/java/org/apache/ctakes/postagger/POSTagger.java
(original)
+++ ctakes/trunk/ctakes-pos-tagger/src/main/java/org/apache/ctakes/postagger/POSTagger.java
Sat Apr 26 13:53:51 2014
@@ -61,11 +61,13 @@ import org.apache.ctakes.typesystem.type
 import org.apache.ctakes.typesystem.type.textspan.Sentence;
 import org.apache.log4j.Logger;
 import org.apache.uima.UimaContext;
+import org.apache.uima.analysis_engine.AnalysisEngineDescription;
 import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
 import org.apache.uima.jcas.JCas;
 import org.apache.uima.resource.ResourceInitializationException;
 import org.uimafit.component.JCasAnnotator_ImplBase;
 import org.uimafit.descriptor.ConfigurationParameter;
+import org.uimafit.factory.AnalysisEngineFactory;
 import org.uimafit.util.JCasUtil;
 
 public class POSTagger extends JCasAnnotator_ImplBase {
@@ -80,6 +82,7 @@ public class POSTagger extends JCasAnnot
 	 * resources/models/README.
 	 */
 	public static final String POS_MODEL_FILE_PARAM = "PosModelFile";
+	public static final String PARAM_POS_MODEL_FILE = POS_MODEL_FILE_PARAM;
 	@ConfigurationParameter(
 	    name = POS_MODEL_FILE_PARAM,
 	    mandatory = false,
@@ -136,4 +139,14 @@ public class POSTagger extends JCasAnnot
 			}
 		}
 	}
+	
+	public static AnalysisEngineDescription createAnnotatorDescription() throws ResourceInitializationException{
+	  return AnalysisEngineFactory.createPrimitiveDescription(POSTagger.class);     
+	}
+	
+	public static AnalysisEngineDescription createAnnotatorDescription(String model) throws
ResourceInitializationException{
+	  return AnalysisEngineFactory.createPrimitiveDescription(POSTagger.class, 
+	      POSTagger.PARAM_POS_MODEL_FILE,
+	      model);
+	}
 }



Mime
View raw message