Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
		RelationExtractorAnnotator {
	  public static AnalysisEngineDescription createAnnotatorDescription(File modelDirectory)
		      throws ResourceInitializationException {
		    return AnalysisEngineFactory.createEngineDescription(
		        new File(modelDirectory"model.jar"));
	protected Class<? extends AnnotationgetCoveringClass() {
		return Sentence.class;
	protected List<IdentifiedAnnotationPair> getCandidateRelationArgumentPairs(
			JCas jCasAnnotation sentence) {
	    List<IdentifiedAnnotationPair> results = new ArrayList<IdentifiedAnnotationPair>();
	    // get all event mentions in the sentence
	    List<EventMentionevents = JCasUtil.selectCovered(jCasEventMention.classsentence);
	    // filter out all the ctakes-generated events with more specific types
	    List<EventMentionrealEvents = new ArrayList<EventMention>();
	    for(EventMention event : events){
	    events = realEvents;
	    // if we still have more than 1 we can continue
	    if(events.size() < 2) {
	      return results;
	    // left-most event is the anchor and we will say all others are contained by it.
	    EventMention anchor = events.get(0);
	    for(int i = 1; i < events.size(); i++){
	          IdentifiedAnnotationPair pair = new IdentifiedAnnotationPair(anchorevents.get(i));
	    return results;
	 * For this method, we simply return the positive label "CONTAINS". All of the work in the baseline is
	 * done by getCandidateRelationArgumentPairs().
	 * (non-Javadoc)
	 * @see
	public String classify(List<Feature> features) {
		return "CONTAINS";
New to GrepCode? Check out our FAQ X