Examples of WordToken


Examples of edu.mayo.bmi.uima.core.type.syntax.WordToken

          sent.setSentenceNumber(sentNum);
        }
        sentNum++;
        sent.addToIndexes();
        for (int j=0; j < tokenArrays[i].length; j++) {
          WordToken tok = new WordToken(jcas);
          LineAndTokenPosition word = new LineAndTokenPosition();
          word.setLine(i+1);
          word.setTokenOffset(j);
          LineTokenToCharacterOffsetConverter.BeginAndEndCharacterOffsetPair tPos = converter.convert(word);
          if (tPos == null) {
            tok.setBegin(0);
            tok.setEnd(1);
          } else {
            tok.setBegin(tPos.getBegin());
            tok.setEnd(tPos.getEnd() + 1);
          }
          tok.setTokenNumber(tokNum);
          tokNum++; 
          tok.addToIndexes();
        }
      }
      for (Annotation a : assertions) {
        Concept assertion = new Concept(jcas);
        LineAndTokenPosition assertionStart = new LineAndTokenPosition();
View Full Code Here

Examples of edu.stanford.nlp.ie.machinereading.domains.ace.reader.RobustTokenizer.WordToken

    // and group the tokens into sentences
    ArrayList<AceToken> currentSentence = new ArrayList<AceToken>();
    int quoteCount = 0;
    for (int i = 0; i < tokenList.size(); i ++){
      WordToken token = tokenList.get(i);
      String tokenText = token.getWord();
      AceToken convertedToken = wordTokenToAceToken(token, sentences.size());

      // start a new sentence if we skipped 2+ lines (after datelines, etc.)
      // or we hit some SGML
      // if (token.getNewLineCount() > 1 || AceToken.isSgml(tokenText)) {
View Full Code Here

Examples of it.halfone.parser.token.WordToken

        switch (symbolList.get(i).getType()) {
        case ANY:
          tokens[i] = new AnyToken();
          break;
        case WORD:
          tokens[i] = new WordToken(true);
          break;
        case NONWORD:
          tokens[i] = new WordToken(false);
          break;
        case DIGIT:
          tokens[i] = new DigitToken(true);
          break;
        case NONDIGIT:
View Full Code Here

Examples of org.apache.ctakes.core.fsm.token.WordToken

   * Called to check if the conditional meets the criteria defined by this
   * state.
   */
  public boolean satisfiedBy(Object conditional) {
    if (conditional instanceof WordToken) {
      WordToken t = (WordToken) conditional;
      String text = t.getText();
      if (!iv_isCaseSensitive) {
        text = text.toLowerCase();
      }
      if (iv_wordSet.contains(text)) {
        return true;
View Full Code Here

Examples of org.apache.ctakes.core.fsm.token.WordToken

   * Called to check if the conditional meets the criteria defined by this
   * state.
   */
  public boolean satisfiedBy(Object conditional) {
    if (conditional instanceof WordToken) {
      WordToken t = (WordToken) conditional;
      if (isEqual(t.getText(), iv_word)) {
        return true;
      }
    }

    return false;
View Full Code Here

Examples of org.apache.ctakes.core.fsm.token.WordToken

*/
@SuppressWarnings("serial")
public class DayNightWordCondition extends Condition {
  public boolean satisfiedBy(Object conditional) {
    if (conditional instanceof WordToken) {
      WordToken wt = (WordToken) conditional;
      String text = wt.getText();
      if (text.length() == 3) {
        text = text.toUpperCase();
        if ((text.charAt(2) == 'M') && (text.charAt(1) == '.')
            && ((text.charAt(0) == 'A') || (text.charAt(0) == 'P'))) {
          return true;
View Full Code Here

Examples of org.apache.ctakes.core.fsm.token.WordToken

    iv_maxHour = maxHour;
  }

  public boolean satisfiedBy(Object conditional) {
    if (conditional instanceof WordToken) {
      WordToken wt = (WordToken) conditional;
      String text = wt.getText();
      if (wt.getNumPosition() == WordToken.NUM_FIRST) {
        int colonIndex = text.indexOf(':');
        if (colonIndex != -1) {
          String hourStr = text.substring(0, colonIndex);
          String minuteStr = text.substring(colonIndex + 1, text
              .length());
View Full Code Here

Examples of org.apache.ctakes.core.fsm.token.WordToken

    for (int i = 0; i < tokens.size(); i++) {
      Token t = (Token) tokens.get(i);
      switch (t.getType()) {
      case Token.TYPE_WORD:
        WordToken wt = new WordTokenAdapter(t);
        baseTokens.add(wt);
        break;
      case Token.TYPE_PUNCT:
        PunctuationToken pt = new PunctuationTokenAdapter(t);
        baseTokens.add(pt);
View Full Code Here

Examples of org.apache.ctakes.core.fsm.token.WordToken

  @SuppressWarnings("serial")
  class RomanNumeralCondition extends Condition {
    public boolean satisfiedBy(Object conditional) {
      if (conditional instanceof WordToken) {
        WordToken wt = (WordToken) conditional;
        return isRomanNumeral(wt.getText());
      }

      return false;
    }
View Full Code Here

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

              "true");
        }

        if (bta instanceof WordToken)
        {
          WordToken wta = (WordToken) bta;
          String canonicalForm = wta.getCanonicalForm();
          if (canonicalForm != null)
          {
            lt.addStringAttribute(CANONICAL_VARIANT_ATTR, canonicalForm);
          }
        }
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.