Package edu.pitt.dbmi.nlp.noble.terminology

Examples of edu.pitt.dbmi.nlp.noble.terminology.Annotation


    Relation relation = new Relation("isa");
    c.getRelatedConcepts(relation);
    c.getRelationMap();
    c.getRelations();

    Annotation annots[] = c.getAnnotations();
    c.getParentConcepts();
    edu.pitt.dbmi.nlp.noble.terminology.Concept[] children = c
        .getChildrenConcepts();
    Definition[] definitions = c.getDefinitions();
    String[] matchedTerms = c.getMatchedTerms();
View Full Code Here


          for(int j=0;j<negatableConcepts.size();j++){
            SentenceElement cns = negatableConcepts.get(j);
            if(cns.isConcept()){
              Mention lex = cns.getMention();
              if(token.isPostNegation()){
                Annotation a = new Annotation();
                a.setOffset(token.getOffset()+sent.getOffset());
                a.setText(token.getText());
               
                lex.setModality(Mention.MODALITY_NEGATED);
                lex.setModalityAnnotation(a);
              }else{
                Annotation a = new Annotation();
                a.setOffset(token.getOffset()+sent.getOffset());
                a.setText(token.getText());
               
                lex.setModality(Mention.MODALITY_UNCERTAIN);
                lex.setModalityAnnotation(a);
              }
            }
          }
        }
       
        // clear retro concepts
        negatableConcepts.clear();
       
      // if token is stop word then stop the negation process
      }else if (token.isStopWord()){
        negationConcept = null;
        negatableConcepts.clear();
        window = 0;
      // do the actual negation here
      }else if (token.isConcept()){
        if(negationConcept != null){
          Mention lex = token.getMention();
          Annotation a = new Annotation();
          a.setOffset(negationConcept.getOffset()+sent.getOffset());
          a.setText(negationConcept.getText());
         
          lex.setModality(Mention.MODALITY_NEGATED);
          lex.setModalityAnnotation(a);
   
        }else{
View Full Code Here

    }
    // add annotations
   
    if(!annotations.isEmpty()){
      String txt = getConcept().getSearchString();
      Annotation a = getAnnotations().isEmpty()?null:getAnnotations().get(0);
      int offs = 0;
      if(a != null)
        offs = a.getOffset()-txt.length();
      offs = doc.getText().indexOf(txt,offs);
      if(offs > -1){
        for(Annotation b: annotations){
          if(b.getOffset() < txt.length()) //offs
            b.updateOffset(offs);
View Full Code Here

   */
  private void filterValues(ItemInstance item, List<Annotation> anat) {
    // remove annotations that happen to be part of other annotations
    // Ex: annotations: 6 and 10 where 10 is part of per 10 hpf
    for(ListIterator<Annotation> it=item.getAnnotations().listIterator();it.hasNext();){
      Annotation a = it.next();
      if(anat.contains(a))
        it.remove();
    }
  }
View Full Code Here

    List<Concept> r = new ArrayList<Concept>();
    List<Annotation> annotations = getMention().getAnnotations();
    final int WINDOW = 4;
    int st = -1, en = -1;
    for(int i=0;i<doc.getAnnotations().size();i++){
      Annotation a = doc.getAnnotations().get(i);
      if(annotations.contains(a)){
        if(st == -1)
          st = i;
      }else if(st > -1){
        en = i;
        break;
      }
    }
    // now that we have the range
    if(st > -1){
      Map<Integer,Integer> offsets = new LinkedHashMap<Integer,Integer>();
      offsets.put(st-WINDOW,st);
      if(en > -1)
        offsets.put(en,en+WINDOW);
     
      for(int off: offsets.keySet()){
        for(int i=off;i>=0 && i<offsets.get(off) && i< doc.getAnnotations().size();i++){
          Annotation a = doc.getAnnotations().get(i);
          Concept c = a.getConcept();
          if(r.contains(c)){
            for(Concept b: r){
              if(b != null && !Arrays.asList(b.getAnnotations()).contains(a)){
                r.add(c);
                break;
View Full Code Here

TOP

Related Classes of edu.pitt.dbmi.nlp.noble.terminology.Annotation

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.