Package org.apache.ctakes.core.fsm.token

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


   * 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

*/
@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

    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

    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

  @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

TOP

Related Classes of org.apache.ctakes.core.fsm.token.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.