You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by al...@apache.org on 2017/11/22 04:34:31 UTC

svn commit: r1816002 - in /ctakes/trunk: ctakes-core/src/main/java/org/apache/ctakes/core/cr/ ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/ ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/

Author: alexz
Date: Wed Nov 22 04:34:31 2017
New Revision: 1816002

URL: http://svn.apache.org/viewvc?rev=1816002&view=rev
Log:
CTAKES-465: fix deprecated FileLocator.locateFile, IndexReader.open, AnalysisEngineFactory.createPrimitiveDescription


Modified:
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cr/FilesInDirectoryCollectionReader.java
    ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedLuceneConsumerImpl.java
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/ConsecutiveSentencesEventEventRelationAnnotator.java

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cr/FilesInDirectoryCollectionReader.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cr/FilesInDirectoryCollectionReader.java?rev=1816002&r1=1816001&r2=1816002&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cr/FilesInDirectoryCollectionReader.java (original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cr/FilesInDirectoryCollectionReader.java Wed Nov 22 04:34:31 2017
@@ -110,7 +110,7 @@ public class FilesInDirectoryCollectionR
       final String inputDirPath = (String)getConfigParameterValue( ConfigParameterConstants.PARAM_INPUTDIR );
       File directory;
       try {
-			directory = FileLocator.locateFile( inputDirPath );
+			directory = FileLocator.getFile( inputDirPath );
 		} catch ( IOException ioE ) {
 			throw new ResourceInitializationException(
 					ResourceConfigurationException.DIRECTORY_NOT_FOUND,

Modified: ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedLuceneConsumerImpl.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedLuceneConsumerImpl.java?rev=1816002&r1=1816001&r2=1816002&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedLuceneConsumerImpl.java (original)
+++ ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/ae/UmlsToSnomedLuceneConsumerImpl.java Wed Nov 22 04:34:31 2017
@@ -24,6 +24,7 @@ import org.apache.ctakes.dictionary.look
 import org.apache.ctakes.dictionary.lookup.MetaDataHit;
 import org.apache.ctakes.dictionary.lookup.lucene.LuceneDictionaryImpl;
 import org.apache.log4j.Logger;
+import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.store.FSDirectory;
@@ -91,7 +92,7 @@ public class UmlsToSnomedLuceneConsumerI
          // For the sample dictionary, we use the following lucene index.
          //indexPath = "lookup/snomed-like_codes_sample";
 
-         indexReader = IndexReader.open( FSDirectory.open( indexDir ) );
+         indexReader = DirectoryReader.open( FSDirectory.open( indexDir ) );
 
          IndexSearcher indexSearcher = new IndexSearcher( indexReader );
          String lookupFieldName = props.getProperty( CUI_MAPPING_PRP_KEY );

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/ConsecutiveSentencesEventEventRelationAnnotator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/ConsecutiveSentencesEventEventRelationAnnotator.java?rev=1816002&r1=1816001&r2=1816002&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/ConsecutiveSentencesEventEventRelationAnnotator.java (original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/ConsecutiveSentencesEventEventRelationAnnotator.java Wed Nov 22 04:34:31 2017
@@ -47,7 +47,7 @@ public class ConsecutiveSentencesEventEv
 			Class<? extends DataWriter<String>> dataWriterClass,
 					File outputDirectory,
 					double probabilityOfKeepingANegativeExample) throws ResourceInitializationException {
-		return AnalysisEngineFactory.createPrimitiveDescription(
+		return AnalysisEngineFactory.createEngineDescription(
 				ConsecutiveSentencesEventEventRelationAnnotator.class,
 				CleartkAnnotator.PARAM_IS_TRAINING,
 				true,
@@ -62,7 +62,7 @@ public class ConsecutiveSentencesEventEv
 
 	public static AnalysisEngineDescription createAnnotatorDescription(File modelDirectory)
 			throws ResourceInitializationException {
-		return AnalysisEngineFactory.createPrimitiveDescription(
+		return AnalysisEngineFactory.createEngineDescription(
 				ConsecutiveSentencesEventEventRelationAnnotator.class,
 				CleartkAnnotator.PARAM_IS_TRAINING,
 				false,