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

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


   *     <li>enema</li>
   * </ol>
   * @return
   */
  private Machine getRectalMachine() {
    State startState = new NamedState("START");
    State endState = new NamedState("END");
    endState.setEndStateFlag(true);
 
    Machine m = new Machine(startState);
   
    Condition soloCondition = new WordSetCondition(iv_singleRectalWordSet, true);
 
    startState.addTransition(soloCondition, endState);
    startState.addTransition(new AnyCondition(), startState);
 
    endState.addTransition(new AnyCondition(), startState);
 
    return m;
  }
View Full Code Here


   *     <li>intervenously</li>
   * </ol>
   * @return
   */
  private Machine getInjectionMachine() {
    State startState = new NamedState("START");
    State endState = new NamedState("END");
    endState.setEndStateFlag(true);
 
    Machine m = new Machine(startState);
   
    Condition soloCondition = new WordSetCondition(iv_singleInjectWordSet, true);
 
    startState.addTransition(soloCondition, endState);
    startState.addTransition(new AnyCondition(), startState);
 
    endState.addTransition(new AnyCondition(), startState);
 
    return m;
  }
View Full Code Here

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

      endState.setEndStateFlag(true);
 
      Machine m = new Machine(startState);
 
      Condition probableC = new TextSetCondition(iv_probableSet, false);
    
 
      startState.addTransition(probableC, endState);
      startState.addTransition(new AnyCondition(), startState);

 
      dualState.addTransition(new AnyCondition(), startState);
     
      endState.addTransition(new AnyCondition(), startState);
 
      return m;
  }
View Full Code Here

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

        State ntEndState = new NonTerminalEndState("NON TERMINAL END");
        endState.setEndStateFlag(true);
        ntEndState.setEndStateFlag(true);
        // for case h/o
        State hAbbrState = new NamedState("HISTORY_ABBR");
        State oAbbrState = new NamedState("OF_ABBR");
       
        Machine m = new Machine(startState);
        State fslashState = new NamedState("FORWARD_SLASH");
        State probCollocState = new NamedState("PROB_COLLOC");
        State probFamilyPartState = new NamedState("PROB_FAMC");
        State probColPartState = new NamedState("PROB_COLPART");
       // Condition probableFHC = new TextValueCondition("family", false);
        Condition probCollecC = new TextSetCondition(iv_probableCollocSet, false);
        Condition probColPartC = new TextSetCondition(iv_probableColPartSet, false);
        
 
        startState.addTransition(probCollecC, probCollocState); //questionable
        startState.addTransition(new AnyCondition(), startState);

        probCollocState.addTransition(probColPartC, probColPartState); //history
        probCollocState.addTransition(new TextValueCondition("h", false), hAbbrState); //h  
       // probCollocState.addTransition(probableFHC, probFamilyPartState);
        probCollocState.addTransition(new AnyCondition(), anyState);
       
        hAbbrState.addTransition(
                new TextValueCondition("/", false),
                fslashState);
      hAbbrState.addTransition(new AnyCondition(), startState);
               

     
      probFamilyPartState.addTransition(new AnyCondition(), ntEndState);
     
     // anyState.addTransition(probableFHC, probFamilyPartState); 
     // anyState.addTransition(probColPartC, probColPartState);
        anyState.addTransition(new TextValueCondition("h", false), hAbbrState);
       // anyState.addTransition(new TextValueCondition("/", false), fslashState);
        anyState.addTransition(new AnyCondition(), anyState);
       
        fslashState.addTransition(new TextValueCondition("o", false), oAbbrState);
      fslashState.addTransition(new AnyCondition(), startState);
     
        oAbbrState.addTransition(new AnyCondition(), ntEndState);
        oAbbrState.addTransition(new AnyCondition(), startState);
       
      probColPartState.addTransition(new AnyCondition(), ntEndState);
      //probColPartState.addTransition(new AnyCondition(), startState);
      ntEndState.addTransition(new AnyCondition(), startState);
        return m;
    }
View Full Code Here

     *
     * @return
     */
    private Machine getHistoryMachine()
    {
        State startState = new NamedState("START");
        State endState = new NamedState("END");
     
        //Condition negCollocC = new TextSetCondition(iv_negCollocSet, false);
        //Condition negColPartC = new TextSetCondition(iv_negColPartSet, false);
        // for case h/o
        State hAbbrState = new NamedState("HISTORY_ABBR");
        // for case s/p
        State sAbbrState = new NamedState("STATUS_ABBR");
       
        State fslashState = new NamedState("FORWARD_SLASH");

        endState.setEndStateFlag(true);

        Machine m = new Machine(startState);

        Condition historyC = new TextSetCondition(iv_historySet, false);
 
        startState.addTransition(historyC, endState);
        startState
                .addTransition(new TextValueCondition("h", false), hAbbrState);
        startState
        .addTransition(new TextValueCondition("s", false), hAbbrState);
        startState.addTransition(new AnyCondition(), startState);

        hAbbrState.addTransition(
                new TextValueCondition("/", false),
                fslashState);
        hAbbrState.addTransition(new AnyCondition(), startState);
    
        sAbbrState.addTransition(
                new TextValueCondition("/", false),
                fslashState);
        sAbbrState.addTransition(new AnyCondition(), startState);

        fslashState.addTransition(new TextValueCondition("o", false), endState);
        fslashState.addTransition(new TextValueCondition("p", false), endState);
        fslashState.addTransition(new AnyCondition(), startState);

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

        return m;
    }
View Full Code Here

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

        // for case h/o
        State familyState = new NamedState("FAMILY");

        endState.setEndStateFlag(true);

        Machine m = new Machine(startState);

        Condition familyHistoryC = new TextSetCondition(
                iv_familyHistorySet,
                false);

        startState.addTransition(familyHistoryC, endState);
        startState.addTransition(
                new TextValueCondition("family", false),
                familyState);
        startState.addTransition(new AnyCondition(), startState);

        familyState.addTransition(
                new TextValueCondition("history", false),
                endState);
        familyState.addTransition(new AnyCondition(), startState);

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

        return m;
    }
View Full Code Here

   * </ol>
   * @return
   */
  private Machine getStrengthSlashMachine()
  {
      State startState = new NamedState("START");
      State endState = new NamedState("END");
      endState.setEndStateFlag(true);
 
      Machine m = new Machine(startState);
      State numeratorLeftState = new NamedState("NUMERATOR_LEFT");
      State remainderRightState = new NamedState("REMAINDER_RIGHT");
      State numeratorRightState = new NamedState("NUMERATOR_RIGHT");
      State decPartNumState = new NamedState("DECIMAL_NUM");
      State fslashState = new NamedState("FORWARD-SLASH");
      State hypenState = new NamedState("HYPHEN");
      State dotLeftState = new NamedState("DOT_LEFT");
      State dotRightState = new NamedState("DOT_RIGHT");
      Condition intNumeratorCondition = new NumberCondition();
      Condition decPartInt = new NumberCondition();
      Condition fslashCondition = new PunctuationValueCondition('/');
      Condition intDenominatorCondition = new NumberCondition();
      Condition decDenominatorCondition = new DecimalCondition();
      Condition decimalCondition = new DecimalCondition();
      Condition containsdotCondition = new PunctuationValueCondition('.');
      Condition leftContainsShortDose = new ContainsSetTextValueCondition(
        iv_textNumeratorSet, false);
   
      startState.addTransition(intNumeratorCondition, numeratorLeftState);
      startState.addTransition(leftContainsShortDose, numeratorLeftState);
      startState.addTransition(new DecimalCondition(), numeratorLeftState);
      startState.addTransition(new AnyCondition(), startState);
     
      numeratorLeftState.addTransition(containsdotCondition, dotLeftState);
      numeratorLeftState.addTransition(fslashCondition, fslashState);
      numeratorLeftState.addTransition(new PunctuationValueCondition('-'), numeratorRightState);
      numeratorLeftState.addTransition(new AnyCondition(), startState);
     
      dotLeftState.addTransition(decPartInt, hypenState);
      dotLeftState.addTransition(decDenominatorCondition, hypenState);
      dotLeftState.addTransition(new AnyCondition(), startState);
   
      hypenState.addTransition(new PunctuationValueCondition('-'), numeratorRightState);
      hypenState.addTransition(new AnyCondition(), startState);
     
      numeratorRightState.addTransition(new NumberCondition(), endState);
      numeratorRightState.addTransition(new DecimalCondition(), endState);
      numeratorRightState.addTransition(new AnyCondition(), startState);
     
      dotRightState.addTransition(new PunctuationValueCondition('.'), fslashState);
      dotRightState.addTransition(new AnyCondition(), startState);
     
      decPartNumState.addTransition(fslashCondition, fslashState);
      decPartNumState.addTransition(new AnyCondition(), startState);
     
      fslashState.addTransition(intDenominatorCondition, endState);
View Full Code Here

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

        Machine m = new Machine(startState);
        State numeratorNumState = new NamedState("NUMERATOR_NUM");
        State fslashState = new NamedState("FORWARD_SLASH");
        State numeratorTextState = new NamedState("NUMERATOR_TEXT");

        Condition intNumeratorCondition = new NumberCondition();
        Condition fslashCondition = new PunctuationValueCondition('/');
        Condition intDenominatorCondition = new NumberCondition();
        Condition decimalCondition = new DecimalCondition();
        Condition textNumeratorCondition =
            new WordSetCondition(iv_textNumeratorSet, false);
        Condition textDenominatorCondition =
            new WordSetCondition(iv_textDenominatorSet, false);

        startState.addTransition(intNumeratorCondition, numeratorNumState);
        startState.addTransition(decimalCondition, numeratorNumState);
    startState.addTransition(textNumeratorCondition, numeratorTextState);
    startState.addTransition(textDenominatorCondition, endState);
        startState.addTransition(new AnyCondition(), startState);

        numeratorNumState.addTransition(fslashCondition, fslashState);
    numeratorNumState.addTransition(textDenominatorCondition, endState);
        numeratorNumState.addTransition(new AnyCondition(), startState);

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

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

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

        return m;
    }
View Full Code Here

   * </ol>
   * @return
   */
  private Machine getDashDashMachine()
  {
    State startState = new NamedState("START");
    State endState = new NamedState("END");
    endState.setEndStateFlag(true);
 
    Machine m = new Machine(startState);
   
    State leftNumTextState = new NamedState("LEFT_NUM_TEXT");
    State rightNumTextState = new NamedState("RIGHT_NUM_TEXT");
    State middleDash = new NamedState("MIDDASH");
    State dashAnotherState = new NamedState("DASH_2");
    State dash2State = new NamedState("DASH2");
   
    Condition rightIntCondition = new NumberCondition();
   
    Condition rightNumTextCondition =
      new WordSetCondition(iv_textNumberSet, false);
 
   
    startState.addTransition(new WordSetCondition(iv_textNumberSet, false), leftNumTextState);
    startState.addTransition(new AnyCondition(), startState);
 
    leftNumTextState.addTransition(new PunctuationValueCondition('-'), dash2State);
    leftNumTextState.addTransition(new WordSetCondition(iv_rangeSet, false), rightNumTextState);
    leftNumTextState.addTransition(new AnyCondition(), startState);
 
     
      dash2State.addTransition(rightIntCondition, endState);
    dash2State.addTransition(rightNumTextCondition, endState);
    dash2State.addTransition(new WordSetCondition(iv_rangeSet, false), middleDash);
    dash2State.addTransition(new AnyCondition(), startState);
   
    middleDash.addTransition(new PunctuationValueCondition('-'), dashAnotherState);
    middleDash.addTransition(new AnyCondition(), startState);
   
    rightNumTextState.addTransition(new NumberCondition(), endState);
View Full Code Here

   * </ol>
   * @return
   */
  private Machine getDashMachine()
  {
      State startState = new NamedState("START");
      State endState = new NamedState("END");
      endState.setEndStateFlag(true);
 
      Machine m = new Machine(startState);
      State leftNumIntegerState = new NamedState("LEFT_NUM_INTEGER");
      State leftNumTextState = new NamedState("LEFT_NUM_TEXT");
      State dashState = new NamedState("DASH1");
      State dash1State = new NamedState("DASH_1");
   
      Condition leftIntCondition = new NumberCondition();
      Condition rightIntCondition = new NumberCondition();
 
      startState.addTransition(leftIntCondition, leftNumIntegerState);
      startState.addTransition(new WordSetCondition(iv_hyphenatedSet, false), endState);
      startState.addTransition(new WordSetCondition(iv_textNumberSet, false), leftNumTextState);
      startState.addTransition(new AnyCondition(), startState);
 
      leftNumIntegerState.addTransition(new PunctuationValueCondition('-'), dashState);
      leftNumIntegerState.addTransition(new AnyCondition(), startState);
 
      leftNumTextState.addTransition(new PunctuationValueCondition('-'), dash1State);
      leftNumTextState.addTransition(new AnyCondition(), startState);
 
      dashState.addTransition(rightIntCondition, endState);
      dashState.addTransition(new WordSetCondition(iv_textNumberSet, false), endState);
 
      dashState.addTransition(new AnyCondition(), startState);
   
      dash1State.addTransition(rightIntCondition, endState);
      dash1State.addTransition(new WordSetCondition(iv_textNumberSet, false), endState);
 
      dash1State.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.