From 20251d417f3f701cba634144b691cd1b5071526f Mon Sep 17 00:00:00 2001 From: Wojtek Date: Sat, 25 Nov 2023 00:56:48 +0100 Subject: [PATCH] poprawienie wykrywania spacji w automacie --- TaskB06/fsa_description.arg | 14 +++++++------- TaskB06/run.py | 5 +++++ TaskB07/dodatkowy_test.in | 4 +++- TaskB07/dodatkowy_test.out | 2 ++ TaskB07/fsa_description.arg | 16 ++++++++-------- TaskB07/run.py | 5 +++++ TaskB08/dodatkowy_test.in | 1 + TaskB08/dodatkowy_test.out | 1 + TaskB08/fsa_description.arg | 14 +++++++------- TaskB08/run.py | 5 +++++ TaskB09/dodatkowy_test.in | 1 + TaskB09/dodatkowy_test.out | 1 + TaskB09/fsa_description.arg | 16 ++++++++-------- TaskB09/run.py | 5 +++++ 14 files changed, 59 insertions(+), 31 deletions(-) diff --git a/TaskB06/fsa_description.arg b/TaskB06/fsa_description.arg index b485767..9476717 100644 --- a/TaskB06/fsa_description.arg +++ b/TaskB06/fsa_description.arg @@ -24,7 +24,7 @@ 0 0 x 0 0 y 0 0 z -0 0 '' +0 0 1 2 a 1 0 b 1 0 c @@ -51,7 +51,7 @@ 1 0 x 1 0 y 1 0 z -1 0 '' +1 0 2 0 a 2 0 b 2 0 c @@ -78,7 +78,7 @@ 2 0 x 2 0 y 2 0 z -2 0 '' +2 0 3 0 a 3 0 b 3 0 c @@ -105,7 +105,7 @@ 3 0 x 3 0 y 3 0 z -3 0 '' +3 0 4 0 a 4 0 b 4 0 c @@ -132,7 +132,7 @@ 4 0 x 4 0 y 4 0 z -4 0 '' +4 0 5 0 a 5 0 b 5 0 c @@ -159,7 +159,7 @@ 5 0 x 5 0 y 5 0 z -5 0 '' +5 0 6 6 a 6 6 b 6 6 c @@ -186,5 +186,5 @@ 6 6 x 6 6 y 6 6 z -6 6 '' +6 6 6 \ No newline at end of file diff --git a/TaskB06/run.py b/TaskB06/run.py index 389c398..bc5eb74 100644 --- a/TaskB06/run.py +++ b/TaskB06/run.py @@ -10,6 +10,11 @@ def read_aut(fsa_path): if len(parts) == 1: accepting_states.add(int(parts[0])) #print(accepting_states) + if len(parts) == 2: + state_from = int(parts[0]) + state_to = int(parts[1]) + symbol = ' ' + transisions[(state_from, symbol)] = state_to if len(parts) == 3: state_from = int(parts[0]) state_to = int(parts[1]) diff --git a/TaskB07/dodatkowy_test.in b/TaskB07/dodatkowy_test.in index 127243e..4f411bd 100644 --- a/TaskB07/dodatkowy_test.in +++ b/TaskB07/dodatkowy_test.in @@ -1,4 +1,6 @@ oph elia opheelia -ooooophelia \ No newline at end of file +ooooophelia + +ooooos ooooophelia \ No newline at end of file diff --git a/TaskB07/dodatkowy_test.out b/TaskB07/dodatkowy_test.out index f09ac88..3810588 100644 --- a/TaskB07/dodatkowy_test.out +++ b/TaskB07/dodatkowy_test.out @@ -2,3 +2,5 @@ NO NO NO YES +NO +YES diff --git a/TaskB07/fsa_description.arg b/TaskB07/fsa_description.arg index 4a320f4..c079095 100644 --- a/TaskB07/fsa_description.arg +++ b/TaskB07/fsa_description.arg @@ -24,7 +24,7 @@ 0 0 x 0 0 y 0 0 z -0 0 '' +0 0 1 0 a 1 0 b 1 0 c @@ -51,7 +51,7 @@ 1 0 x 1 0 y 1 0 z -1 0 '' +1 0 2 0 a 2 0 b 2 0 c @@ -78,7 +78,7 @@ 2 0 x 2 0 y 2 0 z -2 0 '' +2 0 3 0 a 3 0 b 3 0 c @@ -105,7 +105,7 @@ 3 0 x 3 0 y 3 0 z -3 0 '' +3 0 4 0 a 4 0 b 4 0 c @@ -132,7 +132,7 @@ 4 0 x 4 0 y 4 0 z -4 0 '' +4 0 5 0 a 5 0 b 5 0 c @@ -159,7 +159,7 @@ 5 0 x 5 0 y 5 0 z -5 0 '' +5 0 6 7 a 6 0 b 6 0 c @@ -186,7 +186,7 @@ 6 0 x 6 0 y 6 0 z -6 0 '' +6 0 7 7 a 7 7 b 7 7 c @@ -213,5 +213,5 @@ 7 7 x 7 7 y 7 7 z -7 7 '' +7 7 7 \ No newline at end of file diff --git a/TaskB07/run.py b/TaskB07/run.py index 389c398..bc5eb74 100644 --- a/TaskB07/run.py +++ b/TaskB07/run.py @@ -10,6 +10,11 @@ def read_aut(fsa_path): if len(parts) == 1: accepting_states.add(int(parts[0])) #print(accepting_states) + if len(parts) == 2: + state_from = int(parts[0]) + state_to = int(parts[1]) + symbol = ' ' + transisions[(state_from, symbol)] = state_to if len(parts) == 3: state_from = int(parts[0]) state_to = int(parts[1]) diff --git a/TaskB08/dodatkowy_test.in b/TaskB08/dodatkowy_test.in index eabe6af..d3a2352 100644 --- a/TaskB08/dodatkowy_test.in +++ b/TaskB08/dodatkowy_test.in @@ -2,3 +2,4 @@ juliet juuuuliet juliet ju liet +jdusadusa juuuu juliet \ No newline at end of file diff --git a/TaskB08/dodatkowy_test.out b/TaskB08/dodatkowy_test.out index c322bb3..7a8130d 100644 --- a/TaskB08/dodatkowy_test.out +++ b/TaskB08/dodatkowy_test.out @@ -2,3 +2,4 @@ YES YES NO NO +YES diff --git a/TaskB08/fsa_description.arg b/TaskB08/fsa_description.arg index 5376252..6a4ddeb 100644 --- a/TaskB08/fsa_description.arg +++ b/TaskB08/fsa_description.arg @@ -24,7 +24,7 @@ 0 0 x 0 0 y 0 0 z -0 0 '' +0 0 1 0 a 1 0 b 1 0 c @@ -51,7 +51,7 @@ 1 0 x 1 0 y 1 0 z -1 0 '' +1 0 2 0 a 2 0 b 2 0 c @@ -78,7 +78,7 @@ 2 0 x 2 0 y 2 0 z -2 0 '' +2 0 3 0 a 3 0 b 3 0 c @@ -105,7 +105,7 @@ 3 0 x 3 0 y 3 0 z -3 0 '' +3 0 4 0 a 4 0 b 4 0 c @@ -132,7 +132,7 @@ 4 0 x 4 0 y 4 0 z -4 0 '' +4 0 5 0 a 5 0 b 5 0 c @@ -159,7 +159,7 @@ 5 0 x 5 0 y 5 0 z -5 0 '' +5 0 6 6 a 6 6 b 6 6 c @@ -186,5 +186,5 @@ 6 6 x 6 6 y 6 6 z -6 6 '' +6 6 6 \ No newline at end of file diff --git a/TaskB08/run.py b/TaskB08/run.py index 389c398..bc5eb74 100644 --- a/TaskB08/run.py +++ b/TaskB08/run.py @@ -10,6 +10,11 @@ def read_aut(fsa_path): if len(parts) == 1: accepting_states.add(int(parts[0])) #print(accepting_states) + if len(parts) == 2: + state_from = int(parts[0]) + state_to = int(parts[1]) + symbol = ' ' + transisions[(state_from, symbol)] = state_to if len(parts) == 3: state_from = int(parts[0]) state_to = int(parts[1]) diff --git a/TaskB09/dodatkowy_test.in b/TaskB09/dodatkowy_test.in index c65602f..b13f752 100644 --- a/TaskB09/dodatkowy_test.in +++ b/TaskB09/dodatkowy_test.in @@ -6,3 +6,4 @@ a macbeth mac beth m a c beth +smacbet h h diff --git a/TaskB09/dodatkowy_test.out b/TaskB09/dodatkowy_test.out index a699e04..d3f0edc 100644 --- a/TaskB09/dodatkowy_test.out +++ b/TaskB09/dodatkowy_test.out @@ -6,3 +6,4 @@ NO NO NO NO +NO diff --git a/TaskB09/fsa_description.arg b/TaskB09/fsa_description.arg index bdec15a..5b5d8d5 100644 --- a/TaskB09/fsa_description.arg +++ b/TaskB09/fsa_description.arg @@ -24,7 +24,7 @@ 0 0 x 0 0 y 0 0 z -0 0 '' +0 0 1 2 a 1 0 b 1 0 c @@ -51,7 +51,7 @@ 1 0 x 1 0 y 1 0 z -1 0 '' +1 0 2 0 a 2 0 b 2 3 c @@ -78,7 +78,7 @@ 2 0 x 2 0 y 2 0 z -2 0 '' +2 0 3 0 a 3 4 b 3 0 c @@ -105,7 +105,7 @@ 3 0 x 3 0 y 3 0 z -3 0 '' +3 0 4 0 a 4 0 b 4 0 c @@ -132,7 +132,7 @@ 4 0 x 4 0 y 4 0 z -4 0 '' +4 0 5 0 a 5 0 b 5 0 c @@ -159,7 +159,7 @@ 5 0 x 5 0 y 5 0 z -5 0 '' +5 0 6 0 a 6 0 b 6 0 c @@ -186,7 +186,7 @@ 6 0 x 6 0 y 6 0 z -6 0 '' +6 0 7 7 a 7 7 b 7 7 c @@ -213,5 +213,5 @@ 7 7 x 7 7 y 7 7 z -7 7 '' +7 7 7 \ No newline at end of file diff --git a/TaskB09/run.py b/TaskB09/run.py index 389c398..bc5eb74 100644 --- a/TaskB09/run.py +++ b/TaskB09/run.py @@ -10,6 +10,11 @@ def read_aut(fsa_path): if len(parts) == 1: accepting_states.add(int(parts[0])) #print(accepting_states) + if len(parts) == 2: + state_from = int(parts[0]) + state_to = int(parts[1]) + symbol = ' ' + transisions[(state_from, symbol)] = state_to if len(parts) == 3: state_from = int(parts[0]) state_to = int(parts[1])