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

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


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

    Machine m = new Machine(startState);

    State hourNumState = new NamedState("HOUR_NUM");
    State hourMinTextState = new NamedState("HOUR_MIN_TEXT");
    State ampmTextWithPeriodState = new NamedState("AM_PM_PERIOD_TEXT");

    Condition hourNumCondition = new IntegerRangeCondition(MIN_HOUR,
        MAX_HOUR);
    Condition hourMinCondition = new HourMinuteCondition(MIN_HOUR,
        MAX_HOUR, MIN_MINUTE, MAX_MINUTE);
    Condition dayNightCondition = new WordSetCondition(iv_dayNightSet,
        false);
    Condition dayNightWithPeriodCondition = new DayNightWordCondition();
    Condition closingPeriodCondition = new PunctuationValueCondition('.');

    startState.addTransition(hourNumCondition, hourNumState);
    startState.addTransition(hourMinCondition, hourMinTextState);
    startState.addTransition(new AnyCondition(), startState);

    hourMinTextState.addTransition(dayNightCondition, endState);
    hourMinTextState.addTransition(dayNightWithPeriodCondition,
        ampmTextWithPeriodState);
    hourMinTextState.addTransition(new AnyCondition(), startState);

    hourNumState.addTransition(dayNightCondition, endState);
    hourNumState.addTransition(dayNightWithPeriodCondition,
        ampmTextWithPeriodState);
    hourNumState.addTransition(new AnyCondition(), startState);

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

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

    return m;
  }
