Package net.openai.util.fsm

Examples of net.openai.util.fsm.Condition


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


  //  State secondDashState = new NamedState("SECOND_DASH");
 
  //  Condition firstDashCondition = new PunctuationValueCondition('-');
  //  Condition secondDashCondition = new PunctuationValueCondition('-');
 
    Condition numericTextCondition = new WordSetCondition(
        iv_middleNumericTermSet, true);
    Condition periodCondition = new WordSetCondition(iv_periodSet, true);
    Condition periodAdditionalCondition = new WordSetCondition(iv_periodSet, true);
    Condition periodAdditional2Condition = new WordSetCondition(iv_periodSet, true);
    Condition specificWordCondition = new WordSetCondition(
        iv_specifiedWordSet, false);
    Condition containsAppendTermCondition = new WordSetCondition(
        iv_appendWordSet, true);
    Condition containsSecondAppendTermCondition = new WordSetCondition(
        iv_appendWordSet, true);
 
    startState.addTransition(specificWordCondition, startAbbreviateState);
    startState.addTransition(new AnyCondition(), startState);
 
View Full Code Here

    State lastTextState = new NamedState("LAST_TEXT");
    State middleTextState = new NamedState("MID_TEXT");
    State firstDashState = new NamedState("FIRSTDASH");
    State secondDashState = new NamedState("SECONDDASH");

    Condition firstDashCondition = new PunctuationValueCondition('-');
    Condition secondDashCondition = new PunctuationValueCondition('-');

    Condition firstMiddleTextCondition = new WordSetCondition(
        iv_middleNumericTermSet, true);
    Condition secondMiddleTextCondition = new WordSetCondition(
        iv_middleNumericTermSet, true);
    Condition thirdMiddleTextCondition = new WordSetCondition(
        iv_middleNumericTermSet, true);
    Condition fourthMiddleTextCondition = new WordSetCondition(
        iv_middleNumericTermSet, true);

    Condition periodCondition = new WordSetCondition(iv_periodSet, true);
    Condition specificWordCondition = new WordSetCondition(
        iv_specifiedWordSet, false);


    startState.addTransition(specificWordCondition, leftAbbreviateState);
    startState.addTransition(new AnyCondition(), startState);
View Full Code Here

    Machine m = new Machine(startState);
 

 
    Condition fullTextCondition = new WordSetCondition(iv_fullTextSet,
        false);

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

    Machine m = new Machine(startState);
    State systolicState = new NamedState("SYSTOLIC");
    State fslashState = new NamedState("FSLASH");

    Condition systolicCondition = new IntegerRangeCondition(80, 200);
    Condition diastolicCondition = new IntegerRangeCondition(60, 160);
    Condition fslashCondition = new PunctuationValueCondition('/');

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

    systolicState.addTransition(fslashCondition, fslashState);
View Full Code Here

    endState.setEndStateFlag(true);

    Machine m = new Machine(startState);
    State quanitityState = new NamedState("QUANITITY");

    Condition numberCondition = new NumberCondition();
    Condition numberTextCondition = new WordSetCondition(iv_textNumberSet,
        false);
    Condition rangeCondition = new RangeCondition();
    Condition fullTextCondition = new WordSetCondition(iv_fullTextSet,
        false);
    Condition shortTextCondition = new WordSetCondition(iv_shortTextSet,
        false);

    startState.addTransition(numberCondition, quanitityState);
    startState.addTransition(rangeCondition, quanitityState);
    startState.addTransition(numberTextCondition, quanitityState);
View Full Code Here

    State monthNumState = new NamedState("MONTH_NUM");
    State monthDaySeparatorState = new NamedState("MONTH_DAY_SEP");
    State dayNumState = new NamedState("DAY_NUM");
    State dayYearSeparatorState = new NamedState("DAY_YEAR_SEP");

    Condition monthNumCondition = new IntegerRangeCondition(MIN_MONTH,
        MAX_MONTH);
    Condition mdFslashCondition = new PunctuationValueCondition('/');
    Condition mdDashCondition = new PunctuationValueCondition('-');
    Condition dyFslashCondition = new PunctuationValueCondition('/');
    Condition dyDashCondition = new PunctuationValueCondition('-');
    Condition dayNumCondition = new IntegerRangeCondition(MIN_DAY, MAX_DAY);
    Condition yearNumCondition = new IntegerRangeCondition(MIN_YEAR,
        MAX_YEAR);

    // condition that is not a fslash or dash
    Condition notFslashNotDashCondition = new CombineCondition(
        new NegateCondition(mdFslashCondition), new NegateCondition(
            mdDashCondition));

    startState.addTransition(monthNumCondition, monthNumState);
    startState.addTransition(new AnyCondition(), startState);
View Full Code Here

    State monthShortTextState = new NamedState("MONTH_SHORT_TEXT");
    State dayNumState = new NamedState("DAY_NUM");
    State commaState = new NamedState("COMMA");
    State periodState = new NamedState("PERIOD");

    Condition monthFullTextCondition = new WordSetCondition(
        iv_monthFullNameSet, false);
    Condition monthShortTextCondition = new WordSetCondition(
        iv_monthShortNameSet, false);
    Condition dayNumCondition = new IntegerRangeCondition(MIN_DAY, MAX_DAY);
    Condition periodCondition = new PunctuationValueCondition('.');
    Condition yearNumCondition = new IntegerRangeCondition(MIN_YEAR,
        MAX_YEAR);
    Condition commaCondition = new PunctuationValueCondition(',');

    // condition for not being a comma or year number
    Condition notCommaNotYearNumCondition = new CombineCondition(
        new NegateCondition(commaCondition), new NegateCondition(
            yearNumCondition));

    // condition for being a year num and not a day num
    Condition yearNotDayNumCondition = new CombineCondition(
        yearNumCondition, new NegateCondition(dayNumCondition));

    startState.addTransition(monthFullTextCondition, monthFullTextState);
    startState.addTransition(monthShortTextCondition, monthShortTextState);
    startState.addTransition(new AnyCondition(), startState);
View Full Code Here

    State leftNumIntegerState = new NamedState("LEFT_NUM_INTEGER");
    State leftNumRomanState = new NamedState("LEFT_NUM_ROMAN");
    State leftNumTextState = new NamedState("LEFT_NUM_TEXT");
    State dashState = new NamedState("DASH");

    Condition leftIntCondition = new IntegerCondition();
    Condition rightIntCondition = new IntegerCondition();
    Condition dashCondition = new PunctuationValueCondition('-');
    Condition leftRomanNumeralCondition = new RomanNumeralCondition();
    Condition rightRomanNumeralCondition = new RomanNumeralCondition();
    Condition leftNumTextCondition = new WordSetCondition(iv_textNumberSet,
        false);
    Condition rightNumTextCondition = new WordSetCondition(
        iv_textNumberSet, false);

    startState.addTransition(leftIntCondition, leftNumIntegerState);
    startState.addTransition(leftRomanNumeralCondition, leftNumRomanState);
    startState.addTransition(leftNumTextCondition, leftNumTextState);
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 IntegerCondition();
    Condition fslashCondition = new PunctuationValueCondition('/');
    Condition intDenominatorCondition = new IntegerCondition();
    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, endState);
    startState.addTransition(textNumeratorCondition, numeratorTextState);
View Full Code Here

TOP

Related Classes of net.openai.util.fsm.Condition

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.