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

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


  return span;
}
  private void findFSMInRange(JCas jcas, int begin, int end) throws Exception {
    MedicationMention 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


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

    if (jcas!=null) {
        token = new WordToken(jcas, beginFromStartOfDocument, endFromStartOfDocument);
        String tokenText = s.substring(begin, end);
        setCapitalization((WordToken)token, tokenText);
        setNumPosition((WordToken)token, tokenText);
    }
    else  {
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

      {
        Iterator chkNE = namedE.iterator();
        Iterator newNE = wordTokenList.iterator();
        boolean neFound = false;
      //  MedicationMention 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 {
    MedicationMention 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

    JFSIndexRepository indexes = jcas.getJFSIndexRepository();
    Iterator<?> annotItr = indexes.getAnnotationIndex(WordToken.type).iterator();
   
    while (annotItr.hasNext())
    {
      WordToken ann = (WordToken)annotItr.next();

      if(ann.getBegin() >= locationTerm.getBegin() && ann.getEnd() <= locationTerm.getEnd())
        list.add(ann);
    }

    return list;
  }
View Full Code Here

      Iterator<?> wordTokenItr = jcas.getJFSIndexRepository().getAnnotationIndex(
          WordToken.type).iterator();

      while (wordTokenItr.hasNext())
      {
        WordToken token = (WordToken) wordTokenItr.next();
        String tok = token.getCoveredText();

        if(tok == null) continue;
        tok = tok.toLowerCase().replaceAll("[\\W]", " ").trim();
        String[] toks = tok.split("\\s");
        for(int i=0; i<toks.length; i++)
View Full Code Here

     * classVal is "null" this null is assigned for class value and cause
     * error.
     */
    String classVal = Const.CLASS_UNKNOWN;
    while (tokenItr.hasNext()) {
      WordToken token = (WordToken) tokenItr.next();
      String strToken = token.getCoveredText();

      // System.out.println("***word:" + strToken);
      if (strToken == null)
        continue;
      if (!caseSensitive)
View Full Code Here

      BaseToken bta = (BaseToken) btaItr.next();
      String normForm = null;
      if (!(bta instanceof WordToken)) {
        normForm = bta.getCoveredText();
      } else {
        WordToken wta = (WordToken) bta;
        String canonicalForm = wta.getCanonicalForm();


        // The norm form is the canonical form, if there is one
        // Otherwise the norm form is the token's text.
        if ((canonicalForm != null&& (canonicalForm.length() > 0)) {
          normForm = canonicalForm;
        } else {
          normForm = wta.getCoveredText();
        }
      }
      bta.setNormalizedForm(normForm);
    }
  }
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.