Examples of NewlineToken


Examples of org.apache.ctakes.typesystem.type.syntax.NewlineToken

        } else if (oldSystemTokenClass.equals(ContractionToken.class.getName()))
        {
          newGoldToken = new ContractionToken(goldView, oldSystemToken.getBegin(), oldSystemToken.getEnd());
        } else if (oldSystemTokenClass.equals(NewlineToken.class.getName()))
        {
          newGoldToken = new NewlineToken(goldView, oldSystemToken.getBegin(), oldSystemToken.getEnd());
        } else if (oldSystemTokenClass.equals(NumToken.class.getName()))
        {
          newGoldToken = new NumToken(goldView, oldSystemToken.getBegin(), oldSystemToken.getEnd());
        } else if (oldSystemTokenClass.equals(PunctuationToken.class.getName()))
        {
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.NewlineToken

      return new DecimalTokenAdapter(nta);
    } else if (obj instanceof PunctuationToken) {
      PunctuationToken pta = (PunctuationToken) obj;
      return new PunctuationTokenAdapter(pta);
    } else if (obj instanceof NewlineToken) {
      NewlineToken nta = (NewlineToken) obj;
      return new NewlineTokenAdapter(nta);
    } else if (obj instanceof ContractionToken) {
      ContractionToken cta = (ContractionToken) obj;
      return new ContractionTokenAdapter(cta);
    } else if (obj instanceof SymbolToken) {
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.NewlineToken

          if (begin == end) {
            foundLeftParen = false;
            end = end+1;
          }
          NewlineToken nl = null;
          if (hasNLEnd && newLineItr.hasNext())
          {
            nl = (NewlineToken) newLineItr.next();
            hasNLEnd = true;
          }
          if ((!hasNext && begin <= end) || (nextNERPosition < end))
            wrapItUp = true;
          boolean findNextNL = false;

          if (lastNL <= thisNER.getBegin())
          {
            begin = thisNER.getBegin();
          }

          if ((nl != null) && (thisNER.getBegin() >= nl.getEnd()))
          {
            findNextNL = true;

          } else if (nl != null)
          {
            lastNL = nl.getEnd();
          }

          if (!hasNext)
          {
            findNextNL = false;
            end = seg.getEnd();
          }
          if (!findNextNL)
          {
            if ((nextNER != null)
                && (((nextNER.getCoveredText().compareToIgnoreCase(
                    thisNER.getCoveredText()) == 0) || ((foundRightParen) || nextNER.getBegin() == thisNER.getEnd() + 2))))
            {
              if (nl == null)
              {
                if (!hasNext)
                  end = seg.getEnd();
              } else if (nextNER.getBegin() >= nl.getEnd() && hasNext)
              {
                end = nextNERPosition;
              }
            } else if (hasNLEnd && hasNext)
            {

              foundLeftParen = findCoveredTextInSpan(jcas, PunctuationToken.type, nextNER.getBegin()-1, nextNER.getBegin()+1, (new String[]{"(","/"}));

              /* if (nl == null && foundLeftParen && !hasNext)
            {
              end = seg.getEnd();
            } else */if (nl != null && nl.getEnd() > nextNER.getBegin()
                && !foundLeftParen)
            {
              end = nextNERPosition;
            } /*else if (foundLeftParen && nl != null)
            {
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.NewlineToken

                {

                  while (findStartLF.hasNext())
                  {
                    // int countSymbols = 0;
                    NewlineToken nta = (NewlineToken) findStartLF.next();

                    // Iterator findSymbols =
                    // FSUtil.getAnnotationsInSpanIterator(jcas,
                    // SymbolToken.type,
                    // nta.getEnd(), sub.getBegin());
                    //         
                    // while (findSymbols.hasNext())
                    // {
                    // findSymbols.next();
                    // countSymbols++;
                    // }

                    int countSymbols = FSUtil.countAnnotationsInSpan(jcas,
                        SymbolToken.type, nta.getEnd(), sub.getBegin());

                    if ((nta.getEnd() + countSymbols + 1) >= sub.getBegin())
                    {
                      isolate = true;
                      holdRightEnd = sub.getBegin();
                      end = sub.getBegin();
                    }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.NewlineToken

    {
      PunctuationToken pta = (PunctuationToken) obj;
      return new PunctuationTokenAdapter(pta);
    } else if (obj instanceof NewlineToken)
    {
      NewlineToken nta = (NewlineToken) obj;
      return new NewlineTokenAdapter(nta);
    } else if (obj instanceof ContractionToken)
    {
      ContractionToken cta = (ContractionToken) obj;
      return new ContractionTokenAdapter(cta);
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.NewlineToken

    }
    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.typesystem.type.syntax.NewlineToken

    String docText = jcas.getDocumentText();
    for (int i = rangeBegin; i<rangeEnd; i++) {

      if (docText.charAt(i)==CR) {

        NewlineToken nta;
        if (i+1<rangeEnd && docText.charAt(i+1)==LF) {
          // single NewlineToken for the 2 characters
          nta = new NewlineToken(jcas, i, i+2);
          i++; // skip past the LF
        } else {
          nta = new NewlineToken(jcas, i, i+1);
        }
        nta.addToIndexes();

      } else if (docText.charAt(i)==LF) {

        NewlineToken nta = new NewlineToken(jcas, i, i+1);
        nta.addToIndexes();

      }

    }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.NewlineToken

    }

      } else if (clas.equals(NewlineToken.class)) {

    if (jcas!=null)
        token = new NewlineToken(jcas, beginFromStartOfDocument, endFromStartOfDocument);
    else {
        token = new Token(beginFromStartOfDocument, endFromStartOfDocument);
        ((Token)token).setText(s.substring(begin, end));
    }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.NewlineToken

        } else if (oldSystemTokenClass.equals(ContractionToken.class.getName()))
        {
          newGoldToken = new ContractionToken(goldView, oldSystemToken.getBegin(), oldSystemToken.getEnd());
        } else if (oldSystemTokenClass.equals(NewlineToken.class.getName()))
        {
          newGoldToken = new NewlineToken(goldView, oldSystemToken.getBegin(), oldSystemToken.getEnd());
        } else if (oldSystemTokenClass.equals(NumToken.class.getName()))
        {
          newGoldToken = new NumToken(goldView, oldSystemToken.getBegin(), oldSystemToken.getEnd());
        } else if (oldSystemTokenClass.equals(PunctuationToken.class.getName()))
        {
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.NewlineToken

        } else if (oldSystemTokenClass.equals(ContractionToken.class.getName()))
        {
          newGoldToken = new ContractionToken(goldView, oldSystemToken.getBegin(), oldSystemToken.getEnd());
        } else if (oldSystemTokenClass.equals(NewlineToken.class.getName()))
        {
          newGoldToken = new NewlineToken(goldView, oldSystemToken.getBegin(), oldSystemToken.getEnd());
        } else if (oldSystemTokenClass.equals(NumToken.class.getName()))
        {
          newGoldToken = new NumToken(goldView, oldSystemToken.getBegin(), oldSystemToken.getEnd());
        } else if (oldSystemTokenClass.equals(PunctuationToken.class.getName()))
        {
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.