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

    leftNumIntegerState.addTransition(dashCondition, dashState);
    leftNumIntegerState.addTransition(new AnyCondition(), startState);

    leftNumRomanState.addTransition(dashCondition, dashState);
    leftNumRomanState.addTransition(new AnyCondition(), startState);

    leftNumTextState.addTransition(dashCondition, dashState);
    leftNumTextState.addTransition(new AnyCondition(), startState);

    dashState.addTransition(rightIntCondition, endState);
    dashState.addTransition(rightRomanNumeralCondition, endState);
    dashState.addTransition(rightNumTextCondition, endState);
    dashState.addTransition(new AnyCondition(), startState);

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

    return m;
  }
View Full Code Here


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

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

    numeratorNumState.addTransition(fslashCondition, fslashState);
    numeratorNumState.addTransition(textDenominatorCondition, endState);
    numeratorNumState.addTransition(new AnyCondition(), startState);

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

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

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

    return m;
  }
View Full Code Here

    iv_machineSet.add(getAdjNegIndicatorMachine());

  }

  private Machine getAspectualNegIndicatorMachine() {
    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 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");

    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 notCollocC = new NegateCondition(negCollocC);

    startState.addTransition(negVerbC, negVerbState);
    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 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);
View Full Code Here

   *  </ul>
   * <p> and D is anything
   * @return
   */
  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(), endState);

    return m;
  }
View Full Code Here

   * where A is unremarkable, unlikely, or negative
   * and B is of, in, for, or with
   */

  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(), endState);

    return m;
  }
View Full Code Here

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

    Machine m = new Machine(startState);
    State titleNameState = new NamedState("TITLENAME");

    Condition titleNameCondition = new WordSetCondition(iv_fullTextSet,
        false);
    Condition periodCondition = new PunctuationValueCondition('.');

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

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

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

    return m;
  }
View Full Code Here

     *
     * @return
     */
    private Machine getProbableMachine()
    {
        State startState = new NamedState("START");
        State endState = new NamedState("END");

        endState.setEndStateFlag(true);

        Machine m = new Machine(startState);

        Condition probableC = new TextSetCondition(iv_probableSet, false);

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

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

        return m;
    }
View Full Code Here

     *
     * @return
     */
    private Machine getHistoryMachine()
    {
        State startState = new NamedState("START");
        State endState = new NamedState("END");

        // for case h/o
        State hAbbrState = new NamedState("HISTORY_ABBR");
        State fslashState = new NamedState("FORWARD_SLASH");

        endState.setEndStateFlag(true);

        Machine m = new Machine(startState);

        Condition historyC = new TextSetCondition(iv_historySet, false);

        startState.addTransition(historyC, endState);
        startState
                .addTransition(new TextValueCondition("h", false), hAbbrState);
        startState.addTransition(new AnyCondition(), startState);

        hAbbrState.addTransition(
                new TextValueCondition("/", false),
                fslashState);
        hAbbrState.addTransition(new AnyCondition(), startState);

        fslashState.addTransition(new TextValueCondition("o", false), endState);
        fslashState.addTransition(new AnyCondition(), startState);

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

        return m;
    }
View Full Code Here

     *
     * @return
     */
    private Machine getFamilyHistoryMachine()
    {
        State startState = new NamedState("START");
        State endState = new NamedState("END");

        // for case h/o
        State familyState = new NamedState("FAMILY");

        endState.setEndStateFlag(true);

        Machine m = new Machine(startState);

        Condition familyHistoryC = new TextSetCondition(
                iv_familyHistorySet,
                false);

        startState.addTransition(familyHistoryC, endState);
        startState.addTransition(
                new TextValueCondition("family", false),
                familyState);
        startState.addTransition(new AnyCondition(), startState);

        familyState.addTransition(
                new TextValueCondition("history", false),
                endState);
        familyState.addTransition(new AnyCondition(), startState);

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

        return m;
    }
View Full Code Here

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

    Machine m = new Machine(startState);

    startState.addTransition(new RomanNumeralCondition(), 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.