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