Package org.apache.ctakes.drugner.fsm.output.elements

Examples of org.apache.ctakes.drugner.fsm.output.elements.StrengthToken


        Set preTokenSet = iv_strengthFSM.execute(baseTokenList, strengthTokenSet, fractionTokenSet);
        Iterator preTokenItr = preTokenSet.iterator();

        while (preTokenItr.hasNext())
        {
          StrengthToken mt = (StrengthToken) preTokenItr.next();
          int begOff = mt.getStartOffset();
          int endOff = mt.getEndOffset();
          StrengthAnnotation ma = new StrengthAnnotation(jcas, begOff, endOff);
          Iterator subStrengthItr = FSUtil.getAnnotationsIteratorInSpan(jcas, StrengthUnitAnnotation.type, begOff, endOff);
          if (subStrengthItr.hasNext() )
                ma.setEnd(((StrengthUnitAnnotation)subStrengthItr.next()).getBegin());
          ma.addToIndexes();
          // loadandAppend("./strengthTable.csv", ma.getCoveredText(),
          // true);

        }
//      }
      Set doseTokenSet = iv_dosagesFSM.execute(baseTokenList, formTokenSet,
          strengthTokenSet);
      Iterator dosTokenItr = doseTokenSet.iterator();
      Iterator formCheckItr = formTokenSet.iterator();
      Iterator strengthCheckItr = strengthTokenSet.iterator();
      boolean foundDosage = false;
      int begSegDose = 0, endSegDose = 0;

      while (dosTokenItr.hasNext())
      {
        DosageToken mt = (DosageToken) dosTokenItr.next();
        begSegDose = mt.getStartOffset();
        endSegDose = mt.getEndOffset();
        DosagesAnnotation ma = new DosagesAnnotation(jcas, begSegDose,
            endSegDose);

        ma.addToIndexes();

      }
      Set suffixTokenSet = iv_suffixFSM.execute(baseTokenList, strengthTokenSet);

      Iterator suffixTokenItr = suffixTokenSet.iterator();
      while (suffixTokenItr.hasNext())
      {
        SuffixStrengthToken mt = (SuffixStrengthToken) suffixTokenItr.next();
        SuffixStrengthAnnotation ma = new SuffixStrengthAnnotation(jcas, mt.getStartOffset(), mt.getEndOffset());
        ma.addToIndexes();
      }
      // This needs to be handled differently. But since I'm not sure if this feature will be utilized
      // I am going to leave 'as is' for now.

      Set routeTokenSet = iv_routeFSM.execute(baseTokenList);
      boolean foundRoute = false;
      Iterator routeTokenItr = routeTokenSet.iterator();
      int begSegRT = 0, endSegRT = 0;
      while (routeTokenItr.hasNext())
      {
        RouteToken mt = (RouteToken) routeTokenItr.next();
        begSegRT = mt.getStartOffset();
        endSegRT = mt.getEndOffset();
        RouteAnnotation ma = new RouteAnnotation(jcas, begSegRT, endSegRT);
        ma.setIntakeMethod(new Integer(mt.getFormMethod()).toString());
        ma.addToIndexes();

      }

      Set frequencyUnitTokenSet = iv_frequencyUnitFSM.execute(baseTokenList);
View Full Code Here


        Set preTokenSet = iv_strengthFSM.execute(baseTokenList, strengthTokenSet, fractionTokenSet);
        Iterator preTokenItr = preTokenSet.iterator();

        while (preTokenItr.hasNext())
        {
          StrengthToken mt = (StrengthToken) preTokenItr.next();
          int begOff = mt.getStartOffset();
          int endOff = mt.getEndOffset();
          StrengthAnnotation ma = new StrengthAnnotation(jcas, begOff, endOff);
          Iterator subStrengthItr = FSUtil.getAnnotationsIteratorInSpan(jcas, StrengthUnitAnnotation.type, begOff, endOff);
          if (subStrengthItr.hasNext() )
                ma.setEnd(((StrengthUnitAnnotation)subStrengthItr.next()).getBegin());
          ma.addToIndexes();
          // loadandAppend("./strengthTable.csv", ma.getCoveredText(),
          // true);

        }
