Package org.apache.ctakes.core.fsm.state

Examples of org.apache.ctakes.core.fsm.state.NamedState


   *
   * @return
   */
  private Machine getYearlySuffixMachine() {
 
    State endState = new NamedState("END");
    State ntStartState = new NamedState("START");
    State skipFirstState = new IndentStartState("NON TERMINAL START");
    State ntEndState = new NonTerminalEndState("NON TERMINAL END");
    ntEndState.setEndStateFlag(true);
    endState.setEndStateFlag(true);
    skipFirstState.setEndStateFlag(true);
   
    Machine m = new Machine(ntStartState);
    State forwardSlashState = new NamedState("FSLASH");
 
   
 
    Condition suffixCondition = new TextSetCondition(iv_yearlySuffixSet,
        false);
    Condition forwardSlashCondition = new PunctuationValueCondition('/');
   
 
 
    ntStartState.addTransition(forwardSlashCondition, forwardSlashState);
    ntStartState.addTransition(new AnyCondition(), ntStartState);
 
   
    forwardSlashState.addTransition(suffixCondition, skipFirstState);
    forwardSlashState.addTransition(new AnyCondition(), ntStartState);
 
   
    skipFirstState.addTransition(new AnyCondition(), ntStartState);
    endState.addTransition(new AnyCondition(), ntStartState);
 
View Full Code Here


   *
   * @return
   */
  private Machine getMonthlySuffixMachine() {
 
    State endState = new NamedState("END");
    State ntStartState = new NamedState("START");
    State skipFirstState = new IndentStartState("NON TERMINAL START");
    State ntEndState = new NonTerminalEndState("NON TERMINAL END");
    ntEndState.setEndStateFlag(true);
    endState.setEndStateFlag(true);
    skipFirstState.setEndStateFlag(true);
   
    Machine m = new Machine(ntStartState);
    State forwardSlashState = new NamedState("FSLASH");
 
   
 
    Condition suffixCondition = new TextSetCondition(iv_monthlySuffixSet,
        false);
    Condition forwardSlashCondition = new PunctuationValueCondition('/');
   
 
 
    ntStartState.addTransition(forwardSlashCondition, forwardSlashState);
    ntStartState.addTransition(new AnyCondition(), ntStartState);
 
   
    forwardSlashState.addTransition(suffixCondition, skipFirstState);
    forwardSlashState.addTransition(new AnyCondition(), ntStartState);
 
   
    skipFirstState.addTransition(new AnyCondition(), ntStartState);
    endState.addTransition(new AnyCondition(), ntStartState);
 
View Full Code Here

   *
   * @return
   */
  private Machine getWeeklySuffixMachine() {
 
    State endState = new NamedState("END");
    State ntStartState = new NamedState("START");
    State skipFirstState = new IndentStartState("NON TERMINAL START");
    State ntEndState = new NonTerminalEndState("NON TERMINAL END");
    ntEndState.setEndStateFlag(true);
    endState.setEndStateFlag(true);
    skipFirstState.setEndStateFlag(true);
   
    Machine m = new Machine(ntStartState);
    State forwardSlashState = new NamedState("FSLASH");
 
   
 
    Condition suffixCondition = new TextSetCondition(iv_weeklySuffixSet,
        false);
    Condition forwardSlashCondition = new PunctuationValueCondition('/');
   
 
 
    ntStartState.addTransition(forwardSlashCondition, forwardSlashState);
    ntStartState.addTransition(new AnyCondition(), ntStartState);
 
   
    forwardSlashState.addTransition(suffixCondition, skipFirstState);
    forwardSlashState.addTransition(new AnyCondition(), ntStartState);
 
   
    skipFirstState.addTransition(new AnyCondition(), ntStartState);
    endState.addTransition(new AnyCondition(), ntStartState);
 
View Full Code Here

   *
   * @return
   */
  private Machine getDailySuffixMachine() {
 
    State endState = new NamedState("END");
    State ntStartState = new NamedState("START");
    State skipFirstState = new IndentStartState("NON TERMINAL START");
    State ntEndState = new NonTerminalEndState("NON TERMINAL END");
    ntEndState.setEndStateFlag(true);
    endState.setEndStateFlag(true);
    skipFirstState.setEndStateFlag(true);
   
    Machine m = new Machine(ntStartState);
    State forwardSlashState = new NamedState("FSLASH");
 
   
 
    Condition suffixCondition = new TextSetCondition(iv_dailySuffixSet,
        false);
    Condition forwardSlashCondition = new PunctuationValueCondition('/');
   
 
 
    ntStartState.addTransition(forwardSlashCondition, forwardSlashState);
    ntStartState.addTransition(new AnyCondition(), ntStartState);
 
   
    forwardSlashState.addTransition(suffixCondition, skipFirstState);
    forwardSlashState.addTransition(new AnyCondition(), ntStartState);
 
   
    skipFirstState.addTransition(new AnyCondition(), ntStartState);
    endState.addTransition(new AnyCondition(), ntStartState);
 
View Full Code Here

     *
     * @return
     */
    private Machine getHourlySuffixMachine() {
 
      State endState = new NamedState("END");
      State ntStartState = new NamedState("START");
      State skipFirstState = new IndentStartState("NON TERMINAL START");
      State ntEndState = new NonTerminalEndState("NON TERMINAL END");
      ntEndState.setEndStateFlag(true);
      endState.setEndStateFlag(true);
      skipFirstState.setEndStateFlag(true);
     
      Machine m = new Machine(ntStartState);
      State forwardSlashState = new NamedState("FSLASH");

     

      Condition suffixCondition = new TextSetCondition(iv_hourlySuffixSet,
          false);
      Condition forwardSlashCondition = new PunctuationValueCondition('/');
     

 
      ntStartState.addTransition(forwardSlashCondition, forwardSlashState);
      ntStartState.addTransition(new AnyCondition(), ntStartState);

     
      forwardSlashState.addTransition(suffixCondition, skipFirstState);
      forwardSlashState.addTransition(new AnyCondition(), ntStartState);

     
      skipFirstState.addTransition(new AnyCondition(), ntStartState);
      endState.addTransition(new AnyCondition(), ntStartState);
   
View Full Code Here

   * </ol>
   *
   * @return
   */
  private Machine getFiveTimesADayMachine() {
    State startState = new NamedState("START_5TDM");
    State endState = new NamedState("END_5TDM");
    State handleRangeState = new NamedState("HANDLERANGE");
    State hyphState = new NamedState("HYPHSTATE");
    State ntEndState = new NonTerminalEndState("NON TERMINAL END");
    ntEndState.setEndStateFlag(true);
    endState.setEndStateFlag(true);
 

    State fiveHourState = new NamedState("FIVEHOUR");

 
    Machine m = new Machine(startState);
 
    startState.addTransition(new TextSetCondition(
        iv_sixTimesPerDayWordSet, false) , endState);
    startState.addTransition(new DisjoinCondition(new NegateCondition(new IntegerRangeCondition(1,4)), new IntegerValueCondition(5)), handleRangeState);
    startState.addTransition(new IntegerValueCondition(5), fiveHourState);
    startState.addTransition(new TextValueCondition("five", false), fiveHourState);

    startState.addTransition(new AnyCondition(), startState);
   
    handleRangeState.addTransition(new PunctuationValueCondition('-'), hyphState);
    handleRangeState.addTransition(new AnyCondition(), startState);
   
    fiveHourState.addTransition(new TextSetCondition(iv_hourlySuffixSet, false), endState);
    fiveHourState.addTransition(new AnyCondition(), startState);
   
    hyphState.addTransition(new IntegerRangeCondition(5,10), fiveHourState);
    hyphState.addTransition(new AnyCondition(), startState);
   
    ntEndState.addTransition(new AnyCondition(), startState);
View Full Code Here

     * </ol>
     *
     * @return
     */
    private Machine getWeeklyMachine() {
      State startState = new NamedState("START");
      State endState = new NamedState("END");
      State ntEndState = new NonTerminalEndState("NON TERMINAL END");
      ntEndState.setEndStateFlag(true);
      endState.setEndStateFlag(true);
      State leftAbbreviateState = new NamedState("LEFT_FREQ");
     
      Machine m = new Machine(startState);
 
      State leftAbbreviateQState = new NamedState("LEFT_Q");

      State middleAbbreviateQtoWState = new NamedState("MID_Q2W");
 
 
      State rightAbbreviateQWKState = new NamedState("RIGHT_QWK");
 
   
      State firstDotQState = new NamedState("FIRSTDOTQ");

 
      State secondDotQtoWState = new NamedState("SECONDDOTQ2W");
 
 
      Condition firstDotConditionQ = new PunctuationValueCondition('.');
      Condition secondDotConditionQW = new PunctuationValueCondition('.');
      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);
        rightAbbreviateQWKState.addTransition(new AnyCondition(), startState);
    //  rightAbbreviateQWKState.addTransition(new AnyCondition(), startState);
View Full Code Here

   * </ol>
   *
   * @return
   */
  private Machine getThreeTimesADayMachine() {
    State startState = new NamedState("START");
    State endState = new NamedState("END");
    State ntEndState = new NonTerminalEndState("NON TERMINAL END");
    ntEndState.setEndStateFlag(true);
    endState.setEndStateFlag(true);

    Machine m = new Machine(startState);
    State hyphState = new NamedState("HYPHSTATE");
    State rangeState = new NamedState("RANGESTAGE");
    State handleRangeState = new NamedState("HANDLERANGE");
    State leftAbbreviateTState = new NamedState("LEFT_T");
    State middleAbbreviateTtoIState = new NamedState("MID_T2I");
    State rightAbbreviateTIDState = new NamedState("RIGHT_TID");
    State firstDotTState = new NamedState("FIRSTDOTT");
    State secondDotTtoIState = new NamedState("SECONDDOTT2I");
    State eightHourState = new NamedState("EIGHTHOUR");

    Condition firstDotConditionT = new PunctuationValueCondition('.');
    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);
View Full Code Here

   * </ol>
   *
   * @return
   */
  private Machine getTwiceADayMachine() {
    State startState = new NamedState("START");
    State endState = new NamedState("END");
    State ntEndState = new NonTerminalEndState("NON TERMINAL END");
    ntEndState.setEndStateFlag(true);
    endState.setEndStateFlag(true);

    Machine m = new Machine(startState);

    State twelveHourState = new NamedState("TWELVEHOUR");
    State leftAbbreviateBState = new NamedState("LEFT_B");
    State middleAbbreviateBtoIState = new NamedState("MID_B2I");
    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);
    rightAbbreviateBIDState.addTransition(new AnyCondition (), startState);
   
View Full Code Here

   * </ol>
   *
   * @return
   */
  private Machine getEveryOtherDayMachine() {
    State startState = new NamedState("START_EODM");
    State endState = new NamedState("END_EODM");
    State ntEndState = new NonTerminalEndState("NON TERMINAL END");
    ntEndState.setEndStateFlag(true);
    endState.setEndStateFlag(true);
 
    Machine m = new Machine(startState);
    State leftAbbreviateQState = new NamedState("LEFT_Q_EODM");
    State middleAbbreviateQtoAState = new NamedState("MID_Q2A_EODM");
    State rightAbbreviateQADState = new NamedState("RIGHT_QAD_EODM");
    State secondDotQtoAState = new NamedState("SECONDDOTQ2A_EODM");
    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);
   
    rightAbbreviateQADState.addTransition(new PunctuationValueCondition('.'), endState);
    rightAbbreviateQADState.addTransition(new AnyCondition(), startState);
   
   
View Full Code Here

TOP

Related Classes of org.apache.ctakes.core.fsm.state.NamedState

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.