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

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


     *
     * @return
     */
    private Machine getColonDxMachine()
    {
        State startState = new NamedState("START");
        State endState = new NamedState("END");

        endState.setEndStateFlag(true);

        Machine m = new Machine(startState);

        Condition colonDxC = new TextSetCondition(
                iv_colonDxSet,
                false);

        startState.addTransition(colonDxC, endState);
        startState.addTransition(new AnyCondition(), startState);


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

        return m;
    }
View Full Code Here


     *
     * @return
     */
    private Machine getPADDxMachine()
    {
        State startState = new NamedState("START");
        State endState = new NamedState("END");
        State padHyphenBeginState = new NamedState("HYPHENB");
        State padHyphenEndState = new NamedState("HYPHENE");
        State pad2of2NegConfirmState = new NamedState("TWOOFTWONEG");
        State pad2of2State = new NamedState("TWOOFTWO");
        State pad2of3State = new NamedState("TWOOFTHREE");
        State pad3of3State = new NamedState("THREEOFTHREE");
       
        endState.setEndStateFlag(true);

        Machine m = new Machine(startState);

        Condition padDxC = new TextSetCondition(iv_padDxSet, false);
        Condition padDxHyphenBeginC = new TextSetCondition(iv_padDxHyphenBeginSet, false);
        Condition padDxHyphenEndC = new TextSetCondition(iv_padDxHyphenEndSet, false);
        Condition pad1of2DxC = new TextSetCondition(iv_padOneOfTwoDxSet, false);
        Condition pad2of2DxC = new TextSetCondition(iv_padTwoOfTwoDxSet, false);
        Condition pad1of3DxC = new TextSetCondition(iv_padOneOfThreeDxSet, false);
        Condition pad2of3DxC = new TextSetCondition(iv_padTwoOfThreeDxSet, false);
        Condition pad3of3DxC = new TextSetCondition(iv_padThreeOfThreeDxSet, false);

        Condition padNegConfirm1Of2DxC = new TextSetCondition(iv_padOneOfTwoNegConfirmDxSet, false);
        Condition padNegConfirm2Of2DxC = new TextSetCondition(iv_padTwoOfTwoNegConfirmDxSet, false);
       
        startState.addTransition(padDxC, endState);
        startState.addTransition(padNegConfirm1Of2DxC, pad2of2NegConfirmState);
        startState.addTransition(pad1of2DxC, pad2of2State);
        startState.addTransition(pad1of3DxC, pad2of3State);
        startState.addTransition(padDxHyphenBeginC, padHyphenBeginState);
        startState.addTransition(new AnyCondition(), startState);

        pad2of2NegConfirmState.addTransition(padNegConfirm2Of2DxC, endState);
        pad2of2NegConfirmState.addTransition(new AnyCondition(), startState);
       
        pad2of2State.addTransition(pad2of2DxC, endState);
        pad2of2State.addTransition(new AnyCondition(), startState);
       
        pad2of3State.addTransition(pad2of3DxC, pad3of3State);
        pad2of3State.addTransition(new AnyCondition(), startState);
       
        pad3of3State.addTransition(pad3of3DxC, endState);
        pad3of3State.addTransition(new AnyCondition(), startState);
       
        padHyphenBeginState.addTransition(new PunctuationValueCondition('-'), padHyphenEndState);
        padHyphenBeginState.addTransition(new AnyCondition(), startState);
       
        padHyphenEndState.addTransition(padDxHyphenEndC, endState);
View Full Code Here

    }

    private Machine getInitialNegIndicatorMachine()
    {
        State startState = new NamedState("START");
        State endState = new NamedState("END");
        State twoPartState = new NamedState("TWOSTATE");
        State twoOfThreePartState = new NamedState("TWOOFTHREESTATE");
        State threePartState = new NamedState("THREESTATE");
        State twoArterialPartState = new NamedState("TWOSTATEART");
        State threeArterialPartState = new NamedState("THREESTATEART");
        State ntEndState = new NonTerminalEndState("NON TERMINAL END");
        endState.setEndStateFlag(true);
        ntEndState.setEndStateFlag(true);

        Machine m = new Machine(startState);

        Condition negInitDetC = new TextSetCondition(iv_negInitialDeterminersSet, false);
        Condition negInit1of2DetC = new TextSetCondition(iv_negCol1of2PartSet, false);
        Condition negInit2of2DetC = new TextSetCondition(iv_negCol2of2PartSet, false);
        Condition negInit1of3DetC = new TextSetCondition(iv_negCol1Of3PartSet, false);
        Condition negInit2of3DetC = new TextSetCondition(iv_negCol2Of3PartSet, false);
        Condition negInit3of3DetC = new TextSetCondition(iv_negCol3Of3PartSet, false);
        Condition negInit1of3ArterialDetC = new TextSetCondition(iv_negCol1Of3ArterialPartSet, false);
        Condition negInit2of3ArterialDetC = new TextSetCondition(iv_negCol2Of3ArterialPartSet, false);
        Condition negInit3of3ArterialDetC = new TextSetCondition(iv_negCol3Of3ArterialPartSet, false);
        Condition negInitNtEndDetC = new TextSetCondition(iv_negColAnyOf3PartSet, false);
       
        startState.addTransition(negInitDetC, endState); // start with a modal
        startState.addTransition(negInit1of2DetC, twoPartState);
        startState.addTransition(negInit1of3DetC, twoOfThreePartState);
        startState.addTransition(negInit1of3ArterialDetC, twoArterialPartState);
        startState.addTransition(negInitNtEndDetC, ntEndState);
        startState.addTransition(new AnyCondition(), startState);

        twoPartState.addTransition(negInit2of2DetC, endState);
        twoPartState.addTransition(new AnyCondition(), startState);
       
        twoOfThreePartState.addTransition(negInit2of3DetC, threePartState);
        twoOfThreePartState.addTransition(new AnyCondition(), startState);
       
        twoArterialPartState.addTransition(negInit2of3ArterialDetC, threeArterialPartState);
        twoArterialPartState.addTransition(new AnyCondition(), startState);

        threePartState.addTransition(negInit3of3DetC, endState);
        threePartState.addTransition(new AnyCondition(), startState);
       
        threeArterialPartState.addTransition(negInit3of3ArterialDetC, endState);
        threeArterialPartState.addTransition(new AnyCondition(), startState);
       
        ntEndState.addTransition(negInitNtEndDetC, ntEndState);
        ntEndState.addTransition(new AnyCondition(), endState);
       
        endState.addTransition(new AnyCondition(), startState);
View Full Code Here

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

        Machine m = new Machine(startState);
        State zeroNumState = new NamedState("ZERO_NUM");
        State fractionTextState = new NamedState("NUMERATOR_TEXT");
        State dashState = new NamedState("DASH");
        startState.addTransition(new IntegerValueCondition(0), zeroNumState);
        startState.addTransition(new AnyCondition(), startState);

        zeroNumState.addTransition(new PunctuationValueCondition('.'), fractionTextState);
    zeroNumState.addTransition(new AnyCondition(), startState);

    fractionTextState.addTransition(new NumberCondition(), dashState);
    fractionTextState.addTransition(new AnyCondition(), startState);
   
    dashState.addTransition(new PunctuationValueCondition('-'), endState);
    dashState.addTransition(new AnyCondition(), startState);
   
        endState.addTransition(new AnyCondition(), startState);

        return m;
    }