//      }
      Set doseTokenSet = iv_dosagesFSM.execute(baseTokenList, formTokenSet,
          strengthTokenSet);
      Iterator dosTokenItr = doseTokenSet.iterator();
      Iterator formCheckItr = formTokenSet.iterator();
      Iterator strengthCheckItr = strengthTokenSet.iterator();
      boolean foundDosage = false;
      int begSegDose = 0, endSegDose = 0;

      while (dosTokenItr.hasNext())
      {
        DosageToken mt = (DosageToken) dosTokenItr.next();
        begSegDose = mt.getStartOffset();
        endSegDose = mt.getEndOffset();
        DosagesAnnotation ma = new DosagesAnnotation(jcas, begSegDose,
            endSegDose);

        ma.addToIndexes();

      }
      Set suffixTokenSet = iv_suffixFSM.execute(baseTokenList, strengthTokenSet);

      Iterator suffixTokenItr = suffixTokenSet.iterator();
      while (suffixTokenItr.hasNext())
      {
        SuffixStrengthToken mt = (SuffixStrengthToken) suffixTokenItr.next();
        SuffixStrengthAnnotation ma = new SuffixStrengthAnnotation(jcas, mt.getStartOffset(), mt.getEndOffset());
        ma.addToIndexes();
      }
      // This needs to be handled differently. But since I'm not sure if this feature will be utilized
      // I am going to leave 'as is' for now.

      Set routeTokenSet = iv_routeFSM.execute(baseTokenList);
      boolean foundRoute = false;
      Iterator routeTokenItr = routeTokenSet.iterator();
      int begSegRT = 0, endSegRT = 0;
      while (routeTokenItr.hasNext())
      {
        RouteToken mt = (RouteToken) routeTokenItr.next();
        begSegRT = mt.getStartOffset();
        endSegRT = mt.getEndOffset();
        RouteAnnotation ma = new RouteAnnotation(jcas, begSegRT, endSegRT);
        ma.setIntakeMethod(new Integer(mt.getFormMethod()).toString());
        ma.addToIndexes();

      }

      Set frequencyUnitTokenSet = iv_frequencyUnitFSM.execute(baseTokenList);
View Full Code Here

        Set preTokenSet = iv_strengthFSM.execute(baseTokenList, strengthTokenSet, fractionTokenSet);
        Iterator preTokenItr = preTokenSet.iterator();

        while (preTokenItr.hasNext())
        {
          StrengthToken mt = (StrengthToken) preTokenItr.next();
          int begOff = mt.getStartOffset();
          int endOff = mt.getEndOffset();
          StrengthAnnotation ma = new StrengthAnnotation(jcas, begOff, endOff);
          Iterator subStrengthItr = FSUtil.getAnnotationsIteratorInSpan(jcas, StrengthUnitAnnotation.type, begOff, endOff);
          if (subStrengthItr.hasNext() )
                ma.setEnd(((StrengthUnitAnnotation)subStrengthItr.next()).getBegin());
          ma.addToIndexes();
          // loadandAppend("./strengthTable.csv", ma.getCoveredText(),
          // true);

        }
//      }
      Set doseTokenSet = iv_dosagesFSM.execute(baseTokenList, formTokenSet,
          strengthTokenSet);
      Iterator dosTokenItr = doseTokenSet.iterator();
      Iterator formCheckItr = formTokenSet.iterator();
      Iterator strengthCheckItr = strengthTokenSet.iterator();
      boolean foundDosage = false;
      int begSegDose = 0, endSegDose = 0;

      while (dosTokenItr.hasNext())
      {
        DosageToken mt = (DosageToken) dosTokenItr.next();
        begSegDose = mt.getStartOffset();
        endSegDose = mt.getEndOffset();
        DosagesAnnotation ma = new DosagesAnnotation(jcas, begSegDose,
            endSegDose);

        ma.addToIndexes();

      }
      Set suffixTokenSet = iv_suffixFSM.execute(baseTokenList, strengthTokenSet);

      Iterator suffixTokenItr = suffixTokenSet.iterator();
      while (suffixTokenItr.hasNext())
      {
        SuffixStrengthToken mt = (SuffixStrengthToken) suffixTokenItr.next();
        SuffixStrengthAnnotation ma = new SuffixStrengthAnnotation(jcas, mt.getStartOffset(), mt.getEndOffset());
        ma.addToIndexes();
      }
      // This needs to be handled differently. But since I'm not sure if this feature will be utilized
      // I am going to leave 'as is' for now.

      Set routeTokenSet = iv_routeFSM.execute(baseTokenList);
      boolean foundRoute = false;
      Iterator routeTokenItr = routeTokenSet.iterator();
      int begSegRT = 0, endSegRT = 0;
      while (routeTokenItr.hasNext())
      {
        RouteToken mt = (RouteToken) routeTokenItr.next();
        begSegRT = mt.getStartOffset();
        endSegRT = mt.getEndOffset();
        RouteAnnotation ma = new RouteAnnotation(jcas, begSegRT, endSegRT);
        ma.setIntakeMethod(new Integer(mt.getFormMethod()).toString());
        ma.addToIndexes();

      }

      Set frequencyUnitTokenSet = iv_frequencyUnitFSM.execute(baseTokenList);
