Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Javier Baliosian
Learning FSTs
Commits
14c5e776
Commit
14c5e776
authored
Sep 20, 2013
by
Matias Richart
Browse files
Merge branch 'withWeights' of github.com:baliosian/tau-fst into withWeights
parents
389afc2a
719da811
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/uy/edu/fing/mina/fsa/test/RateAndPower_LuPA.java
View file @
14c5e776
...
...
@@ -22,34 +22,85 @@ public class RateAndPower_LuPA {
public
Tffst
ruleTemplate
(
TfI
tfinp1
,
TfI
tfinp2
,
TfI
tfinp3
,
TfI
tfout4
,
TfI
tfout5
)
{
State
s0
=
new
State
();
State
s1
=
new
State
();
State
s2
=
new
State
();
State
s3
=
new
State
();
State
s4
=
new
State
();
State
s5
=
new
State
();
State
s0
0
=
new
State
();
State
s
0
1
=
new
State
();
State
s
0
2
=
new
State
();
State
s
0
3
=
new
State
();
State
s
0
4
=
new
State
();
State
s
0
5
=
new
State
();
Tffst
tffst
=
new
Tffst
();
tffst
.
setInitialState
(
s0
);
s5
.
setAccept
(
true
);
State
s10
=
new
State
();
State
s11
=
new
State
();
State
s12
=
new
State
();
State
s13
=
new
State
();
State
s14
=
new
State
();
State
s15
=
new
State
();
State
s20
=
new
State
();
State
s21
=
new
State
();
State
s22
=
new
State
();
State
s23
=
new
State
();
State
s24
=
new
State
();
State
s25
=
new
State
();
Tffst
tffst0
=
new
Tffst
();
tffst0
.
setInitialState
(
s00
);
s05
.
setAccept
(
true
);
Tffst
tffst1
=
new
Tffst
();
tffst1
.
setInitialState
(
s10
);
s15
.
setAccept
(
true
);
Tffst
tffst2
=
new
Tffst
();
tffst2
.
setInitialState
(
s20
);
s25
.
setAccept
(
true
);
s00
.
addOutTran
(
new
Transition
(
tfinp1
,
ActionTf
.
Epsilon
(),
s01
));
s00
.
addOutTran
(
new
Transition
(
tfinp1
.
not
(),
ActionTf
.
Epsilon
(),
s00
));
s01
.
addOutTran
(
new
Transition
(
tfinp2
,
ActionTf
.
Epsilon
(),
s02
));
s01
.
addOutTran
(
new
Transition
(
tfinp2
.
not
(),
ActionTf
.
Epsilon
(),
s01
));
s02
.
addOutTran
(
new
Transition
(
tfinp3
,
ActionTf
.
Epsilon
(),
s03
));
s02
.
addOutTran
(
new
Transition
(
tfinp3
.
not
(),
ActionTf
.
Epsilon
(),
s02
));
//----
s0
.
addOutTran
(
new
Transition
(
tfinp1
,
ActionTf
.
Epsilon
(),
s1
));
s0
.
addOutTran
(
new
Transition
(
tfinp1
.
not
(),
ActionTf
.
Epsilon
(),
s0
));
s11
.
addOutTran
(
new
Transition
(
tfinp1
,
ActionTf
.
Epsilon
(),
s12
));
s11
.
addOutTran
(
new
Transition
(
tfinp1
.
not
(),
ActionTf
.
Epsilon
(),
s11
));
s12
.
addOutTran
(
new
Transition
(
tfinp2
,
ActionTf
.
Epsilon
(),
s13
));
s12
.
addOutTran
(
new
Transition
(
tfinp2
.
not
(),
ActionTf
.
Epsilon
(),
s12
));
s1
.
addOutTran
(
new
Transition
(
tfinp
2
,
ActionTf
.
Epsilon
(),
s
2
));
s1
.
addOutTran
(
new
Transition
(
tfinp
2
.
not
(),
ActionTf
.
Epsilon
(),
s1
));
s1
0
.
addOutTran
(
new
Transition
(
tfinp
3
,
ActionTf
.
Epsilon
(),
s
11
));
s1
0
.
addOutTran
(
new
Transition
(
tfinp
3
.
not
(),
ActionTf
.
Epsilon
(),
s1
0
));
s2
.
addOutTran
(
new
Transition
(
tfinp3
,
ActionTf
.
Epsilon
(),
s3
));
s2
.
addOutTran
(
new
Transition
(
tfinp3
.
not
(),
ActionTf
.
Epsilon
(),
s2
));
//-------
s22
.
addOutTran
(
new
Transition
(
tfinp1
,
ActionTf
.
Epsilon
(),
s23
));
s22
.
addOutTran
(
new
Transition
(
tfinp1
.
not
(),
ActionTf
.
Epsilon
(),
s22
));
s
3
.
addOutTran
(
new
Transition
(
Event
Tf
.
Epsilon
(),
tfout4
,
s4
));
s
4
.
addOutTran
(
new
Transition
(
Event
Tf
.
Epsilon
(),
tfout5
,
s5
));
s
20
.
addOutTran
(
new
Transition
(
tfinp2
,
Action
Tf
.
Epsilon
(),
s21
));
s
20
.
addOutTran
(
new
Transition
(
tfinp2
.
not
(),
Action
Tf
.
Epsilon
(),
s20
));
//Utils.showDot(tffst.toDot("tffst before"));
s21
.
addOutTran
(
new
Transition
(
tfinp3
,
ActionTf
.
Epsilon
(),
s22
));
s21
.
addOutTran
(
new
Transition
(
tfinp3
.
not
(),
ActionTf
.
Epsilon
(),
s21
));
tffst
.
inLabelEpsilonRemoval
();
s03
.
addOutTran
(
new
Transition
(
EventTf
.
Epsilon
(),
tfout4
,
s04
));
s04
.
addOutTran
(
new
Transition
(
EventTf
.
Epsilon
(),
tfout5
,
s05
));
s13
.
addOutTran
(
new
Transition
(
EventTf
.
Epsilon
(),
tfout4
,
s14
));
s14
.
addOutTran
(
new
Transition
(
EventTf
.
Epsilon
(),
tfout5
,
s15
));
s23
.
addOutTran
(
new
Transition
(
EventTf
.
Epsilon
(),
tfout4
,
s24
));
s24
.
addOutTran
(
new
Transition
(
EventTf
.
Epsilon
(),
tfout5
,
s25
));
tffst0
.
inLabelEpsilonRemoval
();
tffst1
.
inLabelEpsilonRemoval
();
tffst2
.
inLabelEpsilonRemoval
();
//Utils.showDot(tffst.toDot("tffst after")
);
Tffst
tffst
=
tffst0
.
union
(
tffst1
).
union
(
tffst2
);
return
tffst
;
}
...
...
src/uy/edu/fing/mina/fsa/test/RateAndPower_small.java
View file @
14c5e776
...
...
@@ -89,12 +89,11 @@ public class RateAndPower_small {
}
Utils
.
showDot
(
rateAndPower
.
toDot
(
"before"
));
//rateAndPower = rateAndPower.kleene();
rateAndPower
.
setDeterministic
(
false
);
rateAndPower
.
determinize
();
rateAndPower
=
rateAndPower
.
kleene
();
Utils
.
writeDot
(
"/tmp/rateanpower.dot"
,
rateAndPower
.
toDot
(
"after"
));
// Utils.showDot(rateAndPower.toDot("after"));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment