Package org.apache.ctakes.sideeffect.type

Examples of org.apache.ctakes.sideeffect.type.SideEffectAnnotation


     
          String docName = DocumentIDAnnotationUtil.getDocumentID(jcas);       

          Iterator seIter = indexes.getAnnotationIndex(SideEffectAnnotation.type).iterator();
          while(seIter.hasNext()) {
            SideEffectAnnotation sea = (SideEffectAnnotation) seIter.next();
            String se = "";
            String seSpan = "";
            String drug = "";
            String drugSpan = "";
            String sentence = sea.getSentence().getCoveredText().trim();
           
            se = sea.getCoveredText().trim();
            seSpan = Integer.toString(sea.getBegin()) + iv_delimiter
                  + Integer.toString(sea.getEnd());
            if(sea.getDrug()!=null) {
              drug = sea.getDrug().getCoveredText().trim();
              drugSpan = Integer.toString(sea.getDrug().getBegin()) + iv_delimiter
                    + Integer.toString(sea.getDrug().getEnd());
            }
            else {
              drug = se;
              drugSpan = seSpan;
            }
View Full Code Here


    //get side-effect sentence spans found by rules (SideEffectAnnotator)
    Set<String> seSenSpans_rule = new HashSet<String>();
    Iterator seIter = indexes.getAnnotationIndex(SideEffectAnnotation.type).iterator();
   
      while(seIter.hasNext()) {
        SideEffectAnnotation se = (SideEffectAnnotation) seIter.next();       
        String span = Integer.toString(se.getSentence().getBegin()) + "|"
                + Integer.toString(se.getSentence().getEnd());
        seSenSpans_rule.add(span);
      }
   
      //annotate SE sentences (add them to SESentence)
      Set<String> seSenSpans = new HashSet<String>(seSenSpans_ML);
View Full Code Here

   */
  private void annotateSideEffects(JCas jcas, List<SideEffect> seLst) {
    for(int i=0; i<seLst.size(); i++) {
      SideEffect se = (SideEffect) seLst.get(i);
   
      SideEffectAnnotation sea = new SideEffectAnnotation(jcas);
      sea.setSideEffect(se.pse.ne);
      if(se.pse.ne!=null) {
        sea.setBegin(se.pse.ne.getBegin());
        sea.setEnd(se.pse.ne.getEnd());
      }
      else {
        sea.setBegin(se.pse.senBegin);
        sea.setEnd(se.pse.senEnd);
      }
      sea.setDrug(se.pse.drug);
           
      SESentence ses = new SESentence(jcas);
      ses.setBegin(se.pse.senBegin);
      ses.setEnd(se.pse.senEnd);
      sea.setSentence(ses);
     
      sea.addToIndexes();
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.ctakes.sideeffect.type.SideEffectAnnotation

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.