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

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


        return m;
    }

    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


      return m;
  }

  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");

        Condition negInitDetC = new TextSetCondition(iv_negInitialDeterminersSet, true);

        startState.addTransition(negInitDetC, negDetState); // start with a modal
        startState.addTransition(new AnyCondition(), startState);

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

        return m;
    }

    private Machine getAdjNegIndicatorMachine()
    {
        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 regPrepState = new NamedState("REG_PREP");
        State negAdjState = new NamedState("NEG_ADJ");

        Condition regPrepC = new TextSetCondition(iv_regPrepositionsSet, false);
        Condition negAdjC = new TextSetCondition(iv_negAdjectivesSet, false);

        startState.addTransition(negAdjC, negAdjState); // start with a modal
        startState.addTransition(new AnyCondition(), startState);

        negAdjState.addTransition(regPrepC, regPrepState);
        regPrepState.addTransition(new AnyCondition(), ntEndState);
        negAdjState.addTransition(new AnyCondition(), startState);

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

        return m;
    }
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 hyphenatedDrugState = new NamedState("HYPH_DRUG");
    Condition hyphenatedDrugCondition = new WordSetCondition(
        iv_hyphenDrugSet, false);

    startState.addTransition(hyphenatedDrugCondition, endState);//hyphenatedDrugState);
    startState.addTransition(new AnyCondition(), startState);

    hyphenatedDrugState.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

    }

    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");
        Condition negInitDetC = new TextSetCondition(iv_negInitialDeterminersSet, true);
        startState.addTransition(negInitDetC, negDetState); // start with a modal
       
        startState.addTransition(new AnyCondition(), startState);

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

        endState.addTransition(new AnyCondition(), startState);
        return m;
    }
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

        return m;
    }

    private Machine getAdjNegIndicatorMachine()
    {
        State startState = new NamedState("START");
        State endState = new NamedState("END");
           endState.setEndStateFlag(true);
       

        Machine m = new Machine(startState);

     
        State negAdjState = new NamedState("NEG_ADJ");


        Condition negDetC = new TextSetCondition(iv_negDeterminersSet, false);

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

    

        return m;
    }
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

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.