Examples of PADTerm


Examples of org.apache.ctakes.padtermspotter.type.PADTerm

    String mfIsStandAlone = metaData.getMetaFieldValue("2");
   
    iv_logger.log(Level.INFO, "Meta field 1 ["+mfValue+"] col2["+mfIsStandAlone+"]");
   
    int cutOffForRevision = findOriginalReportSubSection(jcas);
    PADTerm uaTerm = new PADTerm(jcas);
    uaTerm.setHitDictionaryValue(mfValue);

    uaTerm.setBegin(neBegin);
    uaTerm.setEnd(neEnd);
   
    String segStatus = getSubSectionStatus(uaTerm, jcas, cutOffForRevision);

    if(mfIsStandAlone != null && mfIsStandAlone.equalsIgnoreCase(STAND_ALONE))
      uaTerm.setIsStandAlone(TRUE);
    else {
      uaTerm.setIsStandAlone(FALSE);
      uaTerm.setTypeID(new Integer(mfIsStandAlone).intValue());
    }


    List<?> list = getTokenData(jcas, uaTerm);
    FSArray fsArr = new FSArray(jcas, list.size());
   
    for(int i=0; i<list.size(); i++)
      fsArr.set(i, (WordToken)list.get(i));
   
    uaTerm.setRelatedTokens(fsArr);
  
    if (segStatus.compareTo("-1")==0 || segStatus.compareTo("1")!=0) {
      String segId = getSegmentIdContaining(uaTerm, jcas);
      uaTerm.setSegmentID(segId);
   
    //fsArr.addToIndexes();
      uaTerm.addToIndexes();
    }
  }
View Full Code Here

