ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1497137 - /ctakes/sandbox/ctakes-spelling-corrector/src/org/apache/ctakes/spelling/priors/stupid/StupidBackoffModel.java
Date Wed, 26 Jun 2013 22:15:26 GMT
Author: tmill
Date: Wed Jun 26 22:15:26 2013
New Revision: 1497137

URL: http://svn.apache.org/r1497137
Log:
Checked in uimafit version of trainer -- still not working but syncing to work at home.

Modified:
    ctakes/sandbox/ctakes-spelling-corrector/src/org/apache/ctakes/spelling/priors/stupid/StupidBackoffModel.java

Modified: ctakes/sandbox/ctakes-spelling-corrector/src/org/apache/ctakes/spelling/priors/stupid/StupidBackoffModel.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/ctakes-spelling-corrector/src/org/apache/ctakes/spelling/priors/stupid/StupidBackoffModel.java?rev=1497137&r1=1497136&r2=1497137&view=diff
==============================================================================
--- ctakes/sandbox/ctakes-spelling-corrector/src/org/apache/ctakes/spelling/priors/stupid/StupidBackoffModel.java
(original)
+++ ctakes/sandbox/ctakes-spelling-corrector/src/org/apache/ctakes/spelling/priors/stupid/StupidBackoffModel.java
Wed Jun 26 22:15:26 2013
@@ -5,6 +5,8 @@ import java.io.PrintWriter;
 import java.util.HashMap;
 import java.util.List;
 
+import org.apache.ctakes.core.ae.SentenceDetector;
+import org.apache.ctakes.core.ae.TokenizerAnnotatorPTB;
 import org.apache.ctakes.core.cr.FilesInDirectoryCollectionReader;
 import org.apache.ctakes.spelling.priors.WordPriorModel;
 import org.apache.ctakes.typesystem.type.syntax.WordToken;
@@ -14,6 +16,7 @@ import org.apache.uima.UIMAException;
 import org.apache.uima.analysis_engine.AnalysisEngine;
 import org.apache.uima.collection.CollectionReader;
 import org.apache.uima.jcas.JCas;
+import org.uimafit.factory.AggregateBuilder;
 import org.uimafit.factory.AnalysisEngineFactory;
 import org.uimafit.factory.CollectionReaderFactory;
 import org.uimafit.pipeline.JCasIterable;
@@ -45,9 +48,15 @@ public class StupidBackoffModel implemen
 				,FilesInDirectoryCollectionReader.PARAM_EXTENSIONS
 				,new String[]{"txt"}
 				);
-		ae = AnalysisEngineFactory.createAnalysisEngineFromPath("../ctakes-core/desc/analysis_engine/AggregateAE.xml");
-		
-		JCasIterable casIter = new JCasIterable(reader, ae);
+//		ae = AnalysisEngineFactory.createAnalysisEngineFromPath("../ctakes-core/desc/analysis_engine/AggregateAE.xml");
+		AggregateBuilder builder = new AggregateBuilder();
+		builder.add(AnalysisEngineFactory.createPrimitiveDescription(
+		    SentenceDetector.class, 
+		    SentenceDetector.SD_MODEL_FILE_PARAM,
+        "org/apache/ctakes/core/sentdetect/sd-med-model.zip"));
+		builder.add(AnalysisEngineFactory.createPrimitiveDescription(TokenizerAnnotatorPTB.class));
+		    
+		JCasIterable casIter = new JCasIterable(reader, builder.createAggregate());
 		while(casIter.hasNext()){
 			String prefix = null;
 			String word = null;



Mime
View raw message