Package org.apache.ctakes.core.fsm.condition

Examples of org.apache.ctakes.core.fsm.condition.TextValueCondition


    endState.setEndStateFlag(true);
   
    Machine m = new Machine(startState);
   
    startState.addTransition(new WordSetCondition(iv_singleChangeWordSet, false), endState);
    startState.addTransition(new TextValueCondition("followed", false), byState);
    startState.addTransition(
        new WordSetCondition(iv_changeWordSet, false), endState);
    startState.addTransition(new AnyCondition(), startState);
   
    byState.addTransition(new TextValueCondition("by", false), endState);
    byState.addTransition(new AnyCondition(), startState);
   
    endState.addTransition(new AnyCondition(), startState);
    return m;
  }
View Full Code Here


    sectionStatusState.addTransition(new AnyCondition(), startState);
 
    beginEndState.addTransition(soloEndCondition, endEndState);
    beginEndState.addTransition(new AnyCondition(), startState);
 
    endEndState.addTransition(new TextValueCondition("section", true),
        leftStatusState);
    endEndState.addTransition(new AnyCondition(), startState);
 
    leftStatusState.addTransition(soloCondition, endState);
    leftStatusState.addTransition(new AnyCondition(), startState);
View Full Code Here

    sectionStatusState.addTransition(new AnyCondition(), startState);

    beginEndState.addTransition(soloEndCondition, endEndState);
    beginEndState.addTransition(new AnyCondition(), startState);

    endEndState.addTransition(new TextValueCondition("section", true),
        leftStatusState);
    endEndState.addTransition(new AnyCondition(), startState);

    leftStatusState.addTransition(soloCondition, endState);
    leftStatusState.addTransition(new AnyCondition(), startState);
View Full Code Here

    Condition thirdDotConditionQPM = new PunctuationValueCondition('.');
    Condition thirdDotConditionBID = new PunctuationValueCondition('.');
    Condition thirdDotConditionPRN = new PunctuationValueCondition('.');
    Condition thirdDotConditionTID = new PunctuationValueCondition('.');

    startState.addTransition(new TextValueCondition("q", true),
        leftAbbreviateQState);
    startState.addTransition(new TextValueCondition("b", true),
        leftAbbreviateBState);
    startState.addTransition(new TextValueCondition("p", true),
        leftAbbreviatePState);
    startState.addTransition(new TextValueCondition("t", true),
        leftAbbreviateTState);
    startState.addTransition(new AnyCondition(), startState);

    leftAbbreviateQState.addTransition(firstDotConditionQ, firstDotQState);
    leftAbbreviateQState.addTransition(new AnyCondition(), startState);

    firstDotQState.addTransition(new TextValueCondition("a", true),
        middleAbbreviateQtoAState);
    firstDotQState.addTransition(new TextValueCondition("d", true),
        middleAbbreviateQtoDState);
    firstDotQState.addTransition(new TextValueCondition("h", true),
        middleAbbreviateQtoHState);
    firstDotQState.addTransition(new TextValueCondition("i", true),
        middleAbbreviateQtoIState);
    firstDotQState.addTransition(new TextValueCondition("m", true),
        middleAbbreviateQtoMState);
    firstDotQState.addTransition(new TextValueCondition("o", true),
        middleAbbreviateQtoOState);
    firstDotQState.addTransition(new TextValueCondition("w", true),
        middleAbbreviateQtoWState);
    firstDotQState.addTransition(new TextValueCondition("p", true),
        middleAbbreviateQtoPState);
    firstDotQState.addTransition(new AnyCondition(), startState);

    middleAbbreviateQtoAState.addTransition(secondDotConditionQA,
        secondDotQtoAState);
    middleAbbreviateQtoAState.addTransition(new AnyCondition(), startState);

    middleAbbreviateQtoDState.addTransition(secondDotConditionQD,
        secondDotQtoDState);
    middleAbbreviateQtoDState.addTransition(new AnyCondition(), startState);

    middleAbbreviateQtoHState.addTransition(secondDotConditionQH,
        secondDotQtoHState);
    middleAbbreviateQtoHState.addTransition(new AnyCondition(), startState);

    middleAbbreviateQtoIState.addTransition(secondDotConditionQI,
        secondDotQtoIState);
    middleAbbreviateQtoIState.addTransition(new AnyCondition(), startState);

    middleAbbreviateQtoMState.addTransition(secondDotConditionQM,
        secondDotQtoMState);
    middleAbbreviateQtoMState.addTransition(new AnyCondition(), startState);

    middleAbbreviateQtoOState.addTransition(secondDotConditionQO,
        secondDotQtoOState);
    middleAbbreviateQtoOState.addTransition(new AnyCondition(), startState);

    middleAbbreviateQtoWState.addTransition(secondDotConditionQW,
        secondDotQtoWState);
    middleAbbreviateQtoWState.addTransition(new AnyCondition(), startState);

    middleAbbreviateQtoPState.addTransition(secondDotConditionQP,
        secondDotQtoPState);
    middleAbbreviateQtoPState.addTransition(new AnyCondition(), startState);

    secondDotQtoAState.addTransition(new TextValueCondition("d", true),
        rightAbbreviateQADState);
    secondDotQtoAState.addTransition(new AnyCondition(), startState);

    secondDotQtoDState.addTransition(new TextValueCondition("s", true),
        rightAbbreviateQDSState);
    secondDotQtoDState.addTransition(new AnyCondition(), startState);

    secondDotQtoHState.addTransition(new TextValueCondition("s", true),
        rightAbbreviateQHSState);
    secondDotQtoHState.addTransition(new AnyCondition(), startState);

    secondDotQtoIState.addTransition(new TextValueCondition("d", true),
        rightAbbreviateQIDState);
    secondDotQtoIState.addTransition(new AnyCondition(), startState);

    secondDotQtoMState.addTransition(new TextValueCondition("t", true),
        rightAbbreviateQMTState);
    secondDotQtoMState.addTransition(new AnyCondition(), startState);

    secondDotQtoOState.addTransition(new TextValueCondition("d", true),
        rightAbbreviateQODState);
    secondDotQtoOState.addTransition(new AnyCondition(), startState);

    secondDotQtoWState.addTransition(new TextValueCondition("k", true),
        rightAbbreviateQWKState);
    secondDotQtoWState.addTransition(new AnyCondition(), startState);

    secondDotQtoAState.addTransition(new TextValueCondition("m", true),
        rightAbbreviateQAMState);
    secondDotQtoAState.addTransition(new AnyCondition(), startState);

    secondDotQtoPState.addTransition(new TextValueCondition("m", true),
        rightAbbreviateQPMState);
    secondDotQtoPState.addTransition(new AnyCondition(), startState);

    secondDotBtoIState.addTransition(new TextValueCondition("d", true),
        endState);
    secondDotBtoIState.addTransition(new AnyCondition(), startState);

    rightAbbreviateQADState.addTransition(thirdDotConditionQAD, endState);
    rightAbbreviateQADState.addTransition(new AnyCondition(), startState);

    rightAbbreviateQDSState.addTransition(thirdDotConditionQDS, endState);
    rightAbbreviateQDSState.addTransition(new AnyCondition(), startState);

    rightAbbreviateQHSState.addTransition(thirdDotConditionQHS, endState);
    rightAbbreviateQHSState.addTransition(new AnyCondition(), startState);

    rightAbbreviateQIDState.addTransition(thirdDotConditionQID, endState);
    rightAbbreviateQIDState.addTransition(new AnyCondition(), startState);

    rightAbbreviateQMTState.addTransition(thirdDotConditionQMT, endState);
    rightAbbreviateQMTState.addTransition(new AnyCondition(), startState);

    rightAbbreviateQODState.addTransition(thirdDotConditionQOD, endState);
    rightAbbreviateQODState.addTransition(new AnyCondition(), startState);

    rightAbbreviateQWKState.addTransition(thirdDotConditionQWK, endState);
    rightAbbreviateQWKState.addTransition(new AnyCondition(), startState);

    rightAbbreviateQAMState.addTransition(thirdDotConditionQAM, endState);
    rightAbbreviateQAMState.addTransition(new AnyCondition(), startState);

    rightAbbreviateQPMState.addTransition(thirdDotConditionQPM, endState);
    rightAbbreviateQPMState.addTransition(new AnyCondition(), startState);

    leftAbbreviateBState.addTransition(firstDotConditionB, firstDotBState);
    leftAbbreviateBState.addTransition(new AnyCondition(), startState);

    firstDotBState.addTransition(new TextValueCondition("i", true),
        middleAbbreviateBtoIState);
    firstDotBState.addTransition(new AnyCondition(), startState);

    middleAbbreviateBtoIState.addTransition(secondDotConditionBI,
        secondDotBtoIState);
    middleAbbreviateBtoIState.addTransition(new AnyCondition(), startState);

    secondDotBtoIState.addTransition(new TextValueCondition("d", true),
        rightAbbreviateBIDState);
    secondDotBtoIState.addTransition(new AnyCondition(), startState);

    rightAbbreviateBIDState.addTransition(thirdDotConditionBID, endState);

    leftAbbreviatePState.addTransition(firstDotConditionP, firstDotPState);
    leftAbbreviatePState.addTransition(new AnyCondition(), startState);

    leftAbbreviateTState.addTransition(firstDotConditionT, firstDotTState);
    leftAbbreviateTState.addTransition(new AnyCondition(), startState);

    firstDotPState.addTransition(new TextValueCondition("r", true),
        middleAbbreviatePtoRState);
    firstDotPState.addTransition(new AnyCondition(), startState);

    firstDotTState.addTransition(new TextValueCondition("i", true),
        middleAbbreviateTtoIState);
    firstDotTState.addTransition(new AnyCondition(), startState);

    middleAbbreviatePtoRState.addTransition(secondDotConditionPR,
        secondDotPtoRState);
    middleAbbreviatePtoRState.addTransition(new AnyCondition(), startState);

    middleAbbreviateTtoIState.addTransition(secondDotConditionTI,
        secondDotTtoIState);
    middleAbbreviateTtoIState.addTransition(new AnyCondition(), startState);

    secondDotPtoRState.addTransition(new TextValueCondition("n", true),
        rightAbbreviatePRNState);
    secondDotPtoRState.addTransition(new AnyCondition(), startState);

    secondDotTtoIState.addTransition(new TextValueCondition("d", true),
        rightAbbreviateTIDState);
    secondDotTtoIState.addTransition(new AnyCondition(), startState);

    rightAbbreviatePRNState.addTransition(thirdDotConditionPRN, endState);
    rightAbbreviateTIDState.addTransition(thirdDotConditionTID, endState);
View Full Code Here

    Condition firstHSDotCondition = new PunctuationValueCondition('.');
    Condition secondHSDotCondition = new PunctuationValueCondition('.');

    Condition soloCondition = new WordSetCondition(iv_singleWordSet, true);

    startState.addTransition(new TextValueCondition("q", true),
        leftAbbreviateQState);
    startState.addTransition(new TextValueCondition("a", true),
        leftAbbreviateAState);
    startState.addTransition(new TextValueCondition("o", true),
        leftAbbreviateOState);
    startState.addTransition(new TextValueCondition("h", true),
        leftAbbreviateHState);
    startState.addTransition(new TextValueCondition("p", true),
        leftAbbreviatePState);
    startState.addTransition(new AnyCondition(), startState);

    leftAbbreviateQState.addTransition(firstQDDotCondition, firstDotQState);

    leftAbbreviateQState.addTransition(new AnyCondition(), startState);

    leftAbbreviateAState.addTransition(firstAMDotCondition, firstDotAState);
    leftAbbreviateAState.addTransition(new AnyCondition(), startState);

    leftAbbreviateOState.addTransition(firstODDotCondition, firstDotOState);
    leftAbbreviateOState.addTransition(new AnyCondition(), startState);

    leftAbbreviateHState.addTransition(firstHSDotCondition, firstDotHState);
    leftAbbreviateHState.addTransition(new AnyCondition(), startState);

    leftAbbreviatePState.addTransition(firstPMDotCondition, firstDotPState);
    leftAbbreviatePState.addTransition(new AnyCondition(), startState);

    firstDotQState.addTransition(soloCondition, endState);
    firstDotQState.addTransition(new TextValueCondition("d", true),
        rightAbbreviateQDState);
    firstDotQState.addTransition(new TextValueCondition("h", true),
        rightAbbreviateQHState);
    firstDotQState.addTransition(new AnyCondition(), startState);

    firstDotAState.addTransition(new TextValueCondition("m", true),
        rightAbbreviateAMState);
    firstDotAState.addTransition(new AnyCondition(), startState);

    firstDotOState.addTransition(new TextValueCondition("d", true),
        rightAbbreviateODState);
    firstDotOState.addTransition(new AnyCondition(), startState);

    firstDotHState.addTransition(new TextValueCondition("s", true),
        rightAbbreviateHSState);
    firstDotHState.addTransition(new AnyCondition(), startState);

    firstDotPState.addTransition(new TextValueCondition("m", true),
        rightAbbreviatePMState);
    firstDotPState.addTransition(new AnyCondition(), startState);

    rightAbbreviateQHState.addTransition(secondQHDotCondition, endState);
    rightAbbreviateQHState.addTransition(new AnyCondition(), startState);
