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

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


        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);
   
View Full Code Here


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

    leftAbbreviateState.addTransition(new WordSetCondition(
        iv_middleTermSet, false), middleATextState);
    leftAbbreviateState.addTransition(new NumberCondition(),
        middleATextState);
    leftAbbreviateState.addTransition(new WordSetCondition(iv_frequencySet,
        false), midTermState);
    leftAbbreviateState.addTransition(new WordSetCondition(iv_hyphenatedSet,
        false), endState);
View Full Code Here

      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);
View Full Code Here

        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);
View Full Code Here

    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);
    rightNumTextState.addTransition(new WordSetCondition(iv_textNumberSet, false), endState);
    rightNumTextState.addTransition(new AnyCondition(), startState);
   
    dashAnotherState.addTransition(new WordSetCondition(iv_textNumberSet, false), endState);
    dashAnotherState.addTransition(new NumberCondition(), endState);
   
    dashAnotherState.addTransition(new AnyCondition(), startState);
 
    endState.addTransition(new AnyCondition(), startState);
 
View Full Code Here

      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);
View Full Code Here

    State dashState = new NamedState("DASH");
    State dotState = new NamedState("DOT");

    Condition rangeCondition = new RangeCondition();
    Condition leftIntCondition = new NumberCondition();
    Condition decIntCondition = new NumberCondition();
    Condition rightIntCondition = new NumberCondition();

    Condition rightDecimalCondition = new DecimalCondition();
    Condition dashCondition = new PunctuationValueCondition('-');
   
    Condition dotCondition = new PunctuationValueCondition('.');
View Full Code Here

    Machine m = new Machine(startState);
    State hyphState = new NamedState("HYPHTERM");
    State dosageState = new NamedState("DOSAGE");

    Condition decimalCondition = new DecimalCondition();
    Condition numberCondition = new NumberCondition();
    Condition strengthFormCondition = new DisjoinCondition(
        new RouteCondition(), new FormCondition());
    Condition numberTextCondition = new WordSetCondition(iv_textNumberSet,
        false);
    Condition rangeCondition = new RangeStrengthCondition();
    Condition fractionRangeCondition = new FractionStrengthCondition();
    Condition decimalStart = new DisjoinCondition(
        new IntegerValueCondition(0), new NumberCondition());

    startState.addTransition(new WordSetCondition(iv_soloTextSet, true),
        endState);
    startState.addTransition(numberCondition, dosageState);
    startState.addTransition(decimalCondition, dosageState);
    startState.addTransition(rangeCondition, dosageState);
    startState.addTransition(fractionRangeCondition, dosageState);
    startState.addTransition(numberTextCondition, dosageState);
    startState.addTransition(decimalStart, dosageState);
    /*startState.addTransition(new DisjoinCondition(new StrengthCondition(),
        new FormCondition()), formState);*/

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

    formState.addTransition(new WordSetCondition(iv_textNumberSet, true),
        ntFalseTermState);
    formState.addTransition(new AnyCondition(), startState);

    dosageState.addTransition(strengthFormCondition, ntEndState);
    dosageState
        .addTransition(new PunctuationValueCondition('-'), hyphState);

    dosageState.addTransition(new PunctuationValueCondition('('),
        leftParenState);
    dosageState.addTransition(new TextValueCondition("of", false), ofState);
    dosageState.addTransition(new AnyCondition(), startState);

    ofState.addTransition(new TextValueCondition("a", false), aState);
    ofState.addTransition(new AnyCondition(), startState);

    aState.addTransition(new DisjoinCondition(new RouteCondition(),
        new FormCondition()), ntEndState);
    aState.addTransition(new AnyCondition(), startState);

    hyphState.addTransition(new WordSetCondition(iv_soloTextSet, true),
        endState);
    hyphState.addTransition(new NumberCondition(), numState);
    hyphState.addTransition(new AnyCondition(), startState);

    numState.addTransition(new DisjoinCondition(new RouteCondition(),
        new FormCondition()), ntEndState);
    numState.addTransition(new AnyCondition(), startState);
View Full Code Here

    ntEndState.setEndStateFlag(true);
    ntEndHyphState.setEndStateFlag(true);

    startState.addTransition(new RangeStrengthCondition(), endState);
    startState.addTransition(new FractionStrengthCondition(), dateState);
    startState.addTransition(new NumberCondition(), connectState);
    startState.addTransition(new IntegerCondition(), connectState);
    startState.addTransition(new DecimalCondition(), connectState);
    startState.addTransition(new WordSetCondition(iv_numberTextSet, false), connectState);
    //Mayo SPM 2/20/2012 Changed due to separation of strength tokens
//    startState.addTransition(new StrengthUnitCondition(), ntEndState);
    startState.addTransition(new StrengthUnitCombinedCondition(), endState);
    startState.addTransition(new AnyCondition(), startState);
   
    dateState.addTransition(new NegateCondition( new PunctuationValueCondition('/')), connectState);
    dateState.addTransition(new AnyCondition(), startState);
   
    //Mayo SPM 2/20/2012 Changed due to separation of strength tokens
    connectState.addTransition(new StrengthUnitCondition(), ntEndState);
    connectState.addTransition(new StrengthUnitCombinedCondition(), endState);
    connectState.addTransition(new PunctuationValueCondition('-'), unitState);
    connectState.addTransition(new PunctuationValueCondition('.'), decimalState);
    connectState.addTransition(new AnyCondition(), startState);
   
    //Mayo SPM 2/20/2012 Changed due to separation of strength tokens
    decimalState.addTransition(new StrengthUnitCondition(), ntEndState);
    decimalState.addTransition(new StrengthUnitCombinedCondition(), endState);
    decimalState.addTransition(new PunctuationValueCondition('-'), unitState);
    decimalState.addTransition(new NumberCondition(), complexState);
    decimalState.addTransition(new AnyCondition(), startState);
   
    //Mayo SPM 2/20/2012 Changed due to separation of strength tokens
    unitState.addTransition(new StrengthUnitCondition(), ntEndHyphState);
    unitState.addTransition(new StrengthUnitCombinedCondition(), endState);
View Full Code Here

 
    startAbbreviateState.addTransition(containsAppendTermCondition,
        middleTermState);

  //  startAbbreviateState.addTransition(firstDashCondition, firstDashState);
      startAbbreviateState.addTransition(new NumberCondition(),
        finalTermState);
   
 
    startAbbreviateState.addTransition(new AnyCondition(), startState);
 
 
    middleTermState.addTransition(new RangeStrengthCondition(), anotherAppendState);
    middleTermState.addTransition(containsSecondAppendTermCondition, finalTermState);
    middleTermState.addTransition(numericTextCondition, finalAppendState);
    middleTermState.addTransition(new NumberCondition(), anotherAppendState);
   
    middleTermState.addTransition(new AnyCondition(), startState);
 
  //  secondDashState.addTransition(containsSecondAppendTermCondition, finalTextState);
  //  secondDashState.addTransition(periodCondition, endState);
  //  secondDashState.addTransition(new AnyCondition(), startState);
 
    //finalTermState.addTransition(periodCondition, endState);
    finalTermState.addTransition(new RangeStrengthCondition(), finalTextState);
    finalTermState.addTransition(numericTextCondition, finalTextState);
    finalTermState.addTransition(new NumberCondition(), finalTextState);
   
    finalTermState.addTransition(new AnyCondition(), startState);
   
    finalAppendState.addTransition(periodAdditionalCondition, endState);
    finalAppendState.addTransition(new AnyCondition(), startState);
View Full Code Here

TOP

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

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.