ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chen...@apache.org
Subject svn commit: r1493198 - in /ctakes/trunk: ctakes-constituency-parser/src/main/java/org/apache/ctakes/constituency/parser/util/ ctakes-core-res/src/main/resources/org/apache/ctakes/core/sentdetect/ ctakes-core/desc/analysis_engine/ ctakes-core/src/main/j...
Date Fri, 14 Jun 2013 18:43:36 GMT
Author: chenpei
Date: Fri Jun 14 18:43:35 2013
New Revision: 1493198

URL: http://svn.apache.org/r1493198
Log:
CTAKES-209, CTAKES-210 -  With the new SentenceDetector working with OpenNLP 1.5, we can simplify
how models are loaded now.
- Deleted the SuffixMaxentModelResourceImpl and related classes. It's just a string to the
model file now.
- Deleted duplicated SentenceDectector.xml descriptors that were scattered.
- Added util in FileLocator.java to read in resources from InputStream instead of physical
path File.  Updated the SD to use this mechanism.

Added:
    ctakes/trunk/ctakes-core-res/src/main/resources/org/apache/ctakes/core/sentdetect/sd-med-model.zip
  (with props)
Removed:
    ctakes/trunk/ctakes-core-res/src/main/resources/org/apache/ctakes/core/sentdetect/sd-med-model.bin
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/resource/MaxentModelResource.java
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/resource/SuffixMaxentModelResourceImpl.java
    ctakes/trunk/ctakes-ne-contexts/desc/test/SentenceDetectorAnnotator.xml
    ctakes/trunk/ctakes-pos-tagger/desc/SentenceDetectorAnnotator.xml
    ctakes/trunk/ctakes-pos-tagger/desc/SimpleSegmentAnnotator.xml
    ctakes/trunk/ctakes-pos-tagger/desc/test/SentenceDetectorAnnotator.xml
    ctakes/trunk/ctakes-pos-tagger/desc/test/SimpleSegmentAnnotator.xml
    ctakes/trunk/ctakes-pos-tagger/desc/test/TokenizerAnnotator.xml
    ctakes/trunk/ctakes-smoking-status/desc/analysis_engine/SentenceDetectorAnnotator.xml
Modified:
    ctakes/trunk/ctakes-constituency-parser/src/main/java/org/apache/ctakes/constituency/parser/util/CommandLineParserUtil.java
    ctakes/trunk/ctakes-core/desc/analysis_engine/SentenceDetectorAnnotator.xml
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SentenceDetector.java
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ci/HyphenTextModifierImpl.java
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/resource/FileLocator.java
    ctakes/trunk/ctakes-core/src/test/java/org/apache/ctakes/core/ci/HyphenTextModifierImplTests.java
    ctakes/trunk/ctakes-dependency-parser/desc/analysis_engine/ClearNLPDependencyParserPlaintextAggregate.xml
    ctakes/trunk/ctakes-dependency-parser/desc/analysis_engine/ClearNLPSRLPlaintextAggregate.xml
    ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPDependencyParserAE.java
    ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPSemanticRoleLabelerAE.java
    ctakes/trunk/ctakes-ne-contexts/desc/test/SegmentTokenSentenceAggregate.xml
    ctakes/trunk/ctakes-pos-tagger/desc/test/POSTaggerAggregate.xml
    ctakes/trunk/ctakes-pos-tagger/desc/test/POSTaggerAggregate2.xml
    ctakes/trunk/ctakes-pos-tagger/desc/test/POSTaggerAggregate3.xml
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/EventAndTimeExtractionPipeline.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/EventExtractionPipeline.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/utils/CheckKnowtatorAnnotations.java

Modified: ctakes/trunk/ctakes-constituency-parser/src/main/java/org/apache/ctakes/constituency/parser/util/CommandLineParserUtil.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-constituency-parser/src/main/java/org/apache/ctakes/constituency/parser/util/CommandLineParserUtil.java?rev=1493198&r1=1493197&r2=1493198&view=diff
==============================================================================
--- ctakes/trunk/ctakes-constituency-parser/src/main/java/org/apache/ctakes/constituency/parser/util/CommandLineParserUtil.java
(original)
+++ ctakes/trunk/ctakes-constituency-parser/src/main/java/org/apache/ctakes/constituency/parser/util/CommandLineParserUtil.java
Fri Jun 14 18:43:35 2013
@@ -25,7 +25,6 @@ import org.apache.ctakes.constituency.pa
 import org.apache.ctakes.core.ae.SentenceDetector;
 import org.apache.ctakes.core.ae.SimpleSegmentAnnotator;
 import org.apache.ctakes.core.ae.TokenizerAnnotatorPTB;
-import org.apache.ctakes.core.resource.SuffixMaxentModelResourceImpl;
 import org.apache.ctakes.typesystem.type.syntax.TopTreebankNode;
 import org.apache.uima.UIMAException;
 import org.apache.uima.analysis_engine.AnalysisEngine;
@@ -52,11 +51,10 @@ public class CommandLineParserUtil {
 //		AnalysisEngine ae = AnalysisEngineFactory.createAnalysisEngineFromPath("desc/analysis_engine/AggregateParsingProcessor.xml");
 		AggregateBuilder builder = new AggregateBuilder();
 		builder.add(AnalysisEngineFactory.createPrimitiveDescription(SimpleSegmentAnnotator.class));
-		builder.add(AnalysisEngineFactory.createPrimitiveDescription(SentenceDetector.class,
-				"MaxentModel",
-		        ExternalResourceFactory.createExternalResourceDescription(
-		                SuffixMaxentModelResourceImpl.class,
-		                SentenceDetector.class.getResource("../sentdetect/sdmed.mod"))));
+	    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));
 		builder.add(AnalysisEngineFactory.createPrimitiveDescription(ConstituencyParser.class));
 		

