Package org.apache.ctakes.typesystem.type.refsem

Examples of org.apache.ctakes.typesystem.type.refsem.Event


          throw new IllegalArgumentException("Invalid polarity: " + polarityStr);
        }
        eventProperties.setPolarity(polarity);

        // create the event object
        Event event = new Event(jCas);
        event.setConfidence(1.0f);
        event.setDiscoveryTechnique(CONST.NE_DISCOVERY_TECH_GOLD_ANNOTATION);

        // create the event mention
        EventMention eventMention = new EventMention(jCas, coveringSpan.begin, coveringSpan.end);
        eventMention.setConfidence(1.0f);
        eventMention.setDiscoveryTechnique(CONST.NE_DISCOVERY_TECH_GOLD_ANNOTATION);

        // add the links between event, mention and properties
        event.setProperties(eventProperties);
        event.setMentions(new FSArray(jCas, 1));
        event.setMentions(0, eventMention);
        eventMention.setEvent(event);

        // add the annotations to the indexes
        eventProperties.addToIndexes();
        event.addToIndexes();
        eventMention.addToIndexes();
        idAnnotationMap.put(annotation.id, eventMention);

      } else if ("DOCTIME".equals(annotation.type)) {
        // TODO
View Full Code Here


  @Override
  public void process(JCas jCas, Segment segment)
      throws AnalysisEngineProcessException {
    for (EntityMention neMention : JCasUtil.select(jCas, EntityMention.class)) {
      // create the event object
      Event event = new Event(jCas);
      event.setConfidence(1.0f);

      // create the event mention
      EventMention eventMention = new EventMention(jCas, neMention.getBegin(), neMention.getEnd());
      eventMention.setConfidence(1.0f);

      // add the links between event, mention and properties
      //        event.setProperties(eventProperties);
      //        event.setMentions(neMention.getOntologyConceptArr());
      eventMention.setEvent(event);
      eventMention.setOntologyConceptArr(neMention.getOntologyConceptArr());

      // add the annotations to the indexes
      //        eventProperties.addToIndexes();
      event.addToIndexes();
      eventMention.addToIndexes();
    }

    //add predicates
    for (Predicate predicate : JCasUtil.select(jCas, Predicate.class)) {
      // create the event object
      Event event = new Event(jCas);
      event.setConfidence(1.0f);

      // create the event mention
      EventMention eventMention = new EventMention(jCas, predicate.getBegin(), predicate.getEnd());
      eventMention.setConfidence(1.0f);

      // add the links between event, mention and properties
      //          event.setProperties(eventProperties);
      //          event.setMentions(neMention.getOntologyConceptArr());
      eventMention.setEvent(event);

      // add the annotations to the indexes
      //          eventProperties.addToIndexes();
      event.addToIndexes();
      eventMention.addToIndexes();
    }

  }
View Full Code Here

    }
   
    for(Element eventEl : dataElem.getChild("TAGS").getChildren("EVENT")){
      int begin = Integer.parseInt(eventEl.getAttributeValue("start"))-1;
      int end = Integer.parseInt(eventEl.getAttributeValue("end"))-1;
      Event e = new Event(jcas);
      EventProperties props = new EventProperties(jcas);
      EventMention event = new EventMention(jcas, begin, end);
      id2entity.put(eventEl.getAttributeValue("id"), event);
      String polarity = eventEl.getAttributeValue("polarity");
      if(polarity.equals("POS")) event.setPolarity(CONST.NE_POLARITY_NEGATION_ABSENT);
      else if(polarity.equals("NEG")) event.setPolarity(CONST.NE_POLARITY_NEGATION_PRESENT);
      String modality = eventEl.getAttributeValue("modality");
      if(mapThyme){
        if(modality.equals("FACTUAL")){
          props.setContextualModality("ACTUAL");
        }else if(modality.equals("POSSIBLE")){
          props.setContextualModality("HEDGED");
        }else if(modality.equals("HYPOTHETICAL") || modality.equals("CONDITIONAL")){
          props.setContextualModality("HYPOTHETICAL");
        }else if(modality.equals("PROPOSED")){
          props.setContextualModality("GENERIC");
        }
      }else{
        props.setContextualModality(modality);
      }
      e.setProperties(props);
      FSArray mentions = new FSArray(jcas,1);
      mentions.set(0, event);
      e.setMentions(mentions);
      event.setEvent(e);
      e.addToIndexes();
      event.addToIndexes();
      props.addToIndexes();
    }
   
    for(Element linkEl : dataElem.getChild("TAGS").getChildren("TLINK")){
View Full Code Here

          String polarity = removeSingleChildText(propertiesElem, "Polarity", id);
          String contextualModality = removeSingleChildText(propertiesElem, "ContextualModality", id);
          String contextualAspect = removeSingleChildText(propertiesElem, "ContextualAspect", id);
          String permanence = removeSingleChildText(propertiesElem, "Permanence", id);
          EventMention eventMention = new EventMention(jCas, begin, end);
          Event event = new Event(jCas);
          EventProperties eventProperties = new EventProperties(jCas);
          eventProperties.setDocTimeRel(docTimeRel);
          eventProperties.setCategory(eventType);
          eventProperties.setDegree(degree);
          if (polarity.equals("POS")) {
            eventProperties.setPolarity(CONST.NE_POLARITY_NEGATION_ABSENT);
          } else if (polarity.equals("NEG")) {
            eventProperties.setPolarity(CONST.NE_POLARITY_NEGATION_PRESENT);
          } else {
            error("polarity that was not POS or NEG", id);
          }
          eventProperties.setContextualModality(contextualModality);
          eventProperties.setContextualAspect(contextualAspect);
          eventProperties.setPermanence(permanence);
          eventProperties.addToIndexes();
          event.setConfidence(1.0f);
          event.setDiscoveryTechnique(CONST.NE_DISCOVERY_TECH_GOLD_ANNOTATION);
          event.setProperties(eventProperties);
          event.setMentions(new FSArray(jCas, 1));
          event.setMentions(0, eventMention);
          event.addToIndexes();
          eventMention.setConfidence(1.0f);
          eventMention.setDiscoveryTechnique(CONST.NE_DISCOVERY_TECH_GOLD_ANNOTATION);
          eventMention.setEvent(event);
          eventMention.addToIndexes();
          annotation = eventMention;
View Full Code Here

          throw new IllegalArgumentException("Invalid polarity: " + polarityStr);
        }
        eventProperties.setPolarity(polarity);

        // create the event object
        Event event = new Event(jCas);
        event.setConfidence(1.0f);
        event.setDiscoveryTechnique(CONST.NE_DISCOVERY_TECH_GOLD_ANNOTATION);

        // create the event mention
        EventMention eventMention = new EventMention(jCas, coveringSpan.begin, coveringSpan.end);
        eventMention.setConfidence(1.0f);
        eventMention.setDiscoveryTechnique(CONST.NE_DISCOVERY_TECH_GOLD_ANNOTATION);

        // add the links between event, mention and properties
        event.setProperties(eventProperties);
        event.setMentions(new FSArray(jCas, 1));
        event.setMentions(0, eventMention);
        eventMention.setEvent(event);

        // add the annotations to the indexes
        eventProperties.addToIndexes();
        event.addToIndexes();
        eventMention.addToIndexes();
        idAnnotationMap.put(annotation.id, eventMention);

      } else if ("DOCTIME".equals(annotation.type)) {
        TimeMention timeMention = new TimeMention(jCas, coveringSpan.begin, coveringSpan.end);
View Full Code Here

          throw new IllegalArgumentException("Invalid polarity: " + polarityStr);
        }
        eventProperties.setPolarity(polarity);

        // create the event object
        Event event = new Event(jCas);
        event.setConfidence(1.0f);
        event.setDiscoveryTechnique(CONST.NE_DISCOVERY_TECH_GOLD_ANNOTATION);

        // create the event mention
        EventMention eventMention = new EventMention(jCas, coveringSpan.begin, coveringSpan.end);
        eventMention.setConfidence(1.0f);
        eventMention.setDiscoveryTechnique(CONST.NE_DISCOVERY_TECH_GOLD_ANNOTATION);

        // add the links between event, mention and properties
        event.setProperties(eventProperties);
        event.setMentions(new FSArray(jCas, 1));
        event.setMentions(0, eventMention);
        eventMention.setEvent(event);

        // add the annotations to the indexes
        eventProperties.addToIndexes();
        event.addToIndexes();
        eventMention.addToIndexes();
        idAnnotationMap.put(annotation.id, eventMention);

      } else if ("DOCTIME".equals(annotation.type)) {
        TimeMention timeMention = new TimeMention(jCas, coveringSpan.begin, coveringSpan.end);
View Full Code Here

          throw new IllegalArgumentException("Invalid polarity: " + polarityStr);
        }
        eventProperties.setPolarity(polarity);

        // create the event object
        Event event = new Event(jCas);
        event.setConfidence(1.0f);
        event.setDiscoveryTechnique(CONST.NE_DISCOVERY_TECH_GOLD_ANNOTATION);

        // create the event mention
        EventMention eventMention = new EventMention(jCas, coveringSpan.begin, coveringSpan.end);
        eventMention.setConfidence(1.0f);
        eventMention.setDiscoveryTechnique(CONST.NE_DISCOVERY_TECH_GOLD_ANNOTATION);

        // add the links between event, mention and properties
        event.setProperties(eventProperties);
        event.setMentions(new FSArray(jCas, 1));
        event.setMentions(0, eventMention);
        eventMention.setEvent(event);

        // add the annotations to the indexes
        eventProperties.addToIndexes();
        event.addToIndexes();
        eventMention.addToIndexes();
        idAnnotationMap.put(annotation.id, eventMention);

      } else if ("DOCTIME".equals(annotation.type)) {
        TimeMention timeMention = new TimeMention(jCas, coveringSpan.begin, coveringSpan.end);
View Full Code Here

TOP

Related Classes of org.apache.ctakes.typesystem.type.refsem.Event

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.