Package org.apache.ctakes.typesystem.type.syntax

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


    Iterator wtIter = FSUtil.getAnnotationsInSpanIterator(
        jcas, WordToken.type, begin, end);
    int cnt=0;
   
    while(wtIter.hasNext()) {
      WordToken wt = (WordToken) wtIter.next();
      if(ignoreWords.contains(wt.getCoveredText().toLowerCase())) continue;       
      cnt++;
    }
   
    return cnt;
  }
View Full Code Here


   
    Iterator wtIter = FSUtil.getAnnotationsInSpanIterator(
        jcas, WordToken.type, begin, end);
    int cnt=0;
    while(wtIter.hasNext()) {
      WordToken wt = (WordToken) wtIter.next();
      if(ignoreWords.contains(wt.getCoveredText().toLowerCase())) continue
     
      boolean isNE = false;
      for(IdentifiedAnnotation n : neLst) {
        if(n.getBegin()<=wt.getBegin() && n.getEnd()>=wt.getEnd()) {
          isNE = true;
          break;
        }         
      }
      if(isNE) continue;
View Full Code Here

                  Iterator textSpanInSs = FSUtil.getAnnotationsIteratorInSpan(jcas, WordToken.type, ssAnnot.getSubSectionHeaderBegin(), ssAnnot.getSubSectionHeaderEnd());
                  String subSectionHeaderName = "";
                   
                  while (textSpanInSs.hasNext())
                  {
                      WordToken wta = (WordToken) textSpanInSs.next();
                      subSectionHeaderName = subSectionHeaderName + " " + wta.getCoveredText();
                  }
                  containedInSubSection = containedInSubSection+"|"+subSectionHeaderName+"|"+ssAnnot.getStatus();
                    }
                }
                gotMeds = true;
View Full Code Here

   * @param obj
   * @return
   */
  private BaseToken adaptToBaseToken(org.apache.ctakes.typesystem.type.syntax.BaseToken obj) throws Exception {
    if (obj instanceof WordToken) {
      WordToken wta = (WordToken) obj;
      return new WordTokenAdapter(wta);
    } else if (obj instanceof NumToken) {
      NumToken nta = (NumToken) obj;
      if (nta.getNumType() == TokenizerAnnotator.TOKEN_NUM_TYPE_INTEGER) {
        return new IntegerTokenAdapter(nta);
View Full Code Here

      {
        Iterator chkNE = namedE.iterator();
        Iterator newNE = wordTokenList.iterator();
        boolean neFound = false;
//       MedicationEventMention ne = null;
        WordToken we = null;
        Object mt = (ObjectmeasurementTokenItr.next();
        if (mt instanceof  StrengthUnitToken) {
          // StrengthUnitToken mt = (StrengthUnitToken) measurementTokenItr.next();
          int begSeg = ((StrengthUnitToken) mt).getStartOffset(), endSeg = ((StrengthUnitToken) mt).getEndOffset();
          StrengthUnitAnnotation ma = new StrengthUnitAnnotation(jcas, begSeg, endSeg);
View Full Code Here

  private org.apache.ctakes.core.fsm.token.BaseToken adaptToFSMBaseToken(BaseToken obj)
  throws Exception
  {
    if (obj instanceof WordToken)
    {
      WordToken wta = (WordToken) obj;
      return new WordTokenAdapter(wta);
    } else if (obj instanceof NumToken)
    {
      NumToken nta = (NumToken) obj;
      if (nta.getNumType() == TokenizerAnnotator.TOKEN_NUM_TYPE_INTEGER)
View Full Code Here

  return span;
}
  private void findFSMInRange(JCas jcas, int begin, int end) throws Exception {
    MedicationEventMention ne = null;
    WordToken we = null;
    // grab iterator over tokens within this chunk
    Iterator btaItr = FSUtil.getAnnotationsInSpanIterator(jcas,
        BaseToken.type, begin,
        end+1);
    // do the same as above for named entities
View Full Code Here

                  Iterator textSpanInSs = FSUtil.getAnnotationsIteratorInSpan(jcas, WordToken.type, ssAnnot.getSubSectionHeaderBegin(), ssAnnot.getSubSectionHeaderEnd());
                  String subSectionHeaderName = "";
                   
                  while (textSpanInSs.hasNext())
                  {
                      WordToken wta = (WordToken) textSpanInSs.next();
                      subSectionHeaderName = subSectionHeaderName + " " + wta.getCoveredText();
                  }
                  containedInSubSection = containedInSubSection+"|"+subSectionHeaderName+"|"+ssAnnot.getStatus();
                    }
                }
                gotMeds = true;
View Full Code Here

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

TOP

Related Classes of org.apache.ctakes.typesystem.type.syntax.WordToken

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.