Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
fja
eval
Commits
c606d662
Commit
c606d662
authored
Feb 15, 2021
by
Vladimír Štill
Browse files
evalweb: More options and less hidden conversions in convert
parent
f56fd4a7
Pipeline
#66944
failed with stage
in 48 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
evalweb/evalweb.py
View file @
c606d662
...
...
@@ -24,8 +24,8 @@ tasks = {'DFA': 'DFA',
convs
=
{
'DFA'
:
'DFA'
,
'TOT'
:
'Totální DFA'
,
'MIN'
:
'Minimální DFA'
,
#
'CAN': 'Kanonický automat',
# TODO
#
'MIC': 'Mininální kanonický automat',
# TODO
'CAN'
:
'Kanonický automat'
,
'MIC'
:
'Mininální kanonický automat'
,
'EFA'
:
'NFA (s ε-kroky)'
,
'NFA'
:
'NFA bez ε-kroků'
,
'GRA'
:
'Regulární gramatika'
}
...
...
evalweb/web_checker.py
View file @
c606d662
...
...
@@ -128,14 +128,22 @@ class WebChecker:
def
convert
(
self
,
student_type
:
str
)
->
str
:
parser
=
Parser
()
if
self
.
task
in
{
"DFA"
,
"TOT"
,
"MIN"
}:
if
self
.
task
in
{
"DFA"
,
"TOT"
,
"MIN"
,
"CAN"
,
"MIC"
}:
dfa
=
dfa_transform
(
self
.
student_string
,
student_type
)
# avoid confusion by making the automaton total if the input
# formalism was not already DFA
if
student_type
!=
"DFA"
:
dfa
=
dfa
.
total
()
if
self
.
task
==
"DFA"
:
return
parser
.
dfa_to_str
(
dfa
.
canonize
()
)
return
parser
.
dfa_to_str
(
dfa
)
if
self
.
task
==
"TOT"
:
return
parser
.
dfa_to_str
(
dfa
.
total
().
canonize
())
return
parser
.
dfa_to_str
(
dfa
.
total
())
if
self
.
task
==
"CAN"
:
return
parser
.
dfa_to_str
(
dfa
.
canonize
())
if
self
.
task
==
"MIN"
:
return
parser
.
dfa_to_str
(
dfa
.
minimize
())
if
self
.
task
==
"MIC"
:
return
parser
.
dfa_to_str
(
dfa
.
minimize
().
canonize
())
nfa
=
nfa_transform
(
self
.
student_string
,
student_type
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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