Examples of DurationAnnotation


Examples of org.apache.ctakes.drugner.type.DurationAnnotation

      while (durationTokenItr.hasNext())
      {
        DurationToken du = (DurationToken) durationTokenItr.next();
        begSegDU = du.getStartOffset();
        endSegDU = du.getEndOffset();
        DurationAnnotation ma = new DurationAnnotation(jcas, begSegDU, endSegDU);
        // dm.setDurationElement(jcas, begSegDU, endSegDU);
        ma.addToIndexes();
        // loadandAppend("./frequencyTable.csv", ma.getCoveredText(),
        // true);
      }

    } catch (Exception e)
View Full Code Here

Examples of org.apache.ctakes.drugner.type.DurationAnnotation

        }
      }
    }   
    else if (elementType == DurationAnnotation.type) {
      while (neItr.hasNext()) {
        DurationAnnotation nea = (DurationAnnotation) neItr.next();
        lastLocation[0] = nea.getBegin();
        lastLocation[1] = nea.getEnd();
        if (nea.getBegin()>=begin && nea.getEnd() <= end && (counter == || (counter> 0 && lastLocation[0] !=  location[counter - 1][0]))) {
          location[counter][0]= lastLocation[0];
          location[counter][1]= lastLocation[1];
          counter++;
        }
      }

    }
    else if (elementType == DrugChangeStatusAnnotation.type) {
      while (neItr.hasNext()) {
        DrugChangeStatusAnnotation nea = (DrugChangeStatusAnnotation) neItr.next();
        lastLocation[0] = nea.getBegin();
        lastLocation[1] = nea.getEnd();
        if (nea.getBegin()>=begin && nea.getEnd() <= end && (counter == || (counter> 0 && lastLocation[0] !=  location[counter - 1][0]))) {
          location[counter][0]= lastLocation[0];
          location[counter][1]= lastLocation[1];
          counter++;
        }
      }

    } else if (elementType == MedicationMention.type) {
      while (neItr.hasNext()) {
        MedicationMention nea = (MedicationMention) neItr.next();
        if(nea.getTypeID()==1 || nea.getTypeID()==0) {
          lastLocation[0]= nea.getBegin();
          lastLocation[1] = nea.getEnd();
          if ((counter == 0 || lastLocation[0] != location[counter-1][0]) && (nea.getBegin()>=begin && nea.getEnd() <= end)) {
            location[counter][0]= lastLocation[0];
            location[counter][1]= lastLocation[1];
            counter++;
          }

        }
      }
    } else if (elementType == PunctuationToken.type) {
      while (neItr.hasNext()) {
        boolean foundPair = false;
        PunctuationToken nea = (PunctuationToken) neItr.next();
        if (nea.getCoveredText().compareTo("(")==0)
          lastLocation[0] = nea.getBegin();
        else if (nea.getCoveredText().compareTo(")")==0) {
          lastLocation[1] = nea.getEnd();
          foundPair = true;
        }
        if (nea.getBegin()>=begin && nea.getEnd() <= end && foundPair && (counter == || (counter> 0 && lastLocation[0] !=  location[counter - 1][0]))) {
          location[counter][0]= lastLocation[0];
          location[counter][1]= lastLocation[1];
          counter++;
        }
      }
View Full Code Here

Examples of org.apache.ctakes.drugner.type.DurationAnnotation

      numElements++;
    }
    neItr = FSUtil.getAnnotationsIteratorInSpan(jcas,
        DurationAnnotation.type, begin, end);
    while (neItr.hasNext()) {
      DurationAnnotation nea = (DurationAnnotation) neItr.next();

      numElements++;
    }
    neItr = FSUtil.getAnnotationsIteratorInSpan(jcas,
        DrugChangeStatusAnnotation.type, begin, end);
View Full Code Here

Examples of org.apache.ctakes.drugner.type.DurationAnnotation

      }
    }   
    else if (elementType == DurationAnnotation.type) {
      int holdBeginElement = 0, holdEndElement = 0;
      while (neItr.hasNext()) {
        DurationAnnotation nea = (DurationAnnotation) neItr.next();
        lastLocation[0] = nea.getBegin();
        lastLocation[1] = nea.getEnd();
        if (holdBeginElement < nea.getBegin() && nea.getBegin()>=begin && nea.getEnd() <= end && nea.getEnd() > holdEndElement) {
          holdBeginElement = location[counter][0]= lastLocation[0];
          holdEndElement = location[counter][1]= lastLocation[1];
          counter++;
        }
      }

    }
    else if (elementType == NewlineToken.type) {
      int holdBeginElement = 0;
      while (neItr.hasNext()) {
        NewlineToken nea = (NewlineToken) neItr.next();
        lastLocation[0] = nea.getBegin();
        lastLocation[1] = nea.getEnd();
        if (holdBeginElement < nea.getBegin() && nea.getBegin()>=begin && nea.getEnd() <= end) {
          holdBeginElement = location[counter][0]= lastLocation[0];
          location[counter][1]= lastLocation[1];
          counter++;
        }
      }

    } else if (elementType == MedicationMention.type) {
      int holdEndElement = 0;
      while (neItr.hasNext()) {
        MedicationMention nea = (MedicationMention) neItr.next();
        if(nea.getTypeID()==1 || nea.getTypeID()==0) {
          lastLocation[0]= nea.getBegin();
          lastLocation[1] = nea.getEnd();
          if ((counter == 0 || lastLocation[0] != location[counter-1][0]) && (nea.getBegin()>=begin && nea.getEnd() <= end)) {
            location[counter][0]= lastLocation[0];
            holdEndElement = location[counter][1] = lastLocation[1];
            counter++;
          } else if (counter > 0 && holdEndElement > lastLocation[1]) {
            holdEndElement = location[counter-1][1] = lastLocation[1];
          }

        }
      }
    } else if (elementType == PunctuationToken.type) {
      while (neItr.hasNext()) {
        int holdBeginElement = 0;
        boolean foundPair = false;
        PunctuationToken nea = (PunctuationToken) neItr.next();
        if (nea.getCoveredText().compareTo("(")==0 || nea.getCoveredText().compareTo("[")==0)
          lastLocation[0] = nea.getBegin();
        else if (nea.getCoveredText().compareTo(")")==0 || nea.getCoveredText().compareTo("]")==0) {
          lastLocation[1] = nea.getEnd();
          foundPair = true;
        }
        if (holdBeginElement < nea.getBegin() && nea.getBegin()>=begin && nea.getEnd() <= end && foundPair) {
          location[counter][0]= lastLocation[0];
          location[counter][1]= lastLocation[1];
          counter++;
        }
      }
View Full Code Here

Examples of org.apache.ctakes.drugner.type.DurationAnnotation

              focusToken.getEnd());
        }
      }
      Iterator durationTokenItr = FSUtil.getAnnotationsIteratorInSpan(jcas, DurationAnnotation.type, beginPos, endPos);
      while (durationTokenItr.hasNext()){
        DurationAnnotation focusToken = (DurationAnnotation) durationTokenItr.next();
        String localDuration = null;
        if ((localDuration = findDurationElement(jcas, focusToken
            .getBegin(), focusToken.getEnd())) == null) {
          duration = new DurationElement(focusToken.getCoveredText(),
              focusToken.getBegin(), focusToken.getEnd());
        } else {
          setDurationElement(localDuration, focusToken.getBegin(),
              focusToken.getEnd());
        }
      }

     
 
View Full Code Here

Examples of org.apache.ctakes.drugner.type.DurationAnnotation

  private String findDurationElement(JCas jcas, int beginOffset, int endOffset) {

    Iterator firItr = FSUtil.getAnnotationsIteratorInSpan(jcas,
        DurationAnnotation.type, beginOffset, endOffset + 1);
    while (firItr.hasNext()) {
      DurationAnnotation da = (DurationAnnotation) firItr.next();
      if (da.getBegin() == beginOffset)
        return da.getCoveredText();
    }
    return null;
  }
View Full Code Here

Examples of org.apache.ctakes.drugner.type.DurationAnnotation

      while (durationTokenItr.hasNext())
      {
        DurationToken du = (DurationToken) durationTokenItr.next();
        begSegDU = du.getStartOffset();
        endSegDU = du.getEndOffset();
        DurationAnnotation ma = new DurationAnnotation(jcas, begSegDU, endSegDU);
        // dm.setDurationElement(jcas, begSegDU, endSegDU);
        ma.addToIndexes();
        // loadandAppend("./frequencyTable.csv", ma.getCoveredText(),
        // true);
      }

    } catch (Exception e)
View Full Code Here