Added: ctakes/trunk/ctakes-core-res/src/main/resources/org/apache/ctakes/core/sentdetect/sd-med-model.zip
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core-res/src/main/resources/org/apache/ctakes/core/sentdetect/sd-med-model.zip?rev=1493198&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ctakes/trunk/ctakes-core-res/src/main/resources/org/apache/ctakes/core/sentdetect/sd-med-model.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: ctakes/trunk/ctakes-core/desc/analysis_engine/SentenceDetectorAnnotator.xml
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/desc/analysis_engine/SentenceDetectorAnnotator.xml?rev=1493198&r1=1493197&r2=1493198&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/desc/analysis_engine/SentenceDetectorAnnotator.xml (original)
+++ ctakes/trunk/ctakes-core/desc/analysis_engine/SentenceDetectorAnnotator.xml Fri Jun 14
18:43:35 2013
@@ -35,6 +35,13 @@
 <multiValued>true</multiValued>
 <mandatory>false</mandatory>
 </configurationParameter>
+<configurationParameter>
+<name>SentenceModelFile</name>
+<description>The file that contains the MaxEnt model used by the Sentence Dectector</description>
+<type>String</type>
+<multiValued>false</multiValued>
+<mandatory>true</mandatory>
+</configurationParameter>
 </configurationParameters>
 <configurationParameterSettings>
 <nameValuePair>
@@ -43,6 +50,12 @@
 <array/>
 </value>
 </nameValuePair>
+<nameValuePair>
+<name>SentenceModelFile</name>
+<value>
+<string>org/apache/ctakes/core/sentdetect/sd-med-model.zip</string>
+</value>
+</nameValuePair>
 </configurationParameterSettings>
 <typeSystemDescription/>
 <typePriorities/>
@@ -64,30 +77,4 @@
 <outputsNewCASes>false</outputsNewCASes>
 </operationalProperties>
 </analysisEngineMetaData>
-<externalResourceDependencies>
-<externalResourceDependency>
-<key>MaxentModel</key>
-<description></description>
-<interfaceName>org.apache.ctakes.core.resource.MaxentModelResource</interfaceName>
-<optional>false</optional>
-</externalResourceDependency>
-</externalResourceDependencies>
-<resourceManagerConfiguration>
-<externalResources>
-<externalResource>
-<name>MaxentModelFile</name>
-<description></description>
-<fileResourceSpecifier>
-<fileUrl>file:org/apache/ctakes/core/sentdetect/sdmed.mod</fileUrl>
-</fileResourceSpecifier>
-<implementationName>org.apache.ctakes.core.resource.SuffixMaxentModelResourceImpl</implementationName>
-</externalResource>
-</externalResources>
-<externalResourceBindings>
-<externalResourceBinding>
-<key>MaxentModel</key>
-<resourceName>MaxentModelFile</resourceName>
-</externalResourceBinding>
-</externalResourceBindings>
-</resourceManagerConfiguration>
 </taeDescription>

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SentenceDetector.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SentenceDetector.java?rev=1493198&r1=1493197&r2=1493198&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SentenceDetector.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SentenceDetector.java
Fri Jun 14 18:43:35 2013
@@ -20,15 +20,22 @@ package org.apache.ctakes.core.ae;
 
 import java.io.File;
 import java.io.IOException;
+import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Set;
 
-import opennlp.maxent.GISModel;
-import opennlp.maxent.io.SuffixSensitiveGISModelWriter;
 import opennlp.tools.sentdetect.DefaultSDContextGenerator;
-import opennlp.tools.sentdetect.SentenceDetectorME;
+import opennlp.tools.sentdetect.SentenceModel;
+import opennlp.tools.util.InvalidFormatException;
 
+import org.apache.ctakes.core.resource.FileLocator;
+import org.apache.ctakes.core.sentence.EndOfSentenceScannerImpl;
+import org.apache.ctakes.core.sentence.SentenceDetectorCtakes;
+import org.apache.ctakes.core.sentence.SentenceSpan;
+import org.apache.ctakes.core.util.ParamUtil;
+import org.apache.ctakes.typesystem.type.textspan.Segment;
+import org.apache.ctakes.typesystem.type.textspan.Sentence;
 import org.apache.log4j.Logger;
 import org.apache.uima.UimaContext;
 import org.apache.uima.analysis_component.JCasAnnotator_ImplBase;
@@ -39,15 +46,6 @@ import org.apache.uima.jcas.JFSIndexRepo
 import org.apache.uima.resource.ResourceAccessException;
 import org.apache.uima.resource.ResourceInitializationException;
 
-
-import org.apache.ctakes.core.resource.MaxentModelResource;
-import org.apache.ctakes.core.sentence.EndOfSentenceScannerImpl;
-import org.apache.ctakes.core.sentence.SentenceDetectorCtakes;
-import org.apache.ctakes.core.sentence.SentenceSpan;
-import org.apache.ctakes.core.util.ParamUtil;
-import org.apache.ctakes.typesystem.type.textspan.Segment;
-import org.apache.ctakes.typesystem.type.textspan.Sentence;
-
 /**
  * Wraps the OpenNLP sentence detector in a UIMA annotator
  * 
@@ -64,7 +62,9 @@ public class SentenceDetector extends JC
 	// LOG4J logger based on class name
 	private Logger logger = Logger.getLogger(getClass().getName());
 
-	private final String MAXENT_MODEL_RESRC_KEY = "MaxentModel";
+	public static final String SD_MODEL_FILE_PARAM = "SentenceModelFile";
+
+	private opennlp.tools.sentdetect.SentenceModel sdmodel;
 
 	private UimaContext context;
 
@@ -84,7 +84,7 @@ public class SentenceDetector extends JC
 		context = aContext;
 		try {
 			configInit();
-		} catch (ResourceAccessException ace) {
+		} catch (Exception ace) {
 			throw new ResourceInitializationException(ace);
 		}
 	}
@@ -93,29 +93,26 @@ public class SentenceDetector extends JC
 	 * Reads configuration parameters.
 	 * 
 	 * @throws ResourceAccessException
+	 * @throws IOException 
+	 * @throws InvalidFormatException 
 	 */