Examples of org.apache.ctakes.padtermspotter.type.PADTerm

   
    if(isAdjacentWithWindowSize(jcas, prevAnn, currAnn, iAnnotationType, iWindowSize))
    {
      boolean isHit = false;
      PADLocation ual = null;
      PADTerm uat = null;
     
      if((prevAnn != null && prevAnn instanceof PADLocation) &&
          (currAnn != null && currAnn instanceof PADTerm))
      {
        ual = (PADLocation)prevAnn;
View Full Code Here

Examples of org.apache.ctakes.padtermspotter.type.PADTerm

    Iterator<?> annotItr = indexes.getAnnotationIndex(iAnnTypePartOneOfPair).iterator();

    //if terms present store them
    while(annotItr.hasNext())
    {
      PADTerm uaTerm = (PADTerm)annotItr.next();

      if((uaTerm.getPolarity()<0 && filterOutNegated) || isInIgnoreTypesPartOne(uaTerm))//negated, so get next
      {
        iv_logger.info(uaTerm.getHitDictionaryValue() + " ignoring because negated");
        continue;
      }
      storePartOneHit(uaTerm);
    }
  }
View Full Code Here

Examples of org.apache.ctakes.padtermspotter.type.PADTerm

          casConsumerOutData.append(((PADLocation) uaHit
              .getUaLocation()).getSegmentID());

        // add location and term data
        PADLocation ual = uaHit.getUaLocation();
        PADTerm uat = uaHit.getUaTerm();

        if (ual != null) {
          casConsumerOutData.append(COLLECTION_SEPARATOR
              + ual.getCoveredText());
          casConsumerOffSetData.append(ual.getBegin() + "-"
              + ual.getEnd() + ":");
          if (ual.getPolarity() == -1
              && uat == null
              || (ual.getPolarity() == -1 && uat != null
                  && uat.getTypeID() != disorderStenosis && ual
                  .getPolarity() == -1)) {
            negatedCase = true;
          } else if (ual.getIsStandAlone() != 1
              && ual.getPolarity() != -1
              && ual.getUncertainty() == disorderPatent) {
            probableCase = true;
            probableCount++;
          } else
            probableCase = false;
        } else {
          casConsumerOutData.append(COLLECTION_SEPARATOR + " ");
          casConsumerOffSetData.append("-1:");
          if (uat.getTypeID() == disorderStenosis
              && uat.getPolarity() != -1)
            noStenosis = false;
          if (uat != null && uat.getPolarity() == -1
              && uat.getTypeID() != disorderStenosis
              && uat.getTypeID() != anatomicalSiteExclusion)
            negatedCase = true;
          else if (uat != null
              && ((uat.getIsStandAlone() != 1 || uat.getTypeID() == disorderPatent) && uat
                  .getPolarity() != -1)) {
            probableCase = true;
            probableCount++;
          } else
            probableCase = false;
        }

        if (uat != null) {
          casConsumerOutData.append(COLLECTION_SEPARATOR
              + uat.getCoveredText());
          casConsumerOffSetData.append(uat.getBegin() + "-"
              + uat.getEnd() + ")");
          if (uat.getTypeID() == disorderStenosis
              && uat.getPolarity() != -1)
            noStenosis = false;
          if (uat.getPolarity() == -1
              && uat.getTypeID() != disorderStenosis
              && uat.getUncertainty() != disorderPatent
              && uat.getTypeID() != anatomicalSiteExclusion
              && uat.getIsStandAlone() != 1)

            negatedCase = true;
          else if (uat.getUncertainty() == disorderPatent
              && uat.getIsStandAlone() != 1) {
            probableCase = true;
            probableCount++;
          } else if (!negatedCase)
            probableCase = false;
        } else {
          casConsumerOutData.append(COLLECTION_SEPARATOR + " ");
          casConsumerOffSetData.append("-1)");
          if (ual != null && ual.getPolarity() == -1
              && ual.getUncertainty() != disorderPatent)
            negatedCase = true;
          else if (ual.getIsStandAlone() != 1
              && ual.getPolarity() != -1
              && ual.getUncertainty() == disorderPatent) {
            probableCase = true;
            probableCount++;
          }

          else
            probableCase = false;
        }

        if (probableCase)
          globalProbable = true;
        if ((negatedCase || probableCase)) {
          count--;
          negCount = true;
          if (uat != null && !probableCase
              && uat.getTypeID() != disorderStenosis
              && uat.getTypeID() != disorderPatent) {
            if (ual == null || (ual != null)
                && ual.getTypeID() != disorderPatent
                && ual.getPolarity() == -1)
              balanceCount--;

          }
        } else
          balanceCount++;

      }
      annotItr = indexes.getAnnotationIndex(PADLocation.type).iterator();
      while (annotItr.hasNext()) {
        PADLocation location = (PADLocation) annotItr.next();
        Iterator<?> annotHitItr = indexes.getAnnotationIndex(
            PADHit.type).iterator();
        boolean skip = false;
        if (location.getCoveredText().indexOf("vein") != -1) {
          noVein = false;
          veinCount++;
        }
        while (annotHitItr.hasNext() && !skip) {
          PADHit uaHit = ((PADHit) annotHitItr.next());
          if (uaHit.getUaLocation() != null
              && location.getBegin() == uaHit.getUaLocation()
                  .getBegin())
            skip = true;

        }
        if (!skip) {
          if (location.getPolarity() == -1) {
            locTermsOnly = true;
          }

          if (location.getPolarity() != -1) {

            locOnlyCount++;
            casConsumerOffSetData.append("(");

            casConsumerOffSetData.append("-1:");
            casConsumerOffSetData.append(location.getBegin() + "-"
                + location.getEnd() + ")");
            casConsumerOutData.append(COLLECTION_SEPARATOR);
            casConsumerOutData.append(location.getSegmentID());
            casConsumerOutData.append(COLLECTION_SEPARATOR
                + "**NO TERM**");
            casConsumerOutData.append(COLLECTION_SEPARATOR
                + location.getCoveredText());

          } else if (location.getPolarity() != -1
              && location.getTypeID() != disorderStenosis
              && location.getTypeID() != anatomicalSiteExclusion
              && location.getUncertainty() == disorderPatent)
            locOnlyCount--;
        }
      }
      annotItr = indexes.getAnnotationIndex(PADTerm.type).iterator();
      while (annotItr.hasNext()) {
        PADTerm term = (PADTerm) annotItr.next();
        Iterator<?> annotHitItr = indexes.getAnnotationIndex(
            PADHit.type).iterator();
        boolean skip = false;
        while (annotHitItr.hasNext() && !skip) {
          PADHit uaHit = ((PADHit) annotHitItr.next());
          if (uaHit.getUaTerm() != null
              && term.getBegin() == uaHit.getUaTerm().getBegin())
            skip = true;
        }
        if (!skip) {
          locTermsOnly = false;
          if (term.getTypeID() == disorderStenosis
              && term.getPolarity() != -1)
            noStenosis = false;
          if (term.getUncertainty() == disorderPatent
              && (term.getPolarity() != -1 || term.getTypeID() == disorderStenosis
                  && term.getTypeID() != anatomicalSiteExclusion)) {
            if (term.getUncertainty() == disorderPatent && count == 0) {
              globalProbable = true;
              if (term.getCoveredText().compareToIgnoreCase(
                  "stent") == 0
                  || term.getCoveredText()
                      .compareToIgnoreCase("stents") == 0
                  || term.getCoveredText()
                      .compareToIgnoreCase("stented") == 0)
                noStent = false;
            }

            termOnlyCount++;
            casConsumerOffSetData.append("(");
            casConsumerOffSetData.append(term.getBegin() + "-"
                + term.getEnd() + ":-1)");
            casConsumerOutData.append(COLLECTION_SEPARATOR);
            casConsumerOutData.append(term.getSegmentID());
            casConsumerOutData.append(COLLECTION_SEPARATOR
                + term.getCoveredText());
            casConsumerOutData.append(COLLECTION_SEPARATOR
                + "**NO LOC**");

          } else if (term.getPolarity() != -1
              && term.getTypeID() != disorderStenosis
              && term.getTypeID() != anatomicalSiteExclusion
              && term.getTypeID() == disorderPatent)
            termOnlyCount--;
        }
      }
      int loc = casConsumerOffSetData.indexOf(COUNT_PLACE_HOLDER);
      casConsumerOffSetData.append(casConsumerOutData.toString());
View Full Code Here

Examples of org.apache.ctakes.padtermspotter.type.PADTerm

      //process all PADTerms
      Iterator annotItr = indexes.getAnnotationIndex(PADTerm.type).iterator();
     
      while(annotItr.hasNext())
      {
        PADTerm hft = (PADTerm)annotItr.next();
       
        String dictionaryTerm = hft.getHitDictionaryValue(); //.getCoveredText();
        storeTerm(dictionaryTerm, foundTerms);
      }

      converToCsvData(foundTerms, data);
      //for each document, build a Comma separated string representing
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.