View Full Code Here

    Condition containsSoloTermCondition = new ContainsSetTextValueCondition(
        iv_singleWordSet, true);

    startState.addTransition(numericStartCondition, leftAbbreviateState);
    startState.addTransition(firstTextCondition, leftAbbreviateState);
    startState.addTransition(new TextValueCondition("a", true),
        leftAbbreviateState);
    startState.addTransition(integerCondition, leftAbbreviateState);
    startState.addTransition(hyphenatedCondition, endState);
    startState.addTransition(containsSoloTermCondition, endState);
    startState.addTransition(soloCondition, endState);
View Full Code Here

      Condition thirdDotConditionQWK = new PunctuationValueCondition('.');

      Condition soloCondition = new TextSetCondition(iv_perWeekWordSet, false);
 
 
      startState.addTransition(new TextValueCondition("q", false),
          leftAbbreviateQState);
      startState.addTransition(new TextValueCondition("a", false),
          leftAbbreviateState);
      startState.addTransition(new TextValueCondition("at", false),
          leftAbbreviateState);
      startState.addTransition(new TextValueCondition("per", false),
          leftAbbreviateState);
 
      startState.addTransition(soloCondition, endState);
      startState.addTransition(new AnyCondition(), startState);
 
      leftAbbreviateQState.addTransition(firstDotConditionQ, firstDotQState);
      leftAbbreviateQState.addTransition(new AnyCondition(), startState);
 
     
      leftAbbreviateState.addTransition(new ContainsSetTextValueCondition(
          iv_perWeekWordSet, false), endState);
      leftAbbreviateState.addTransition(new AnyCondition(), startState);
 
      firstDotQState.addTransition(new TextValueCondition("w", false),
          middleAbbreviateQtoWState);

      firstDotQState.addTransition(new AnyCondition(), startState);
 
 
 
      middleAbbreviateQtoWState.addTransition(secondDotConditionQW,
          secondDotQtoWState);
      middleAbbreviateQtoWState.addTransition(new AnyCondition(), startState);
 
   
      secondDotQtoWState.addTransition(new TextValueCondition("k", false),
          rightAbbreviateQWKState);
      secondDotQtoWState.addTransition(new AnyCondition(), startState);
 
   
      rightAbbreviateQWKState.addTransition(thirdDotConditionQWK, endState);
View Full Code Here

    Condition secondDotConditionTI = new PunctuationValueCondition('.');
    Condition thirdDotConditionTID = new PunctuationValueCondition('.');
   
    Condition TTDCondition = new TextSetCondition(iv_threeTimesADayWordSet, false);
 
    startState.addTransition(new TextValueCondition("t", false),
        leftAbbreviateTState);
    startState.addTransition(new TextValueCondition("q", false),
        eightHourState);
    startState.addTransition(new IntegerValueCondition(8), eightHourState);
    startState.addTransition(TTDCondition, endState);
    startState.addTransition(new DisjoinCondition(new CombineCondition(new NegateCondition(new IntegerRangeCondition(1,7)), new IntegerCondition()), new IntegerValueCondition(8)), handleRangeState);
    startState.addTransition(new DisjoinCondition(new TextSetCondition(iv_postEightWordSet, false), new TextValueCondition("eight", false)), eightHourState);
 
    startState.addTransition(new AnyCondition(), startState);

    handleRangeState.addTransition(new PunctuationValueCondition('-'), hyphState);
    handleRangeState.addTransition(new AnyCondition(), startState);
   
    eightHourState.addTransition(new PunctuationValueCondition('-'), hyphState);
    eightHourState.addTransition(new TextValueCondition("to", false), hyphState);
    eightHourState.addTransition(new TextSetCondition(iv_hourlySuffixSet, false), endState);
    eightHourState.addTransition(new AnyCondition(), startState);

    leftAbbreviateTState.addTransition(firstDotConditionT, firstDotTState);
    leftAbbreviateTState.addTransition(new AnyCondition(), startState);

    hyphState.addTransition(new IntegerRangeCondition(9,10), rangeState);
    hyphState.addTransition(new TextValueCondition("ten", false), rangeState);
    hyphState.addTransition(new TextValueCondition("nine", false), rangeState);
    hyphState.addTransition(new AnyCondition(), startState);

    firstDotTState.addTransition(new TextValueCondition("i", false),
        middleAbbreviateTtoIState);
    firstDotTState.addTransition(new AnyCondition(), startState);

    rangeState.addTransition(new TextSetCondition(iv_hourlySuffixSet, false), endState);
    rangeState.addTransition(new AnyCondition(), startState);

    middleAbbreviateTtoIState.addTransition(secondDotConditionTI,
        secondDotTtoIState);
    middleAbbreviateTtoIState.addTransition(new AnyCondition(), startState);


    secondDotTtoIState.addTransition(new TextValueCondition("d", false),
        rightAbbreviateTIDState);
    secondDotTtoIState.addTransition(new AnyCondition(), startState);


    rightAbbreviateTIDState.addTransition(thirdDotConditionTID, endState);