-	private void configInit() throws ResourceAccessException {
-		MaxentModelResource mmResrc = (MaxentModelResource) context
-				.getResourceObject(MAXENT_MODEL_RESRC_KEY);
-		// <code>SuffixMaxentModelResourceImpl</code> will log the name of the
-		// resource at load() time
-		// logger.info("Sentence detector resource: " +
-		// mmResrc.getModel().toString());
-
-		if (mmResrc == null) {
-			// TODO Consider throwing an exception here
-			logger.warn("Unable to locate resource with key="
-					+ MAXENT_MODEL_RESRC_KEY + ".");
-		} else {
+	private void configInit() throws ResourceAccessException, InvalidFormatException, IOException
{
+
+		String sdModelPath = (String) context
+				.getConfigParameterValue(SD_MODEL_FILE_PARAM);
+			InputStream is = FileLocator.getAsStream(sdModelPath);
+			logger.info("POS tagger model file: " + sdModelPath);
+			sdmodel = new SentenceModel(is);
+			is.close();
 			EndOfSentenceScannerImpl eoss = new EndOfSentenceScannerImpl();
 			char[] eosc = eoss.getEndOfSentenceCharacters();
 			// SentenceDContextGenerator cg = new SentenceDContextGenerator();
 			DefaultSDContextGenerator cg = new DefaultSDContextGenerator(eosc);
-			sentenceDetector = new SentenceDetectorCtakes(mmResrc.getModel(), cg, eoss);
-		}
+			sentenceDetector = new SentenceDetectorCtakes(
+					sdmodel.getMaxentModel(), cg, eoss);
 
-		skipSegmentsSet = ParamUtil.getStringParameterValuesSet(
-				PARAM_SEGMENTS_TO_SKIP, context);
+			skipSegmentsSet = ParamUtil.getStringParameterValuesSet(
+					PARAM_SEGMENTS_TO_SKIP, context);
 	}
 
 	/**
@@ -172,7 +169,9 @@ public class SentenceDetector extends JC
 		// The sentence detector returns the offsets of the sentence-endings it
 		// detects
 		// within the string
-		int[] sentenceBreaks = sentenceDetector.sentPosDetect(text.substring(b, e)); // OpenNLP
tools 1.5 returns Spans rather than offsets that 1.4 did
+		int[] sentenceBreaks = sentenceDetector.sentPosDetect(text.substring(b,
+				e)); // OpenNLP tools 1.5 returns Spans rather than offsets that
+						// 1.4 did
 		int numSentences = sentenceBreaks.length;
 		// There might be text after the last sentence-ending found by detector,
 		// so +1
@@ -184,7 +183,9 @@ public class SentenceDetector extends JC
 		// Will trim leading or trailing whitespace when check for end-of-line
 		// characters
 		for (int i = 0; i < numSentences; i++) {
-			sentEnd = sentenceBreaks[i] + b; // OpenNLP tools 1.5 returns Spans rather than offsets
that 1.4 did
+			sentEnd = sentenceBreaks[i] + b; // OpenNLP tools 1.5 returns Spans
+												// rather than offsets that 1.4
+												// did
 			String coveredText = text.substring(sentStart, sentEnd);
 			potentialSentSpans[i] = new SentenceSpan(sentStart, sentEnd,
 					coveredText);
@@ -287,16 +288,17 @@ public class SentenceDetector extends JC
 
 		logger.info("Training new model from " + inFile.getAbsolutePath());
 		logger.info("Using " + numEosc + " end of sentence characters.");
-		
-		logger.error("----------------------------------------------------------------------------------");

-		logger.error("Need to update yet for OpenNLP changes "); // TODO 
-		logger.error("Commented out code that no longer compiles due to OpenNLP API incompatible
changes"); // TODO 
-		logger.error("----------------------------------------------------------------------------------");

-		//GISModel mod = SentenceDetectorME.train(inFile, iters, cut, scanner);
-		//SuffixSensitiveGISModelWriter ssgmw = new SuffixSensitiveGISModelWriter(
-		//		mod, outFile);
-		//logger.info("Saving the model as: " + outFile.getAbsolutePath());
-		//ssgmw.persist();
+
+		logger.error("----------------------------------------------------------------------------------");
+		logger.error("Need to update yet for OpenNLP changes "); // TODO
+		logger.error("Commented out code that no longer compiles due to OpenNLP API incompatible
changes"); // TODO
+		logger.error("----------------------------------------------------------------------------------");
+		// GISModel mod = SentenceDetectorME.train(inFile, iters, cut, scanner);
+		// SuffixSensitiveGISModelWriter ssgmw = new
+		// SuffixSensitiveGISModelWriter(
+		// mod, outFile);
+		// logger.info("Saving the model as: " + outFile.getAbsolutePath());
+		// ssgmw.persist();
 
 	}
 

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ci/HyphenTextModifierImpl.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ci/HyphenTextModifierImpl.java?rev=1493198&r1=1493197&r2=1493198&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ci/HyphenTextModifierImpl.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ci/HyphenTextModifierImpl.java
Fri Jun 14 18:43:35 2013
@@ -29,6 +29,8 @@ import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -49,6 +51,38 @@ public class HyphenTextModifierImpl impl
 	private int iv_windowSize = 3; // default lookahead window
 	private Tokenizer iv_tokenizer = null;
 
+	/*
+	 * DECPRECATED: Uses InputSteam instead
+	 */
+	public HyphenTextModifierImpl(String hyphenfilename, int windowSize) {
+		iv_windowSize = windowSize;
+		iv_tokenizer = new Tokenizer();
+		BufferedReader br;
+		try {
+			br = new BufferedReader(new FileReader(new File(hyphenfilename)));
+
+			String line = "";
+
+			iv_shouldbeHyphenMap = new HashMap<String, Integer>();
+			while ((line = br.readLine()) != null) {
+				String[] toks = line.split("\\|");
+				String[] unh = toks[0].split("\\-");
+				String shouldbehyphen = "";
+				for (int i = 0; i < unh.length; i++) {
+					shouldbehyphen += " " + unh[i];
+				}
+				shouldbehyphen = shouldbehyphen.trim().toLowerCase();
+				iv_shouldbeHyphenMap.put(shouldbehyphen, new Integer(1));
+			}
+		} catch (FileNotFoundException e) {
+			System.err.println("Cannot find the hyphenation file:" + hyphenfilename);
+			e.printStackTrace();
+		} catch (IOException e) {
+			System.err.println("IOException accessing the hyphenation file:" + hyphenfilename);
+			e.printStackTrace();
+		}
+
+	}
 	/**
 	 * Default constructor takes a name of the file containing hyphenated
 	 * phrases, with their frequency.
@@ -58,13 +92,12 @@ public class HyphenTextModifierImpl impl
 	 * The file is delimited with "|" and has two fields:<br>
 	 * hyphen-term|frequency
 	 */
-	public HyphenTextModifierImpl(String hyphenfilename, int windowSize) {
+	public HyphenTextModifierImpl(InputStream hyphenfilename, int windowSize) {
 		iv_windowSize = windowSize;
 		iv_tokenizer = new Tokenizer();
 		BufferedReader br;
 		try {
-			br = new BufferedReader(new FileReader(new File(hyphenfilename)));
-
+			br = new BufferedReader(new InputStreamReader(hyphenfilename));
 			String line = "";
 
 			iv_shouldbeHyphenMap = new HashMap<String, Integer>();
@@ -86,7 +119,7 @@ public class HyphenTextModifierImpl impl
 			e.printStackTrace();
 		}
 
-	}
+	}	
 
 	/**
 	 * Filters out unwanted tokens - newlines.

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/resource/FileLocator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/resource/FileLocator.java?rev=1493198&r1=1493197&r2=1493198&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/resource/FileLocator.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/resource/FileLocator.java
Fri Jun 14 18:43:35 2013
@@ -19,7 +19,9 @@
 package org.apache.ctakes.core.resource;
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileNotFoundException;
+import java.io.InputStream;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
@@ -31,6 +33,25 @@ import java.net.URL;
  */
 public class FileLocator
 {
+    public static InputStream getAsStream(String location) throws FileNotFoundException
+    {
+        try
+        {
+        	//Get from classpath
+        	return FileLocator.class.getClassLoader().getResourceAsStream(location);
+        }
+        catch (Exception e)
+        {
+        	//Try to get from filestream
+        	File f = new File(location);
+        	FileInputStream fs = new FileInputStream(f);
+        	return fs;
+        }
+    }
+	
+    /**
+     * @deprecated  As of release 3.1, replaced by {@link #getAsStream()}
+     */    
     public static File locateFile(String location)
             throws FileNotFoundException
     {

Modified: ctakes/trunk/ctakes-core/src/test/java/org/apache/ctakes/core/ci/HyphenTextModifierImplTests.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/test/java/org/apache/ctakes/core/ci/HyphenTextModifierImplTests.java?rev=1493198&r1=1493197&r2=1493198&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/test/java/org/apache/ctakes/core/ci/HyphenTextModifierImplTests.java
(original)
+++ ctakes/trunk/ctakes-core/src/test/java/org/apache/ctakes/core/ci/HyphenTextModifierImplTests.java
Fri Jun 14 18:43:35 2013
@@ -23,12 +23,14 @@ package org.apache.ctakes.core.ci;
 
 import static org.junit.Assert.assertArrayEquals;
 
+import java.io.InputStream;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
 
 import org.junit.Test;
 
 import org.apache.ctakes.core.ci.HyphenTextModifierImpl;
+import org.apache.ctakes.core.resource.FileLocator;
 
 /**
  * @author Mayo Clinic
@@ -92,10 +94,10 @@ public class HyphenTextModifierImplTests
 			System.out.println(s);
 		}
 		
-		String filename = null;
+		InputStream filename = null;
 		try {
-			filename = this.getClass().getClassLoader().getResource("org/apache/ctakes/core/tokenizer/hyphenated.txt").toURI().getRawPath();
-		} catch (URISyntaxException e) {
+			filename = FileLocator.getAsStream("org/apache/ctakes/core/tokenizer/hyphenated.txt");
+		} catch (Exception e) {
 			e.printStackTrace();
 		}
 		HyphenTextModifierImpl tm = new HyphenTextModifierImpl(filename, 7);

Modified: ctakes/trunk/ctakes-dependency-parser/desc/analysis_engine/ClearNLPDependencyParserPlaintextAggregate.xml
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dependency-parser/desc/analysis_engine/ClearNLPDependencyParserPlaintextAggregate.xml?rev=1493198&r1=1493197&r2=1493198&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dependency-parser/desc/analysis_engine/ClearNLPDependencyParserPlaintextAggregate.xml
(original)
+++ ctakes/trunk/ctakes-dependency-parser/desc/analysis_engine/ClearNLPDependencyParserPlaintextAggregate.xml
Fri Jun 14 18:43:35 2013
@@ -405,6 +405,13 @@
                             <multiValued>true</multiValued>
                             <mandatory>false</mandatory>
                         </configurationParameter>
+						<configurationParameter>
+							<name>SentenceModelFile</name>
+							<description>The file that contains the MaxEnt model used by the Sentence Dectector</description>
+							<type>String</type>
+							<multiValued>false</multiValued>
+							<mandatory>true</mandatory>
+						</configurationParameter>                        
                     </configurationParameters>
                     <configurationParameterSettings>
                         <nameValuePair>
@@ -413,6 +420,12 @@
                                 <array/>
                             </value>
                         </nameValuePair>
+						<nameValuePair>
+						<name>SentenceModelFile</name>
+						<value>
+						<string>org/apache/ctakes/core/sentdetect/sd-med-model.zip</string>
+						</value>
+						</nameValuePair>                        
                     </configurationParameterSettings>
                     <typeSystemDescription/>
                     <typePriorities/>
@@ -434,32 +447,6 @@
                         <outputsNewCASes>false</outputsNewCASes>
                     </operationalProperties>
                 </analysisEngineMetaData>
-                <externalResourceDependencies>
-                    <externalResourceDependency>
-                        <key>MaxentModel</key>
-                        <description/>
-                        <interfaceName>org.apache.ctakes.core.resource.MaxentModelResource</interfaceName>
-                        <optional>false</optional>
-                    </externalResourceDependency>
-                </externalResourceDependencies>
-                <resourceManagerConfiguration>
-                    <externalResources>
-                        <externalResource>
-                            <name>MaxentModelFile</name>
-                            <description/>
-                            <fileResourceSpecifier>
-                                <fileUrl>file:org/apache/ctakes/core/sentdetect/sdmed.mod</fileUrl>
-                            </fileResourceSpecifier>
-                            <implementationName>org.apache.ctakes.core.resource.SuffixMaxentModelResourceImpl</implementationName>
-                        </externalResource>
-                    </externalResources>
-                    <externalResourceBindings>
-                        <externalResourceBinding>
-                            <key>MaxentModel</key>
-                            <resourceName>MaxentModelFile</resourceName>
-                        </externalResourceBinding>
-                    </externalResourceBindings>
-                </resourceManagerConfiguration>
             </taeDescription>
         </delegateAnalysisEngine>
         <delegateAnalysisEngine key="SimpleSegmentAnnotator">

Modified: ctakes/trunk/ctakes-dependency-parser/desc/analysis_engine/ClearNLPSRLPlaintextAggregate.xml
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dependency-parser/desc/analysis_engine/ClearNLPSRLPlaintextAggregate.xml?rev=1493198&r1=1493197&r2=1493198&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dependency-parser/desc/analysis_engine/ClearNLPSRLPlaintextAggregate.xml
(original)
+++ ctakes/trunk/ctakes-dependency-parser/desc/analysis_engine/ClearNLPSRLPlaintextAggregate.xml
Fri Jun 14 18:43:35 2013
@@ -466,6 +466,13 @@
                             <multiValued>true</multiValued>
                             <mandatory>false</mandatory>
                         </configurationParameter>
+						<configurationParameter>
+							<name>SentenceModelFile</name>
+							<description>The file that contains the MaxEnt model used by the Sentence Dectector</description>
+							<type>String</type>
+							<multiValued>false</multiValued>
+							<mandatory>true</mandatory>
+						</configurationParameter>                             
                     </configurationParameters>
                     <configurationParameterSettings>
                         <nameValuePair>
@@ -474,6 +481,12 @@
                                 <array/>
                             </value>
                         </nameValuePair>
+						<nameValuePair>
+						<name>SentenceModelFile</name>
+						<value>
+						<string>org/apache/ctakes/core/sentdetect/sd-med-model.zip</string>
+						</value>
+						</nameValuePair>        
                     </configurationParameterSettings>
                     <typeSystemDescription/>
                     <typePriorities/>
@@ -495,32 +508,6 @@
                         <outputsNewCASes>false</outputsNewCASes>
                     </operationalProperties>
                 </analysisEngineMetaData>
-                <externalResourceDependencies>
-                    <externalResourceDependency>
-                        <key>MaxentModel</key>
-                        <description/>
-                        <interfaceName>org.apache.ctakes.core.resource.MaxentModelResource</interfaceName>
-                        <optional>false</optional>
-                    </externalResourceDependency>
-                </externalResourceDependencies>
-                <resourceManagerConfiguration>
-                    <externalResources>
-                        <externalResource>
-                            <name>MaxentModelFile</name>
-                            <description/>
-                            <fileResourceSpecifier>
-                                <fileUrl>file:org/apache/ctakes/core/sentdetect/sdmed.mod</fileUrl>
-                            </fileResourceSpecifier>
-                            <implementationName>org.apache.ctakes.core.resource.SuffixMaxentModelResourceImpl</implementationName>
-                        </externalResource>
-                    </externalResources>
-                    <externalResourceBindings>
-                        <externalResourceBinding>
-                            <key>MaxentModel</key>
-                            <resourceName>MaxentModelFile</resourceName>
-                        </externalResourceBinding>
-                    </externalResourceBindings>
-                </resourceManagerConfiguration>
             </taeDescription>
         </delegateAnalysisEngine>
         <delegateAnalysisEngine key="SimpleSegmentAnnotator">

Modified: ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPDependencyParserAE.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPDependencyParserAE.java?rev=1493198&r1=1493197&r2=1493198&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPDependencyParserAE.java
(original)
+++ ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPDependencyParserAE.java
Fri Jun 14 18:43:35 2013
@@ -21,6 +21,7 @@ package org.apache.ctakes.dependency.par
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
@@ -28,6 +29,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.zip.ZipInputStream;
 
+import org.apache.ctakes.core.resource.FileLocator;
 import org.apache.ctakes.dependency.parser.util.ClearDependencyUtility;
 import org.apache.ctakes.typesystem.type.syntax.BaseToken;
 import org.apache.ctakes.typesystem.type.syntax.ConllDependencyNode;
@@ -125,17 +127,17 @@ public class ClearNLPDependencyParserAE 
 				// Note: If lemmatizer data file is not specified, then use lemmas from the BaseToken
normalizedToken field.
 				// Initialize lemmatizer
 				
-                URL lemmatizerModelURL = (this.lemmatizerDataFile == null)
-                        ? this.getClass().getClassLoader().getResource(ENG_LEMMATIZER_DATA_FILE).toURI().toURL()
-                        : this.lemmatizerDataFile.toURL();
+                InputStream lemmatizerModel = (this.lemmatizerDataFile == null)
+                        ? FileLocator.getAsStream(ENG_LEMMATIZER_DATA_FILE)
+                        : FileLocator.getAsStream(this.lemmatizerDataFile.getPath());
                         
-                    this.lemmatizer = EngineGetter.getMPAnalyzer(language, lemmatizerModelURL.openStream());
+                    this.lemmatizer = EngineGetter.getMPAnalyzer(language, lemmatizerModel);
 			}
-            	URL parserModelURL = (this.parserModelUri == null)
-                    ? this.getClass().getClassLoader().getResource(DEFAULT_MODEL_FILE_NAME).toURI().toURL()
-                    : this.parserModelUri.toURL();
+				InputStream parserModel = (this.parserModelUri == null)
+                    ? FileLocator.getAsStream(DEFAULT_MODEL_FILE_NAME)
+                    : FileLocator.getAsStream(this.parserModelUri.getPath());
                  
-                    this.parser = EngineGetter.getComponent(parserModelURL.openStream(),
this.language, NLPLib.MODE_DEP);
+                    this.parser = EngineGetter.getComponent(parserModel, this.language, NLPLib.MODE_DEP);
 
         } catch (Exception e) {
             throw new ResourceInitializationException(e);

Modified: ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPSemanticRoleLabelerAE.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPSemanticRoleLabelerAE.java?rev=1493198&r1=1493197&r2=1493198&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPSemanticRoleLabelerAE.java
(original)
+++ ctakes/trunk/ctakes-dependency-parser/src/main/java/org/apache/ctakes/dependency/parser/ae/ClearNLPSemanticRoleLabelerAE.java
Fri Jun 14 18:43:35 2013
@@ -18,6 +18,7 @@
  */
 package org.apache.ctakes.dependency.parser.ae;
 
+import java.io.InputStream;
 import java.net.URI;
 import java.net.URL;
 import java.util.ArrayList;
@@ -25,6 +26,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.ctakes.core.resource.FileLocator;
 import org.apache.ctakes.core.util.ListFactory;
 import org.apache.ctakes.typesystem.type.syntax.BaseToken;
 import org.apache.ctakes.typesystem.type.syntax.ConllDependencyNode;
@@ -123,20 +125,20 @@ final String language = AbstractReader.L
     
     try {
     	
-    	URL srlPredURL = (this.srlPredUri == null)
-                ? this.getClass().getClassLoader().getResource(DEFAULT_PRED_MODEL_FILE_NAME).toURI().toURL()
-                : this.srlPredUri.toURL();
-        this.identifier = EngineGetter.getComponent(srlPredURL.openStream(), this.language,
NLPLib.MODE_PRED);
+    	InputStream srlPred = (this.srlPredUri == null)
+                ? FileLocator.getAsStream(DEFAULT_PRED_MODEL_FILE_NAME)
+                : FileLocator.getAsStream(this.srlPredUri.getPath());
+        this.identifier = EngineGetter.getComponent(srlPred, this.language, NLPLib.MODE_PRED);
         
-    	URL srlRoleURL = (this.srlRoleUri == null)
-                ? this.getClass().getClassLoader().getResource(DEFAULT_ROLE_MODEL_FILE_NAME).toURI().toURL()
-                : this.srlRoleUri.toURL();
-        this.classifier = EngineGetter.getComponent(srlRoleURL.openStream(), this.language,
NLPLib.MODE_ROLE);
+    	InputStream srlRole = (this.srlRoleUri == null)
+                ? FileLocator.getAsStream(DEFAULT_ROLE_MODEL_FILE_NAME)
+                : FileLocator.getAsStream(this.srlRoleUri.getPath());
+        this.classifier = EngineGetter.getComponent(srlRole, this.language, NLPLib.MODE_ROLE);
     	
-    	URL srlModelURL = (this.srlModelUri == null)
-                ? this.getClass().getClassLoader().getResource(DEFAULT_SRL_MODEL_FILE_NAME).toURI().toURL()
-                : this.srlModelUri.toURL();
-        this.srlabeler = EngineGetter.getComponent(srlModelURL.openStream(), this.language,
NLPLib.MODE_SRL);       		 
+    	InputStream srlModel = (this.srlModelUri == null)
+                ? FileLocator.getAsStream(DEFAULT_SRL_MODEL_FILE_NAME)
+                : FileLocator.getAsStream(this.srlModelUri.getPath());
+        this.srlabeler = EngineGetter.getComponent(srlModel, this.language, NLPLib.MODE_SRL);
      		 
 
     } catch (Exception e) {
       throw new ResourceInitializationException(e);

Modified: ctakes/trunk/ctakes-ne-contexts/desc/test/SegmentTokenSentenceAggregate.xml
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-ne-contexts/desc/test/SegmentTokenSentenceAggregate.xml?rev=1493198&r1=1493197&r2=1493198&view=diff
==============================================================================
--- ctakes/trunk/ctakes-ne-contexts/desc/test/SegmentTokenSentenceAggregate.xml (original)
+++ ctakes/trunk/ctakes-ne-contexts/desc/test/SegmentTokenSentenceAggregate.xml Fri Jun 14
18:43:35 2013
@@ -27,7 +27,7 @@
       <import location="TokenizerAnnotator.xml"/>
     </delegateAnalysisEngine>
     <delegateAnalysisEngine key="SentenceDetectorAnnotator">
-      <import location="SentenceDetectorAnnotator.xml"/>
+      <import location="../../../ctakes-core/desc/analysis_engine/SentenceDetectorAnnotator.xml"/>
     </delegateAnalysisEngine>
     <delegateAnalysisEngine key="SimpleSegmentAnnotator">
       <import location="SimpleSegmentAnnotator.xml"/>

Modified: ctakes/trunk/ctakes-pos-tagger/desc/test/POSTaggerAggregate.xml
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-pos-tagger/desc/test/POSTaggerAggregate.xml?rev=1493198&r1=1493197&r2=1493198&view=diff
==============================================================================
--- ctakes/trunk/ctakes-pos-tagger/desc/test/POSTaggerAggregate.xml (original)
+++ ctakes/trunk/ctakes-pos-tagger/desc/test/POSTaggerAggregate.xml Fri Jun 14 18:43:35 2013
@@ -27,10 +27,10 @@
 <import location="SimpleSegmentAnnotator.xml"/>
 </delegateAnalysisEngine>
 <delegateAnalysisEngine key="SentenceDetectorAnnotator">
-<import location="SentenceDetectorAnnotator.xml"/>
+<import location="../../../ctakes-core/desc/analysis_engine/SentenceDetectorAnnotator.xml"/>
 </delegateAnalysisEngine>
 <delegateAnalysisEngine key="TokenizerAnnotator">
-<import location="TokenizerAnnotator.xml"/>
+<import location="../../../ctakes-core/desc/analysis_engine/TokenizerAnnotator.xml"/>
 </delegateAnalysisEngine>
 <delegateAnalysisEngine key="POSTagger">
 <import location="POSTagger.xml"/>

Modified: ctakes/trunk/ctakes-pos-tagger/desc/test/POSTaggerAggregate2.xml
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-pos-tagger/desc/test/POSTaggerAggregate2.xml?rev=1493198&r1=1493197&r2=1493198&view=diff
==============================================================================
--- ctakes/trunk/ctakes-pos-tagger/desc/test/POSTaggerAggregate2.xml (original)
+++ ctakes/trunk/ctakes-pos-tagger/desc/test/POSTaggerAggregate2.xml Fri Jun 14 18:43:35 2013
@@ -27,10 +27,10 @@
 <import location="SimpleSegmentAnnotator.xml"/>
 </delegateAnalysisEngine>
 <delegateAnalysisEngine key="SentenceDetectorAnnotator">
-<import location="SentenceDetectorAnnotator.xml"/>
+<import location="../../../ctakes-core/desc/analysis_engine/SentenceDetectorAnnotator.xml"/>
 </delegateAnalysisEngine>
 <delegateAnalysisEngine key="TokenizerAnnotator">
-<import location="TokenizerAnnotator.xml"/>
+<import location="../../../ctakes-core/desc/analysis_engine/TokenizerAnnotator.xml"/>
 </delegateAnalysisEngine>
 <delegateAnalysisEngine key="POSTagger">
 <import location="POSTagger.xml"/>

Modified: ctakes/trunk/ctakes-pos-tagger/desc/test/POSTaggerAggregate3.xml
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-pos-tagger/desc/test/POSTaggerAggregate3.xml?rev=1493198&r1=1493197&r2=1493198&view=diff
==============================================================================
--- ctakes/trunk/ctakes-pos-tagger/desc/test/POSTaggerAggregate3.xml (original)
+++ ctakes/trunk/ctakes-pos-tagger/desc/test/POSTaggerAggregate3.xml Fri Jun 14 18:43:35 2013
@@ -27,10 +27,10 @@
       <import location="TokenizerAnnotator.xml"/>
     </delegateAnalysisEngine>
     <delegateAnalysisEngine key="SentenceDetectorAnnotator">
-      <import location="SentenceDetectorAnnotator.xml"/>
+      <import location="../../../ctakes-core/desc/analysis_engine/SentenceDetectorAnnotator.xml"/>
     </delegateAnalysisEngine>
     <delegateAnalysisEngine key="SimpleSegmentAnnotator">
-      <import location="SimpleSegmentAnnotator.xml"/>
+      <import location="../../../ctakes-core/desc/analysis_engine/SimpleSegmentAnnotator.xml"/>
     </delegateAnalysisEngine>
     <delegateAnalysisEngine key="POSTagger">
       <import location="POSTagger.xml"/>

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java?rev=1493198&r1=1493197&r2=1493198&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/eval/Evaluation_ImplBase.java
Fri Jun 14 18:43:35 2013
@@ -41,7 +41,6 @@ import org.apache.ctakes.core.resource.F
 import org.apache.ctakes.core.resource.FileResourceImpl;
 import org.apache.ctakes.core.resource.JdbcConnectionResourceImpl;
 import org.apache.ctakes.core.resource.LuceneIndexReaderResourceImpl;
-import org.apache.ctakes.core.resource.SuffixMaxentModelResourceImpl;
 import org.apache.ctakes.dependency.parser.ae.ClearNLPDependencyParserAE;
 import org.apache.ctakes.dependency.parser.ae.ClearNLPSemanticRoleLabelerAE;
 import org.apache.ctakes.dictionary.lookup.ae.UmlsDictionaryLookupAnnotator;
@@ -239,10 +238,8 @@ public abstract class Evaluation_ImplBas
     // identify sentences
     aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(
         SentenceDetector.class,
-        "MaxentModel",
-        ExternalResourceFactory.createExternalResourceDescription(
-            SuffixMaxentModelResourceImpl.class,
-            FileLocator.locateFile("org/apache/ctakes/core/sentdetect/sdmed.mod").toURI().toURL())));
+        SentenceDetector.SD_MODEL_FILE_PARAM,
+        "org/apache/ctakes/core/sentdetect/sd-med-model.zip"));
     // identify tokens
     aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(TokenizerAnnotatorPTB.class));
     // merge some tokens

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/EventAndTimeExtractionPipeline.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/EventAndTimeExtractionPipeline.java?rev=1493198&r1=1493197&r2=1493198&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/EventAndTimeExtractionPipeline.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/EventAndTimeExtractionPipeline.java
Fri Jun 14 18:43:35 2013
@@ -34,7 +34,6 @@ import org.apache.ctakes.core.resource.F
 import org.apache.ctakes.core.resource.FileResourceImpl;
 import org.apache.ctakes.core.resource.JdbcConnectionResourceImpl;
 import org.apache.ctakes.core.resource.LuceneIndexReaderResourceImpl;
