ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1635135 - in /ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion: attributes/features/SubjectFeaturesExtractor.java medfacts/cleartk/SubjectCleartkAnalysisEngine.java
Date Wed, 29 Oct 2014 13:57:11 GMT
Author: tmill
Date: Wed Oct 29 13:57:10 2014
New Revision: 1635135

URL: http://svn.apache.org/r1635135
Log:
Cleanup of subject source & feature extractor, mainly fixing warnings on generics and
other minor things.

Modified:
    ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/attributes/features/SubjectFeaturesExtractor.java
    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/attributes/features/SubjectFeaturesExtractor.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/attributes/features/SubjectFeaturesExtractor.java?rev=1635135&r1=1635134&r2=1635135&view=diff
==============================================================================
--- ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/attributes/features/SubjectFeaturesExtractor.java
(original)
+++ ctakes/trunk/ctakes-assertion/src/main/java/org/apache/ctakes/assertion/attributes/features/SubjectFeaturesExtractor.java
Wed Oct 29 13:57:10 2014
@@ -27,8 +27,8 @@ import java.util.List;
 import org.apache.ctakes.assertion.attributes.subject.SubjectAttributeClassifier;
 import org.apache.ctakes.dependency.parser.util.DependencyUtility;
 import org.apache.ctakes.typesystem.type.syntax.ConllDependencyNode;
+import org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation;
 import org.apache.uima.jcas.JCas;
-import org.apache.uima.jcas.tcas.Annotation;
 import org.cleartk.ml.Feature;
 import org.cleartk.ml.feature.extractor.FeatureExtractor1;
 
@@ -39,13 +39,13 @@ import org.cleartk.ml.feature.extractor.
  * @author m081914
  *
  */
-public class SubjectFeaturesExtractor implements FeatureExtractor1 {
+public class SubjectFeaturesExtractor implements FeatureExtractor1<IdentifiedAnnotation>
{
 	
 	
 	@Override
-	public List<Feature> extract(JCas jCas, Annotation arg) {
+	public List<Feature> extract(JCas jCas, IdentifiedAnnotation arg) {
 		
-		List<Feature> features = new ArrayList<Feature>();
+		List<Feature> features = new ArrayList<>();
 		
 		// Pull in general dependency-based features -- externalize to another extractor?
 	    ConllDependencyNode node = DependencyUtility.getNominalHeadNode(jCas, arg);
@@ -66,10 +66,10 @@ public class SubjectFeaturesExtractor im
 	    return features;
 	}
 
-	private Collection<? extends Feature> hashToFeatureList(
+	private static Collection<? extends Feature> hashToFeatureList(
 			HashMap<String, Boolean> featsIn) {
 		
-		Collection<Feature> featsOut = new HashSet<Feature>();
+		Collection<Feature> featsOut = new HashSet<>();
 		for (String featName : featsIn.keySet()) {
 			featsOut.add(new Feature(featName,featsIn.get(featName)));
 		}

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=1635135&r1=1635134&r2=1635135&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
Wed Oct 29 13:57:10 2014
@@ -93,7 +93,7 @@ public class SubjectCleartkAnalysisEngin
 	      }
 	}
 	public static FeatureSelection<String> createFeatureSelection(double threshold) {
-		return new Chi2FeatureSelection<String>(AssertionCleartkAnalysisEngine.FEATURE_SELECTION_NAME,
threshold, false);
+		return new Chi2FeatureSelection<>(AssertionCleartkAnalysisEngine.FEATURE_SELECTION_NAME,
threshold, false);
 		//		  return new MutualInformationFeatureSelection<String>(AssertionCleartkAnalysisEngine.FEATURE_SELECTION_NAME);
 	}
 
@@ -106,7 +106,7 @@ public class SubjectCleartkAnalysisEngin
 	    if (featureSelectionThreshold == 0) {
 	    	this.featureSelection = null;
 	    } else {
-	    	this.featureSelection = this.createFeatureSelection(this.featureSelectionThreshold);
+	    	this.featureSelection = createFeatureSelection(this.featureSelectionThreshold);
 
 //	    	if ( (new File(this.featureSelectionURI)).exists() ) {
 //	    		try {



Mime
View raw message