* </ol>
*
* @return
*/
private Machine getDailyMachine() {
State startState = new NamedState("START");
State endState = new NamedState("END");
State ntEndState = new NonTerminalEndState("NON TERMINAL END");
ntEndState.setEndStateFlag(true);
endState.setEndStateFlag(true);
Machine m = new Machine(startState);
State leftAbbreviateState = new NamedState("LEFT_FREQ");
State clockState = new NamedState("CLOCK");
//2 and 3 letter latin abbreviations
State leftAbbreviateAState = new NamedState("LEFT_A");
State leftAbbreviatePState = new NamedState("LEFT_P");
State leftAbbreviateQState = new NamedState("LEFT_Q");
State leftAbbreviateOState = new NamedState("LEFT_O");
State leftAbbreviateHState = new NamedState("LEFT_H");
// 2 letter latin abbreviations
State rightAbbreviateODState = new NamedState("RIGHT_OD");
State rightAbbreviateQDState = new NamedState("RIGHT_QD");
State rightAbbreviateHSState = new NamedState("RIGHT_HS");
State rightAbbreviateAMState = new NamedState("RIGHT_AM");
State rightAbbreviatePMState = new NamedState("RIGHT_PM");
// 3 letter latin abbreviations
State middleAbbreviateQtoHState = new NamedState("MID_Q2H");
State rightAbbreviateQHSState = new NamedState("RIGHT_QHS");
State secondDotQtoHState = new NamedState("SECONDDOTQ2H");
State firstDotAState = new NamedState("FIRSTDOTA");
State firstDotPState = new NamedState("FIRSTDOTP");
State firstDotQState = new NamedState("FIRSTDOTQ");
State firstDotOState = new NamedState("FIRSTDOTO");
State firstDotHState = new NamedState("FIRSTDOTH");
Condition specificWordCondition = new TextSetCondition(
iv_dailyWordSet, false);
Condition soloCondition = new TextSetCondition(iv_perDayWordSet, false);
Condition containsSoloTermCondition = new ContainsSetTextValueCondition(
iv_perDayWordSet, false);
startState.addTransition(new TextValueCondition("q", false),
leftAbbreviateQState);
startState.addTransition(new TextValueCondition("o", false),
leftAbbreviateOState);
startState.addTransition(new TextValueCondition("h", false),
leftAbbreviateHState);
startState.addTransition(new IntegerRangeCondition(1,12), clockState);
startState.addTransition(new TimeCondition(), endState);
startState.addTransition(new TextValueCondition("bed", false),
leftAbbreviateState);
startState.addTransition(new TextValueCondition("per", false),
leftAbbreviateState);
startState.addTransition(specificWordCondition, endState);
startState.addTransition(soloCondition, endState);
startState.addTransition(containsSoloTermCondition, endState);
startState.addTransition(new AnyCondition(), startState);
clockState.addTransition(new TextValueCondition("a", false),
leftAbbreviateAState);
clockState.addTransition(new TextValueCondition("p", false),
leftAbbreviatePState);
clockState.addTransition(new AnyCondition(), startState);
leftAbbreviateState.addTransition(specificWordCondition, endState);
leftAbbreviateState.addTransition(new TextValueCondition("time", false), endState);
leftAbbreviateState.addTransition(new AnyCondition(), startState);
leftAbbreviateQState.addTransition(new PunctuationValueCondition('.'), firstDotQState);
leftAbbreviateQState.addTransition(new AnyCondition(), startState);
leftAbbreviateOState.addTransition(new PunctuationValueCondition('.'), firstDotOState);
leftAbbreviateOState.addTransition(new AnyCondition(), startState);
leftAbbreviateHState.addTransition(new PunctuationValueCondition('.'), firstDotHState);
leftAbbreviateHState.addTransition(new AnyCondition(), startState);
firstDotQState.addTransition(new TextValueCondition("d", false),
rightAbbreviateQDState);
firstDotQState.addTransition(new TextValueCondition("h", false),
middleAbbreviateQtoHState);
firstDotQState.addTransition(new AnyCondition(), startState);
firstDotOState.addTransition(new TextValueCondition("d", false),
rightAbbreviateODState);
firstDotOState.addTransition(new AnyCondition(), startState);
middleAbbreviateQtoHState.addTransition(new PunctuationValueCondition('.'),
secondDotQtoHState);
middleAbbreviateQtoHState.addTransition(new AnyCondition(), startState);
leftAbbreviateAState.addTransition(new PunctuationValueCondition('.'), firstDotAState);
//leftAbbreviateAState.addTransition(soloCondition, endState);
leftAbbreviateAState.addTransition(new AnyCondition(), startState);
leftAbbreviatePState.addTransition(new PunctuationValueCondition('.'), firstDotPState);
leftAbbreviatePState.addTransition(new AnyCondition(), startState);
firstDotAState.addTransition(new TextValueCondition("m", false),
rightAbbreviateAMState);
firstDotAState.addTransition(new AnyCondition(), startState);
firstDotPState.addTransition(new TextValueCondition("m", false),
rightAbbreviatePMState);
firstDotPState.addTransition(new AnyCondition(), startState);
secondDotQtoHState.addTransition(new TextValueCondition("s", false),
rightAbbreviateQHSState);
secondDotQtoHState.addTransition(new AnyCondition(), startState);
rightAbbreviateAMState.addTransition(new PunctuationValueCondition('.'), endState);
rightAbbreviateAMState.addTransition(new AnyCondition(), startState);
rightAbbreviatePMState.addTransition(new PunctuationValueCondition('.'), endState);
rightAbbreviatePMState.addTransition(new AnyCondition(), startState);
firstDotHState.addTransition(new TextValueCondition("s", false),
rightAbbreviateHSState);
firstDotHState.addTransition(new AnyCondition(), startState);
rightAbbreviateODState.addTransition(new PunctuationValueCondition('.'), endState);
rightAbbreviateODState.addTransition(new AnyCondition(), startState);
rightAbbreviateQDState.addTransition(new PunctuationValueCondition('.'), endState);