-import org.apache.ctakes.core.resource.SuffixMaxentModelResourceImpl;
 import org.apache.ctakes.dependency.parser.ae.ClearNLPDependencyParserAE;
 import org.apache.ctakes.dependency.parser.ae.ClearNLPSemanticRoleLabelerAE;
 import org.apache.ctakes.dictionary.lookup.ae.UmlsDictionaryLookupAnnotator;
@@ -135,11 +134,9 @@ public class EventAndTimeExtractionPipel
     
     // identify sentences
     aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(
-        SentenceDetector.class,
-        "MaxentModel",
-        ExternalResourceFactory.createExternalResourceDescription(
-            SuffixMaxentModelResourceImpl.class,
-            FileLocator.locateFile("org/apache/ctakes/core/sentdetect/sdmed.mod").toURI().toURL())));
+            SentenceDetector.class,
+            SentenceDetector.SD_MODEL_FILE_PARAM,
+            "org/apache/ctakes/core/sentdetect/sd-med-model.zip"));
     // identify tokens
     aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(TokenizerAnnotatorPTB.class));
     // merge some tokens

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/EventExtractionPipeline.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/EventExtractionPipeline.java?rev=1493198&r1=1493197&r2=1493198&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/EventExtractionPipeline.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/pipelines/EventExtractionPipeline.java
Fri Jun 14 18:43:35 2013
@@ -34,7 +34,6 @@ import org.apache.ctakes.core.resource.F
 import org.apache.ctakes.core.resource.FileResourceImpl;
 import org.apache.ctakes.core.resource.JdbcConnectionResourceImpl;
 import org.apache.ctakes.core.resource.LuceneIndexReaderResourceImpl;
