Examples of PADHit


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

  private boolean checkStandAlone(JCas cas, Annotation ann)
  throws IllegalAccessException, NoSuchFieldException, ClassNotFoundException
  {
    if( JCasUtil.isInstanceOf(annotationPartOneOfPair, ann)&& ((PADTerm)ann).getIsStandAlone() == 1)
    {
      PADHit uah = new PADHit(cas);
      uah.setUaTerm((PADTerm)ann);
      uah.addToIndexes();
      return true;
    }
   
    if(JCasUtil.isInstanceOf(annotationPartTwoOfPair, ann )&& ((PADLocation)ann).getIsStandAlone() == 1)
    {
      PADHit uah = new PADHit(cas);
      uah.setUaLocation((PADLocation)ann);
      uah.addToIndexes();
      return true;
    }     
    return false;
  }
View Full Code Here

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

        }
      }
     
      if(isHit)
      {
        PADHit uah = new PADHit(jcas);
        uah.setUaLocation(ual);
        uah.setUaTerm(uat);
        uah.addToIndexes();
      }
     
    }
  }
View Full Code Here

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

          casConsumerOffSetData.append("(");
          casConsumerOutData.append(COLLECTION_SEPARATOR);
        }

        // add segment from term or location
        PADHit uaHit = (PADHit) annotItr.next();
        if (uaHit.getUaTerm() != null)
          casConsumerOutData.append(((PADTerm) uaHit.getUaTerm())
              .getSegmentID());
        else if (uaHit.getUaLocation() != null)
          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
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.