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

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


  private Machine getDailySuffixMachine() {
 
    State endState = new NamedState("END");
    State ntStartState = new NamedState("START");
    State skipFirstState = new IndentStartState("NON TERMINAL START");
    State ntEndState = new NonTerminalEndState("NON TERMINAL END");
    ntEndState.setEndStateFlag(true);
    endState.setEndStateFlag(true);
    skipFirstState.setEndStateFlag(true);
   
    Machine m = new Machine(ntStartState);
    State forwardSlashState = new NamedState("FSLASH");
View Full Code Here


    private Machine getHourlySuffixMachine() {
 
      State endState = new NamedState("END");
      State ntStartState = new NamedState("START");
      State skipFirstState = new IndentStartState("NON TERMINAL START");
      State ntEndState = new NonTerminalEndState("NON TERMINAL END");
      ntEndState.setEndStateFlag(true);
      endState.setEndStateFlag(true);
      skipFirstState.setEndStateFlag(true);
     
      Machine m = new Machine(ntStartState);
      State forwardSlashState = new NamedState("FSLASH");
View Full Code Here

  private Machine getFiveTimesADayMachine() {
    State startState = new NamedState("START_5TDM");
    State endState = new NamedState("END_5TDM");
    State handleRangeState = new NamedState("HANDLERANGE");
    State hyphState = new NamedState("HYPHSTATE");
    State ntEndState = new NonTerminalEndState("NON TERMINAL END");
    ntEndState.setEndStateFlag(true);
    endState.setEndStateFlag(true);
 

    State fiveHourState = new NamedState("FIVEHOUR");

 
    Machine m = new Machine(startState);
 
    startState.addTransition(new TextSetCondition(
        iv_sixTimesPerDayWordSet, false) , endState);
    startState.addTransition(new DisjoinCondition(new NegateCondition(new IntegerRangeCondition(1,4)), new IntegerValueCondition(5)), handleRangeState);
    startState.addTransition(new IntegerValueCondition(5), fiveHourState);
    startState.addTransition(new TextValueCondition("five", false), fiveHourState);

    startState.addTransition(new AnyCondition(), startState);
   
    handleRangeState.addTransition(new PunctuationValueCondition('-'), hyphState);
    handleRangeState.addTransition(new AnyCondition(), startState);
   
    fiveHourState.addTransition(new TextSetCondition(iv_hourlySuffixSet, false), endState);
    fiveHourState.addTransition(new AnyCondition(), startState);
   
    hyphState.addTransition(new IntegerRangeCondition(5,10), fiveHourState);
    hyphState.addTransition(new AnyCondition(), startState);
   
    ntEndState.addTransition(new AnyCondition(), startState);
    endState.addTransition(new AnyCondition(), startState);
   
    return m;
 
   
View Full Code Here

   */
  private Machine getFrequencyMachine() {
    State startState = new NamedState("START");
    State endState = new NamedState("END");
    State ntFalseTermState = new IndentStartState("NON TERMINAL START");
    State ntEndState = new NonTerminalEndState("NON TERMINAL END");
    ntFalseTermState.setEndStateFlag(true);
    ntEndState.setEndStateFlag(true);
    endState.setEndStateFlag(true);

    Machine m = new Machine(startState);

    State leftAbbreviateState = new NamedState("LEFT_FREQ");

    State lastTextState = new NamedState("RIGHT_FREQ");
    State middleATextState = new NamedState("MID_TEXT");
    State midTermState = new NamedState("MID_TERM");
    State termState = new NamedState("SKIP_TERM");

    Condition integerCondition = new IntegerRangeCondition(0,5);
   
    Condition rangeCombineCondition = new DisjoinCondition(
        new RangeCondition(), new RangeStrengthCondition());

//    Condition hyphenatedCondition = new WordSetCondition(iv_hyphenatedSet,
//        false);

    Condition secondMiddleTextCondition = new WordSetCondition(
        iv_middleTermSet, false);

    startState.addTransition(rangeCombineCondition, leftAbbreviateState);
    startState.addTransition(new WordSetCondition(iv_frequencySet,
        false), leftAbbreviateState);
    startState.addTransition(integerCondition, leftAbbreviateState);
    startState.addTransition(new WordSetCondition(iv_hyphenatedSet,
        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);
    leftAbbreviateState.addTransition(new FrequencyUnitCondition(),
        ntEndState);
    leftAbbreviateState.addTransition(new AnyCondition(), startState);


    midTermState.addTransition(new WordSetCondition(iv_middleTermSet, false), termState);
    midTermState.addTransition(new AnyCondition(),  startState);
   
    middleATextState
        .addTransition(secondMiddleTextCondition, lastTextState);

    middleATextState
        .addTransition(new FrequencyUnitCondition(), ntEndState);
    middleATextState.addTransition(new RouteCondition(), endState);
    middleATextState.addTransition(new AnyCondition(), startState);
   

    termState
        .addTransition(new FrequencyUnitCondition(), ntFalseTermState);
    termState.addTransition(new RouteCondition(), ntFalseTermState);
    termState.addTransition(new AnyCondition(), startState);


    lastTextState.addTransition(new FrequencyUnitCondition(), ntEndState);
    lastTextState.addTransition(new RouteCondition(), ntEndState);
    lastTextState.addTransition(new AnyCondition(), startState);

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

    return m;
  }
View Full Code Here

    State startState = new NamedState("START");
    State endState = new NamedState("END");
    State medState = new NamedState("MEDHIST");
    State midWordState = new NamedState("MIDDLE");

    State ntEndState = new NonTerminalEndState("NON TERMINAL END");
    endState.setEndStateFlag(true);
    ntEndState.setEndStateFlag(true);

    Machine m = new Machine(startState);

    Condition subFirstBegin = new TextSetCondition(iv_historySubBeginSet,
        false);
    Condition subFirstMid = new TextSetCondition(iv_historySubMidSet,
        false);
    Condition subFirstNext = new TextSetCondition(iv_historySubNextSet,
        false);

    startState.addTransition(subFirstBegin, medState);
      startState.addTransition(new AnyCondition(), startState);
     
    medState.addTransition(subFirstNext, endState);
    medState.addTransition(subFirstMid, midWordState);
    medState.addTransition(new PunctuationValueCondition(':'), endState);
    //medState.addTransition(new PunctuationValueCondition('/'), ntEndState);
    medState.addTransition(new AnyCondition(), startState);
   
    midWordState.addTransition(subFirstNext, endState);
    midWordState.addTransition(new PunctuationValueCondition(':'), endState);
    midWordState.addTransition(new AnyCondition(), startState);
   
    ntEndState.addTransition(new AnyCondition(),  startState);
    endState.addTransition(new AnyCondition(), startState);
    return m;
  }
View Full Code Here

    State endState = new NamedState("END");
    State medState = new NamedState("PROBHIST");
 
    State endWordState = new NamedState("ENDWORD");

    State ntEndState = new NonTerminalEndState("NON TERMINAL END");
    endState.setEndStateFlag(true);
    ntEndState.setEndStateFlag(true);

    Machine m = new Machine(startState);

    Condition subFirstBegin = new TextSetCondition(iv_probableSubBeginSet,
        false);
View Full Code Here

    State secondDotState = new NamedState("SECONDDOT");
    State nState = new NamedState("NSTATE");
    State thirdDotState = new NamedState("THIRDDOT");
 
 
    State ntEndState = new NonTerminalEndState("NON TERMINAL END");
    endState.setEndStateFlag(true);
    ntEndState.setEndStateFlag(true);
 
    Machine m = new Machine(startState);
 
    Condition subFirstBegin = new TextSetCondition(iv_confirmedSubBeginSet,
        false);
View Full Code Here

        // for case h/o
        State rAbbrState = new NamedState("RULEOUT_ABBR");
        State wAbbrState = new NamedState("WITHOUT_ABBR");
        State fslashState = new NamedState("FORWARD_SLASH");
       
        State ntEndState = new NonTerminalEndState("NON TERMINAL END");
        endState.setEndStateFlag(true);
        ntEndState.setEndStateFlag(true);

        Machine m = new Machine(startState);
        State regModalState = new NamedState("REG_MODAL");
        State negPartState = new NamedState("NEG_PART");
        State negVerbState = new NamedState("NEG_VERB");
        State negCollocState = new NamedState("NEG_COLLOC");
        State negColPartState = new NamedState("NEG_COLPART");
        State negColMultiPartState = new NamedState("NEG_COLMULTIPART");
        State negColSecondPartState = new NamedState("NEG_COL2NDPART");

        Condition regModalC = new TextSetCondition(iv_modalVerbsSet, false);
        Condition negPartC = new TextSetCondition(iv_negParticlesSet, false);
        Condition regVerbC = new TextSetCondition(iv_regVerbsSet, false);
        Condition negVerbC = new TextSetCondition(iv_negVerbsSet, false);
        Condition negDetC = new TextSetCondition(iv_negDeterminersSet, false);
        Condition negCollocC = new TextSetCondition(iv_negCollocSet, false);
        Condition negColPartC = new TextSetCondition(iv_negColPartSet, false);
        Condition neg1of3PartC = new TextSetCondition(iv_negCol1of3PartSet, false);
        Condition neg2of3PartC = new TextSetCondition(iv_negCol2of3PartSet, false);
        Condition notCollocC = new NegateCondition(negCollocC);

        startState.addTransition(negVerbC, negVerbState);
        startState.addTransition(neg1of3PartC, negColMultiPartState);
        startState.addTransition(negCollocC, negCollocState); //rule
     
        startState.addTransition(
                new DisjoinCondition(regModalC, regVerbC),
                regModalState); // start with a modal
        startState.addTransition(
                new DisjoinCondition(negPartC, negDetC),
                negPartState);
       
        startState
        .addTransition(new TextValueCondition("r", false), rAbbrState);
        startState
        .addTransition(new TextValueCondition("w", false), wAbbrState);
        startState.addTransition(new AnyCondition(), startState);
       

        negColMultiPartState.addTransition(neg2of3PartC, negColSecondPartState);
        negColMultiPartState.addTransition(negColPartC, negCollocState);
        negColMultiPartState.addTransition(new AnyCondition(), startState);
       
        negColSecondPartState.addTransition(new TextSetCondition(iv_negColAnyOf3PartSet, false), negCollocState);
        negColSecondPartState.addTransition(negColPartC, negCollocState);
        negColSecondPartState.addTransition(new AnyCondition(), startState);
       
        regModalState.addTransition(negCollocC, negCollocState);
        negCollocState.addTransition(negColPartC, negColPartState); //out
       
        negColPartState.addTransition(new AnyCondition(), ntEndState);
       
        negCollocState.addTransition(new AnyCondition(), startState);

        regModalState.addTransition(
                new DisjoinCondition(negPartC, negDetC),
                negPartState);
        regModalState.addTransition(new AnyCondition(), anyState);

        anyState.addTransition(
                new DisjoinCondition(negPartC, negDetC),
                negPartState);
        anyState.addTransition(new AnyCondition(), startState);
        rAbbrState.addTransition(
                new TextValueCondition("/", false),
                fslashState);
        rAbbrState.addTransition(new AnyCondition(), startState);
       
        wAbbrState.addTransition(
                new TextValueCondition("/", false),
                fslashState);
        wAbbrState.addTransition(new AnyCondition(), startState);

        fslashState.addTransition(new TextValueCondition("o", false), endState);
        fslashState.addTransition(new AnyCondition(), startState);
       
        negPartState.addTransition(notCollocC, ntEndState);
        negVerbState.addTransition(notCollocC, ntEndState);
        negPartState.addTransition(new AnyCondition(), startState);
      //  negVerbState.addTransition(new AnyCondition(), startState);

        negPartState.addTransition(new AnyCondition(), ntEndState);
        negVerbState.addTransition(new AnyCondition(), ntEndState);

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

        return m;
    }
View Full Code Here

    private Machine getNominalNegIndicatorMachine()
  {
      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);
 
      Machine m = new Machine(startState);
      State negPrepState = new NamedState("NEG_PREP");
      State negDetState = new NamedState("NEG_DET");
      State regNounState = new NamedState("REG_NOUN");
      Condition negPrepC = new TextSetCondition(iv_negPrepositionsSet, false);
      Condition negDetC = new TextSetCondition(iv_negDeterminersSet, false);
      Condition regNounC = new TextSetCondition(iv_regNounsSet, false);
 
      startState.addTransition(negDetC, negDetState); // start with a modal
   
      startState.addTransition(negPrepC, negPrepState);
      startState.addTransition(new AnyCondition(), startState);
 
      negPrepState.addTransition(new AnyCondition(), ntEndState);
      negDetState.addTransition(regNounC, regNounState);
      negDetState.addTransition(new AnyCondition(), ntEndState);
      negDetState.addTransition(new AnyCondition(), anyState);
 
      anyState.addTransition(regNounC, regNounState);
      anyState.addTransition(new AnyCondition(), anyState);
 
      regNounState.addTransition(new AnyCondition(), ntEndState);
 
      ntEndState.addTransition(new AnyCondition(), startState);
 
      return m;
  }
View Full Code Here

  private Machine getInitialNegIndicatorMachine()
    {
        State startState = new NamedState("START");
        State endState = new NamedState("END");

        State ntEndState = new NonTerminalEndState("NON TERMINAL END");
        endState.setEndStateFlag(true);
        ntEndState.setEndStateFlag(true);

        Machine m = new Machine(startState);
      
        State negDetState = new NamedState("NEG_DET");
View Full Code Here

TOP

Related Classes of org.apache.ctakes.core.fsm.state.NonTerminalEndState

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.