Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.apache.ctakes.temporal.ae.feature;
 
 import java.util.List;
 
import  org.cleartk.ml.Feature;
public class ConjunctionRelationFeaturesExtractor implements
	private String name = "ConjunctionFeature";
	public List<Feature> extract(JCas jCasIdentifiedAnnotation arg1,
		ArrayList<Feature> feats = new ArrayList<>();
		int begin = arg1.getEnd();
		int end   = arg2.getBegin();
		if ( begin > end ){
			begin = arg2.getEnd();
			end   = arg1.getBegin();
		}
		if ( begin >= end ){
			return feats;
		}
		List<BaseTokenbetweenTokens = JCasUtil.selectCovered(jCasBaseToken.classbeginend);
		List<EventMentioneventsInBetween = JCasUtil.selectCovered(jCasEventMention.classbeginend);
		//filter events:
		List<EventMentionrealEvents = new ArrayList<>();
		//filtering events
		for(EventMention event : eventsInBetween){
			// filter out ctakes events
			if(event.getClass().equals(EventMention.class)){
				realEvents.add(event);
			}
		}
		eventsInBetween = realEvents;
		if(eventsInBetween.size() ==0 ){
			for (BaseToken tokenbetweenTokens){
				String pos = token.getPartOfSpeech();
				if(pos.startsWith("CC")||pos.equals(",")||pos.startsWith("IN")){
					feats.add(new Feature(this."Contain_Conjunction_inBetween"));
					feats.add(new Feature(this.pos));
				}
			}
		}
		return feats;
	}
New to GrepCode? Check out our FAQ X