View Full Code Here

          /*if (fsm.equals(iv_strengthMachine)){
            startToken = (BaseToken) tokens  .get(tokenStartIndex+1);
          } else {*/
        //      startToken = (BaseToken) tokens.get(tokenStartIndex); 
          //}
          StrengthToken measurementToken = new StrengthToken(startToken
              .getStartOffset(), endToken.getEndOffset());
          measurementSet.add(measurementToken);
          fsm.reset();
        }
      }
View Full Code Here

          /*if (fsm.equals(iv_strengthMachine)){
            startToken = (BaseToken) tokens  .get(tokenStartIndex+1);
          } else {*/
          //    startToken = (BaseToken) tokens.get(tokenStartIndex); 
          //}
          StrengthToken measurementToken = new StrengthToken(startToken
                .getStartOffset(), endToken.getEndOffset());
          measurementSet.add(measurementToken);
     
          fsm.reset();
         
View Full Code Here

          /*if (fsm.equals(iv_strengthMachine)){
            startToken = (BaseToken) tokens  .get(tokenStartIndex+1);
          } else {*/
          //    startToken = (BaseToken) tokens.get(tokenStartIndex); 
          //}
          StrengthToken measurementToken = new StrengthToken(startToken
                .getStartOffset(), endToken.getEndOffset());
          measurementSet.add(measurementToken);
     
          fsm.reset();
         
View Full Code Here

        Set preTokenSet = iv_strengthFSM.execute(baseTokenList, strengthTokenSet, fractionTokenSet);
        Iterator preTokenItr = preTokenSet.iterator();

        while (preTokenItr.hasNext())
        {
          StrengthToken mt = (StrengthToken) preTokenItr.next();
          int begOff = mt.getStartOffset();
          int endOff = mt.getEndOffset();
          StrengthAnnotation ma = new StrengthAnnotation(jcas, begOff, endOff);
          Iterator subStrengthItr = FSUtil.getAnnotationsIteratorInSpan(jcas, StrengthUnitAnnotation.type, begOff, endOff);
          if (subStrengthItr.hasNext() )
                ma.setEnd(((StrengthUnitAnnotation)subStrengthItr.next()).getBegin());
          ma.addToIndexes();
          // loadandAppend("./strengthTable.csv", ma.getCoveredText(),
          // true);

        }
//      }
      Set doseTokenSet = iv_dosagesFSM.execute(baseTokenList, formTokenSet,
          strengthTokenSet);
      Iterator dosTokenItr = doseTokenSet.iterator();
      Iterator formCheckItr = formTokenSet.iterator();
      Iterator strengthCheckItr = strengthTokenSet.iterator();
      boolean foundDosage = false;
      int begSegDose = 0, endSegDose = 0;

      while (dosTokenItr.hasNext())
      {
        DosageToken mt = (DosageToken) dosTokenItr.next();
        begSegDose = mt.getStartOffset();
        endSegDose = mt.getEndOffset();
        DosagesAnnotation ma = new DosagesAnnotation(jcas, begSegDose,
            endSegDose);

        ma.addToIndexes();

      }
      Set suffixTokenSet = iv_suffixFSM.execute(baseTokenList, strengthTokenSet);

      Iterator suffixTokenItr = suffixTokenSet.iterator();
      while (suffixTokenItr.hasNext())
      {
        SuffixStrengthToken mt = (SuffixStrengthToken) suffixTokenItr.next();
        SuffixStrengthAnnotation ma = new SuffixStrengthAnnotation(jcas, mt.getStartOffset(), mt.getEndOffset());
        ma.addToIndexes();
      }
      // This needs to be handled differently. But since I'm not sure if this feature will be utilized
      // I am going to leave 'as is' for now.

      Set routeTokenSet = iv_routeFSM.execute(baseTokenList);
      boolean foundRoute = false;
      Iterator routeTokenItr = routeTokenSet.iterator();
      int begSegRT = 0, endSegRT = 0;
      while (routeTokenItr.hasNext())
      {
        RouteToken mt = (RouteToken) routeTokenItr.next();
        begSegRT = mt.getStartOffset();
        endSegRT = mt.getEndOffset();
        RouteAnnotation ma = new RouteAnnotation(jcas, begSegRT, endSegRT);
        ma.setIntakeMethod(new Integer(mt.getFormMethod()).toString());
        ma.addToIndexes();

      }

      Set frequencyUnitTokenSet = iv_frequencyUnitFSM.execute(baseTokenList);
View Full Code Here

TOP

Related Classes of org.apache.ctakes.drugner.fsm.output.elements.StrengthToken

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.