Examples of org.apache.ctakes.drugner.type.DurationAnnotation

        }
      }
    }   
    else if (elementType == DurationAnnotation.type) {
      while (neItr.hasNext()) {
        DurationAnnotation nea = (DurationAnnotation) neItr.next();
        lastLocation[0] = nea.getBegin();
        lastLocation[1] = nea.getEnd();
        if (nea.getBegin()>=begin && nea.getEnd() <= end && (counter == || (counter> 0 && lastLocation[0] !=  location[counter - 1][0]))) {
          location[counter][0]= lastLocation[0];
          location[counter][1]= lastLocation[1];
          counter++;
        }
      }

    }
    else if (elementType == DrugChangeStatusAnnotation.type) {
      while (neItr.hasNext()) {
        DrugChangeStatusAnnotation nea = (DrugChangeStatusAnnotation) neItr.next();
        lastLocation[0] = nea.getBegin();
        lastLocation[1] = nea.getEnd();
        if (nea.getBegin()>=begin && nea.getEnd() <= end && (counter == || (counter> 0 && lastLocation[0] !=  location[counter - 1][0]))) {
          location[counter][0]= lastLocation[0];
          location[counter][1]= lastLocation[1];
          counter++;
        }
      }

    } else if (elementType == MedicationMention.type) {
      while (neItr.hasNext()) {
        MedicationMention nea = (MedicationMention) neItr.next();
        if(nea.getTypeID()==1 || nea.getTypeID()==0) {
          lastLocation[0]= nea.getBegin();
          lastLocation[1] = nea.getEnd();
          if ((counter == 0 || lastLocation[0] != location[counter-1][0]) && (nea.getBegin()>=begin && nea.getEnd() <= end)) {
            location[counter][0]= lastLocation[0];
            location[counter][1]= lastLocation[1];
            counter++;
          }

        }
      }
    } else if (elementType == PunctuationToken.type) {
      while (neItr.hasNext()) {
        boolean foundPair = false;
        PunctuationToken nea = (PunctuationToken) neItr.next();
        if (nea.getCoveredText().compareTo("(")==0)
          lastLocation[0] = nea.getBegin();
        else if (nea.getCoveredText().compareTo(")")==0) {
          lastLocation[1] = nea.getEnd();
          foundPair = true;
        }
        if (nea.getBegin()>=begin && nea.getEnd() <= end && foundPair && (counter == || (counter> 0 && lastLocation[0] !=  location[counter - 1][0]))) {
          location[counter][0]= lastLocation[0];
          location[counter][1]= lastLocation[1];
          counter++;
        }
      }
View Full Code Here

Examples of org.apache.ctakes.drugner.type.DurationAnnotation

      numElements++;
    }
    neItr = FSUtil.getAnnotationsIteratorInSpan(jcas,
        DurationAnnotation.type, begin, end);
    while (neItr.hasNext()) {
      DurationAnnotation nea = (DurationAnnotation) neItr.next();

      numElements++;
    }
    neItr = FSUtil.getAnnotationsIteratorInSpan(jcas,
        DrugChangeStatusAnnotation.type, begin, end);
View Full Code Here

Examples of org.apache.ctakes.drugner.type.DurationAnnotation

      }
    }   
    else if (elementType == DurationAnnotation.type) {
      int holdBeginElement = 0, holdEndElement = 0;
      while (neItr.hasNext()) {
        DurationAnnotation nea = (DurationAnnotation) neItr.next();
        lastLocation[0] = nea.getBegin();
        lastLocation[1] = nea.getEnd();
        if (holdBeginElement < nea.getBegin() && nea.getBegin()>=begin && nea.getEnd() <= end && nea.getEnd() > holdEndElement) {
          holdBeginElement = location[counter][0]= lastLocation[0];
          holdEndElement = location[counter][1]= lastLocation[1];
          counter++;
        }
      }

    }
    else if (elementType == NewlineToken.type) {
      int holdBeginElement = 0;
      while (neItr.hasNext()) {
        NewlineToken nea = (NewlineToken) neItr.next();
        lastLocation[0] = nea.getBegin();
        lastLocation[1] = nea.getEnd();
        if (holdBeginElement < nea.getBegin() && nea.getBegin()>=begin && nea.getEnd() <= end) {
          holdBeginElement = location[counter][0]= lastLocation[0];
          location[counter][1]= lastLocation[1];
          counter++;
        }
      }

    } else if (elementType == MedicationMention.type) {
      int holdEndElement = 0;
      while (neItr.hasNext()) {
        MedicationMention nea = (MedicationMention) neItr.next();
        if(nea.getTypeID()==1 || nea.getTypeID()==0) {
          lastLocation[0]= nea.getBegin();
          lastLocation[1] = nea.getEnd();
          if ((counter == 0 || lastLocation[0] != location[counter-1][0]) && (nea.getBegin()>=begin && nea.getEnd() <= end)) {
            location[counter][0]= lastLocation[0];
            holdEndElement = location[counter][1] = lastLocation[1];
            counter++;
          } else if (counter > 0 && holdEndElement > lastLocation[1]) {
            holdEndElement = location[counter-1][1] = lastLocation[1];
          }

        }
      }
    } else if (elementType == PunctuationToken.type) {
      while (neItr.hasNext()) {
        int holdBeginElement = 0;
        boolean foundPair = false;
        PunctuationToken nea = (PunctuationToken) neItr.next();
        if (nea.getCoveredText().compareTo("(")==0 || nea.getCoveredText().compareTo("[")==0)
          lastLocation[0] = nea.getBegin();
        else if (nea.getCoveredText().compareTo(")")==0 || nea.getCoveredText().compareTo("]")==0) {
          lastLocation[1] = nea.getEnd();
          foundPair = true;
        }
        if (holdBeginElement < nea.getBegin() && nea.getBegin()>=begin && nea.getEnd() <= end && foundPair) {
          location[counter][0]= lastLocation[0];
          location[counter][1]= lastLocation[1];
          counter++;
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.