View Full Code Here


   *     <li>patches</li>
   * </ol>
   * @return
   */
  private Machine getPatchesMachine() {
    State startState = new NamedState("START");
    State endState = new NamedState("END");
    endState.setEndStateFlag(true);
 
    Machine m = new Machine(startState);
 
    State leftAbbreviateState = new NamedState("LEFT_FREQ");
      State leftDosagesState = new NamedState("LEFT_DOSE");
    State lastTextState = new NamedState("RIGHT_FREQ");
    State middleATextState = new NamedState("MID_TEXT");
    State firstDashState = new NamedState("FIRSTDASH");
    State secondDashState = new NamedState("SECONDDASH");
 

    Condition firstDashCondition = new PunctuationValueCondition('-');
    Condition secondDashCondition = new PunctuationValueCondition('-');
    Condition rangeCombineCondition = new DisjoinCondition(
    new RangeCondition(),
    new RangeStrengthCondition()
    );
 
 
    Condition initialMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
    Condition firstMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
    Condition secondMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
    Condition thirdMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
    Condition fourthMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
   
 
    Condition specificWordCondition = new WordSetCondition(
        iv_specifiedPatchesWordSet, false);
   
 
    startState.addTransition(new TextValueCondition("a", true),
        leftAbbreviateState);
    startState.addTransition(initialMiddleTextCondition, leftAbbreviateState);
    startState.addTransition(rangeCombineCondition, leftDosagesState);
    startState.addTransition(specificWordCondition, endState);
    startState.addTransition(new AnyCondition(), startState);
 
   
    leftAbbreviateState.addTransition(firstMiddleTextCondition,
        middleATextState);
    leftAbbreviateState.addTransition(firstDashCondition, firstDashState);
    leftAbbreviateState.addTransition(new AnyCondition(), startState);
 
    firstDashState
        .addTransition(thirdMiddleTextCondition, middleATextState);
    firstDashState.addTransition(new AnyCondition(), startState);
 
    middleATextState
        .addTransition(secondMiddleTextCondition, lastTextState);
    middleATextState.addTransition(secondDashCondition, secondDashState);
    middleATextState.addTransition(new AnyCondition(), startState);
 
    secondDashState.addTransition(fourthMiddleTextCondition, lastTextState);
    secondDashState.addTransition(new AnyCondition(), startState);
 
 
    lastTextState.addTransition(new AnyCondition(), startState);
 
    endState.addTransition(new AnyCondition(), startState);
View Full Code Here

   *     <li>gastric tube</li>
   * </ol>
   * @return
   */
  private Machine getGastricMachine() {
    State startState = new NamedState("START");
    State endState = new NamedState("END");
    endState.setEndStateFlag(true);
 
    Machine m = new Machine(startState);
 
    State leftAbbreviateState = new NamedState("LEFT_FREQ");
      State leftDosagesState = new NamedState("LEFT_DOSE");
    State lastTextState = new NamedState("RIGHT_FREQ");
    State middleATextState = new NamedState("MID_TEXT");
    State firstDashState = new NamedState("FIRSTDASH");
    State secondDashState = new NamedState("SECONDDASH");
 
 
    Condition firstDashCondition = new PunctuationValueCondition('-');
    Condition secondDashCondition = new PunctuationValueCondition('-');
    Condition rangeCombineCondition = new DisjoinCondition(
    new RangeCondition(),
    new RangeStrengthCondition()
    );
 
 
    Condition initialMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
    Condition firstMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
    Condition secondMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
    Condition thirdMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
    Condition fourthMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
   
 
    Condition specificWordCondition = new WordSetCondition(
        iv_specifiedGastricWordSet, false);
   
 
    startState.addTransition(new TextValueCondition("a", true),
        leftAbbreviateState);
    startState.addTransition(initialMiddleTextCondition, leftAbbreviateState);
    startState.addTransition(rangeCombineCondition, leftDosagesState);
    startState.addTransition(specificWordCondition, endState);
    startState.addTransition(new AnyCondition(), startState);
 
   
    leftAbbreviateState.addTransition(firstMiddleTextCondition,
        middleATextState);
    leftAbbreviateState.addTransition(firstDashCondition, firstDashState);
    leftAbbreviateState.addTransition(new AnyCondition(), startState);
 
    firstDashState
        .addTransition(thirdMiddleTextCondition, middleATextState);
    firstDashState.addTransition(new AnyCondition(), startState);
 
    middleATextState
        .addTransition(secondMiddleTextCondition, lastTextState);
    middleATextState.addTransition(secondDashCondition, secondDashState);
    middleATextState.addTransition(new AnyCondition(), startState);
 
    secondDashState.addTransition(fourthMiddleTextCondition, lastTextState);
    secondDashState.addTransition(new AnyCondition(), startState);
 

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

   *     <li>drops</li>
   * </ol>
   * @return
   */
  private Machine getTopicalMachine() {
    State startState = new NamedState("START");
    State endState = new NamedState("END");
    endState.setEndStateFlag(true);
 
    Machine m = new Machine(startState);
 
    State leftAbbreviateState = new NamedState("LEFT_FREQ");
      State leftDosagesState = new NamedState("LEFT_DOSE");
    State lastTextState = new NamedState("RIGHT_FREQ");
    State middleATextState = new NamedState("MID_TEXT");
    State firstDashState = new NamedState("FIRSTDASH");
    State secondDashState = new NamedState("SECONDDASH");

    State leftAbbreviatePState = new NamedState("LEFT_P");
      State rightAbbreviatePVState = new NamedState("RIGHT_PV");
      State firstDotPState = new NamedState("FIRSTDOTP");

      //Condition secondPVDotCondition = new PunctuationValueCondition('.');
    Condition firstDashCondition = new PunctuationValueCondition('-');
    Condition secondDashCondition = new PunctuationValueCondition('-');
    Condition rangeCombineCondition = new DisjoinCondition(
    new RangeCondition(),
    new RangeStrengthCondition()
    );
 
 
    Condition initialMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
    Condition firstMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
    Condition secondMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
    Condition thirdMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
    Condition fourthMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
   
    Condition soloCondition = new WordSetCondition(iv_singleTopicalWordSet, true);
 
   
 
    startState.addTransition(new TextValueCondition("a", true),
        leftAbbreviateState);
    startState.addTransition(new TextValueCondition("p", true),
        leftAbbreviatePState);
    startState.addTransition(initialMiddleTextCondition, leftAbbreviateState);
    startState.addTransition(rangeCombineCondition, leftDosagesState);
    startState.addTransition(soloCondition, endState);
 
    startState.addTransition(new AnyCondition(), startState);
 
    leftAbbreviatePState.addTransition(new PunctuationValueCondition('.'), firstDotPState);
    leftAbbreviatePState.addTransition(new AnyCondition(), startState);

    firstDotPState.addTransition(soloCondition, endState);
    firstDotPState.addTransition(new TextValueCondition("v", true),
        rightAbbreviatePVState);
    firstDotPState.addTransition(new AnyCondition(), startState);
    leftAbbreviateState.addTransition(firstMiddleTextCondition,
        middleATextState);
    leftAbbreviateState.addTransition(firstDashCondition, firstDashState);
    leftAbbreviateState.addTransition(soloCondition, endState);
    leftAbbreviateState.addTransition(new AnyCondition(), startState);
View Full Code Here

   *     <li>tabs</li>
   * </ol>
   * @return
   */
  private Machine getOralMachine() {
    State startState = new NamedState("START");
    State endState = new NamedState("END");
    endState.setEndStateFlag(true);
 
    Machine m = new Machine(startState);
 
    State leftAbbreviateState = new NamedState("LEFT_FREQ");
      State leftDosagesState = new NamedState("LEFT_DOSE");
    State lastTextState = new NamedState("RIGHT_FREQ");
    State middleATextState = new NamedState("MID_TEXT");
    State firstDashState = new NamedState("FIRSTDASH");
    State secondDashState = new NamedState("SECONDDASH");
    State leftAbbreviatePState = new NamedState("LEFT_P");
      State rightAbbreviatePOState = new NamedState("RIGHT_PO");
      State firstDotPState = new NamedState("FIRSTDOTP");


      Condition firstPODotCondition = new PunctuationValueCondition('.');
      Condition secondPODotCondition = new PunctuationValueCondition('.');
    Condition firstDashCondition = new PunctuationValueCondition('-');
    Condition secondDashCondition = new PunctuationValueCondition('-');
    Condition rangeCombineCondition = new DisjoinCondition(
    new RangeCondition(),
    new RangeStrengthCondition()
    );
 
 
    Condition initialMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
    Condition firstMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
    Condition secondMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
    Condition thirdMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
    Condition fourthMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, true);
   
    Condition soloCondition = new WordSetCondition(iv_singleOralWordSet, true);
    Condition specificWordCondition = new WordSetCondition(
        iv_specifiedOralWordSet, false);
   
 
    startState.addTransition(new TextValueCondition("a", true),
        leftAbbreviateState);
    startState.addTransition(new TextValueCondition("p", true),
        leftAbbreviatePState);
    startState.addTransition(initialMiddleTextCondition, leftAbbreviateState);
    startState.addTransition(rangeCombineCondition, leftDosagesState);
    startState.addTransition(soloCondition, endState);
    startState.addTransition(specificWordCondition, endState);
    startState.addTransition(new AnyCondition(), startState);
   
    leftAbbreviatePState.addTransition(firstPODotCondition, firstDotPState);
    leftAbbreviatePState.addTransition(new AnyCondition(), startState);

    firstDotPState.addTransition(soloCondition, endState);
       
    firstDotPState.addTransition(new TextValueCondition("o", true),
        rightAbbreviatePOState);
    firstDotPState.addTransition(new AnyCondition(), startState);
   
    leftAbbreviateState.addTransition(firstMiddleTextCondition,
        middleATextState);
    leftAbbreviateState.addTransition(firstDashCondition, firstDashState);
    leftAbbreviateState.addTransition(soloCondition, endState);
View Full Code Here

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

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.