View Full Code Here

   * </ol>
   *
   * @return
   */
  private Machine getMaximumStatusMachine() {
    State startState = new NamedState("START1");
    State endState = new NamedState("END1");
    State foundDualFirstState = new NamedState("MAXBEGIN");
    endState.setEndStateFlag(true);
   
    Machine m = new Machine(startState);
   
    startState.addTransition(new WordSetCondition(iv_singleMaxWordSet, false), endState);
    startState.addTransition(new WordSetCondition(iv_firstMaxDualWordSet, false), foundDualFirstState);
    startState.addTransition(new AnyCondition(), startState);
   
    foundDualFirstState.addTransition(new WordSetCondition(iv_secondMaxDualWordSet, false), endState);
    foundDualFirstState.addTransition(new AnyCondition(), startState);
   
    endState.addTransition(new AnyCondition(), startState);
    return m;
  }
View Full Code Here

   * </ol>
   *
   * @return
   */
  private Machine getChangeStatusMachine() {
    State startState = new NamedState("START2");
    State endState = new NamedState("END2");
    State byState = new NamedState("BYSTATE");
    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

   * </ol>
   *
   * @return
   */
  private Machine getSumStatusMachine() {
    State startState = new NamedState("START3");
    State endState = new NamedState("END3");
    endState.setEndStateFlag(true);
 
    Machine m = new Machine(startState);
 
    startState.addTransition(new WordSetCondition(iv_singleSumWordSet, false), endState);
    startState.addTransition(new AnyCondition(), startState);
   
    endState.addTransition(new AnyCondition(), startState);
 
    return m;
  }
View Full Code Here

   * </ol>
   *
   * @return
   */
  private Machine getStartStatusMachine() {
    State startState = new NamedState("START4");
    State endState = new NamedState("END4");
    endState.setEndStateFlag(true);
 
    Machine m = new Machine(startState);
 
    State leftStatusState = new NamedState("LEFT_START_STATUS");
    State leftDosagesState = new NamedState("LEFT_START_DOSE");
    State lastTextState = new NamedState("RIGHT_START_FREQ");
    State middleATextState = new NamedState("MID_START_TEXT");
    State firstDashState = new NamedState("FIRSTDASHSTART");
    State beginEndState = new NamedState("STOPBEGINSTART");
    State endEndState = new NamedState("STARTENDSTART");
    State sectionStatusState = new NamedState("DUALSTARTSTART");
    State thenStatusState = new NamedState("DUALSTARTTHENSTART");
   
    Condition rangeCombineCondition = new DisjoinCondition(
        new RangeCondition(), new RangeStrengthCondition());
 
    Condition sectionBracket = new PunctuationValueCondition('[');
    Condition soloCondition = new WordSetCondition(iv_singleStartWordSet,
        false);
    Condition soloEndCondition = new WordSetCondition(
        iv_singleStartWordSet, false);
    Condition firstDualCondition = new WordSetCondition(
        iv_firstStartDualWordSet, false);
    Condition secondDualCondition = new WordSetCondition(
        iv_secondDualWordSet, false);
    Condition thenCondition = new WordSetCondition(
        iv_multiThenWordSet, false);
    Condition containsDosagesCondition = new StrengthCondition();
 
    startState.addTransition(thenCondition, thenStatusState);
    startState.addTransition(firstDualCondition, sectionStatusState);
    startState.addTransition(sectionBracket, beginEndState);
    startState.addTransition(rangeCombineCondition, leftDosagesState);
    startState.addTransition(containsDosagesCondition, leftStatusState);
    startState.addTransition(soloCondition, endState);
    startState.addTransition(new AnyCondition(), startState);

    thenStatusState.addTransition(firstDualCondition, sectionStatusState);
    thenStatusState.addTransition(soloCondition, endState);
    thenStatusState.addTransition(new AnyCondition(), startState);
   
    sectionStatusState.addTransition(secondDualCondition, endState);
    sectionStatusState.addTransition(new AnyCondition(), startState);
 
    beginEndState.addTransition(soloEndCondition, endEndState);
View Full Code Here

   * </ol>
   *
   * @return
   */
  private Machine getNoChangeStatusMachine() {
    State startState = new NamedState("START5");
    State endState = new NamedState("END5");
    endState.setEndStateFlag(true);
 
    Machine m = new Machine(startState);
 
    State leftStatusState = new NamedState("LEFT_STATUS_NOCHANGE");
    State leftDosagesState = new NamedState("LEFT_DOSE_NOCHANGE");
    State lastTextState = new NamedState("RIGHT_FREQ_NOCHANGE");
    State middleATextState = new NamedState("MID_TEXT_NOCHANGE");
    State firstDashState = new NamedState("FIRSTDASHNOCHANGE");
    State thenStatusState = new NamedState("DUALSTARTINCREASE");
   
 
    State sectionStatusState = new NamedState("DUALSTARTNOCHANGE");
    State dualWordState = new NamedState("START_NOCHANGE");
 
    Condition rangeCombineCondition = new DisjoinCondition(
        new RangeCondition(), new RangeStrengthCondition());
 
    Condition soloCondition = new WordSetCondition(iv_singleNoChangeWordSet,
        false);
    Condition firstDualCondition = new WordSetCondition(
        iv_firstNoChangeDualWordSet, false);
    Condition secondDualCondition = new WordSetCondition(
        iv_secondDualWordSet, false);
    Condition thenCondition = new WordSetCondition(
        iv_multiThenWordSet, false);
    Condition containsDosagesCondition = new StrengthCondition();
 
    startState.addTransition(thenCondition, thenStatusState);
    startState.addTransition(soloCondition, endState);
    startState.addTransition(firstDualCondition, sectionStatusState);
    startState.addTransition(rangeCombineCondition, leftDosagesState);
    startState.addTransition(containsDosagesCondition, leftStatusState);
    startState.addTransition(
        new WordSetCondition(iv_noChangeWordSet, false), dualWordState);
    startState.addTransition(new AnyCondition(), startState);
 
    thenStatusState.addTransition(firstDualCondition, sectionStatusState);
    thenStatusState.addTransition(soloCondition, endState);
    thenStatusState.addTransition(new AnyCondition(), startState);
   
    sectionStatusState.addTransition(secondDualCondition, endState);
    sectionStatusState.addTransition(new AnyCondition(), startState);
 
   
    leftStatusState.addTransition(soloCondition, endState);
    leftStatusState.addTransition(new AnyCondition(), startState);
 
    firstDashState.addTransition(new AnyCondition(), startState);
 
    dualWordState.addTransition(new WordSetCondition(iv_changeWordSet,
        false), endState);
    dualWordState.addTransition(new AnyCondition(), startState);
    middleATextState.addTransition(new AnyCondition(), startState);
 
    lastTextState.addTransition(new AnyCondition(), startState);
 
    endState.addTransition(new AnyCondition(), startState);
View Full Code Here

   * </ol>
   *
   * @return
   */
  private Machine getIncreaseStatusMachine() {
    State startState = new NamedState("START6");
    State endState = new NamedState("END6");
    endState.setEndStateFlag(true);
 
    Machine m = new Machine(startState);
 
    State thenStatusState = new NamedState("DUALSTARTTHENINCREASE");
    State sectionStatusState = new NamedState("DUALSTARTINCREASE");
   
    Condition soloCondition = new WordSetCondition(iv_singleIncreaseWordSet,
        false);
    Condition firstDualCondition = new WordSetCondition(
        iv_firstIncreaseDualWordSet, false);
    Condition secondDualCondition = new WordSetCondition(
        iv_secondDualWordSet, false);
    Condition thenCondition = new WordSetCondition(
        iv_multiThenWordSet, false);
   
    startState.addTransition(thenCondition, thenStatusState);
    startState.addTransition(soloCondition, endState);
    startState.addTransition(firstDualCondition, sectionStatusState);
    startState.addTransition(new AnyCondition(), startState);
   
   
    thenStatusState.addTransition(soloCondition, endState);
    thenStatusState.addTransition(firstDualCondition, sectionStatusState);
    thenStatusState.addTransition(new AnyCondition(), startState);
 
    sectionStatusState.addTransition(secondDualCondition, endState);
    sectionStatusState.addTransition(new AnyCondition(), startState);
   
 
    endState.addTransition(new AnyCondition(), startState);
 
    return m;
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.