View Full Code Here

    State rightAbbreviateBIDState = new NamedState("RIGHT_BID");
    State firstDotBState = new NamedState("FIRSTDOTB");
    State secondDotBtoIState = new NamedState("SECONDDOTB2I");
    Condition TDCondition = new TextSetCondition(iv_twiceADayWordSet, false);
   
    startState.addTransition(new TextValueCondition("b", false),
        leftAbbreviateBState);
    startState.addTransition(new TextValueCondition("q", false), twelveHourState);
    startState.addTransition(new IntegerValueCondition(12), twelveHourState);
    startState.addTransition(new TextValueCondition("twelve", false), twelveHourState);
    startState.addTransition(TDCondition, endState);
    startState.addTransition(new AnyCondition(), startState);

        twelveHourState.addTransition(new TextSetCondition(iv_hourlySuffixSet, false), endState);
        twelveHourState.addTransition(new TextSetCondition(iv_twiceADayWordSet, false), endState);
       // twelveHourState.addTransition(new RangeStrengthCondition(), endState);
        twelveHourState.addTransition(new AnyCondition(), startState);
       
    leftAbbreviateBState.addTransition(new PunctuationValueCondition('.'), firstDotBState);
    leftAbbreviateBState.addTransition(new AnyCondition(), startState);

    firstDotBState.addTransition(new TextValueCondition("i", false),
        middleAbbreviateBtoIState);
    firstDotBState.addTransition(new AnyCondition(), startState);

    middleAbbreviateBtoIState.addTransition(new PunctuationValueCondition('.'),
        secondDotBtoIState);
    middleAbbreviateBtoIState.addTransition(new AnyCondition(), startState);
   
    secondDotBtoIState.addTransition(new TextValueCondition("d", false),
        rightAbbreviateBIDState);
    secondDotBtoIState.addTransition(new AnyCondition(), startState);


    rightAbbreviateBIDState.addTransition(new PunctuationValueCondition('.'), endState);
View Full Code Here

    State firstDotQState = new NamedState("FIRSTDOTQ_EODM");
    State EODState = new NamedState("FIRSTDOTQ_EODM");
   
    Condition EODCondition = new TextSetCondition(iv_everyOtherDayWordSet, false);
   
    startState.addTransition(new TextValueCondition("q", false),
        leftAbbreviateQState);
    startState.addTransition(EODCondition, endState);
    startState.addTransition(new TextValueCondition("every-other", false), EODState);
    startState.addTransition(new AnyCondition(), startState);
   
    leftAbbreviateQState.addTransition(new PunctuationValueCondition('.'),
        firstDotQState);
  //leftAbbreviateQState.addTransition(new RangeStrengthCondition(), endState);
    leftAbbreviateQState.addTransition(new AnyCondition(), startState);
   
    firstDotQState.addTransition(new TextValueCondition("a", false),
        middleAbbreviateQtoAState);
    firstDotQState.addTransition(new AnyCondition(), startState);
   
    middleAbbreviateQtoAState.addTransition(new PunctuationValueCondition('.'),
        secondDotQtoAState);
    middleAbbreviateQtoAState.addTransition(new AnyCondition(), startState);
   
    secondDotQtoAState.addTransition(new TextValueCondition("d", false),
        rightAbbreviateQADState);
    secondDotQtoAState.addTransition(new AnyCondition(), startState);
   
    EODState.addTransition(new TextSetCondition(iv_dailyWordSet, false), endState);
    EODState.addTransition(new AnyCondition(), startState);
View Full Code Here

TOP

Related Classes of org.apache.ctakes.core.fsm.condition.TextValueCondition

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.