-import org.apache.ctakes.core.resource.SuffixMaxentModelResourceImpl;
 import org.apache.ctakes.dependency.parser.ae.ClearNLPDependencyParserAE;
 import org.apache.ctakes.dependency.parser.ae.ClearNLPSemanticRoleLabelerAE;
 import org.apache.ctakes.dictionary.lookup.ae.UmlsDictionaryLookupAnnotator;
@@ -127,11 +126,10 @@ public class EventExtractionPipeline {
     
     // identify sentences
     aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(
-        SentenceDetector.class,
-        "MaxentModel",
-        ExternalResourceFactory.createExternalResourceDescription(
-            SuffixMaxentModelResourceImpl.class,
-            FileLocator.locateFile("org/apache/ctakes/core/sentdetect/sdmed.mod").toURI().toURL())));
+            SentenceDetector.class,
+            SentenceDetector.SD_MODEL_FILE_PARAM,
+            "org/apache/ctakes/core/sentdetect/sd-med-model.zip"));
+    
     // identify tokens
     aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(TokenizerAnnotatorPTB.class));
     // merge some tokens

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/utils/CheckKnowtatorAnnotations.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/utils/CheckKnowtatorAnnotations.java?rev=1493198&r1=1493197&r2=1493198&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/utils/CheckKnowtatorAnnotations.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/utils/CheckKnowtatorAnnotations.java
Fri Jun 14 18:43:35 2013
@@ -24,7 +24,6 @@ import java.util.List;
 
 import org.apache.ctakes.core.ae.SentenceDetector;
 import org.apache.ctakes.core.ae.TokenizerAnnotatorPTB;
-import org.apache.ctakes.core.resource.SuffixMaxentModelResourceImpl;
 import org.apache.ctakes.temporal.ae.THYMEKnowtatorXMLReader;
 import org.apache.ctakes.temporal.eval.CommandLine;
 import org.apache.ctakes.temporal.eval.Evaluation_ImplBase.SegmentsFromBracketedSectionTagsAnnotator;
@@ -79,11 +78,9 @@ public class CheckKnowtatorAnnotations {
         options.getKnowtatorXMLDirectory()));
     builder.add(AnalysisEngineFactory.createPrimitiveDescription(SegmentsFromBracketedSectionTagsAnnotator.class));
     builder.add(AnalysisEngineFactory.createPrimitiveDescription(
-        SentenceDetector.class,
-        "MaxentModel",
-        ExternalResourceFactory.createExternalResourceDescription(
-            SuffixMaxentModelResourceImpl.class,
-            SentenceDetector.class.getResource("../sentdetect/sdmed.mod"))));
+            SentenceDetector.class,
+            SentenceDetector.SD_MODEL_FILE_PARAM,
+            "org/apache/ctakes/core/sentdetect/sd-med-model.zip"));
     builder.add(AnalysisEngineFactory.createPrimitiveDescription(TokenizerAnnotatorPTB.class));
     for (JCas jCas : new JCasIterable(reader, builder.createAggregate())) {
       for (EventMention event : JCasUtil.select(jCas, EventMention.class)) {



Mime
View raw message