From d1bf33f80923974830c1ffa15eb42a70a0e880ed Mon Sep 17 00:00:00 2001 From: Polevara Veronika Date: Thu, 9 Nov 2023 14:16:19 +0100 Subject: [PATCH 01/25] wykonane zadania z tasku C --- TaskC00/description.txt | 14 +++++++++ TaskC00/run.py | 64 +++++++++++++++++++++++++++++++++++++++++ TaskC00/testnfa.arg | 7 +++++ TaskC00/testnfa.exp | 8 ++++++ TaskC00/testnfa.in | 8 ++++++ TaskC00/testnfa.out | 8 ++++++ TaskC02/description.txt | 14 +++++++++ TaskC02/run.py | 64 +++++++++++++++++++++++++++++++++++++++++ TaskC02/test.arg | 6 ++++ TaskC02/test.exp | 6 ++++ TaskC02/test.in | 6 ++++ TaskC02/test.out | 6 ++++ 12 files changed, 211 insertions(+) create mode 100644 TaskC00/description.txt create mode 100644 TaskC00/run.py create mode 100644 TaskC00/testnfa.arg create mode 100644 TaskC00/testnfa.exp create mode 100644 TaskC00/testnfa.in create mode 100644 TaskC00/testnfa.out create mode 100644 TaskC02/description.txt create mode 100644 TaskC02/run.py create mode 100644 TaskC02/test.arg create mode 100644 TaskC02/test.exp create mode 100644 TaskC02/test.in create mode 100644 TaskC02/test.out diff --git a/TaskC00/description.txt b/TaskC00/description.txt new file mode 100644 index 0000000..218e0f9 --- /dev/null +++ b/TaskC00/description.txt @@ -0,0 +1,14 @@ +Read a description of a non-deterministic finite-state automaton in the AT&T format +(without weights) from the file in the first argument. + +Read strings from the standard input. +If a string is accepted by the +automaton, write YES, otherwise- write NO. + +The program is invoked like this: python run.py test1.arg < test1.in > test1.out + +Note that not all transitions must be included in description. +If no transition is given for the given state and letter, write NO. + +POINTS: 3 +DEADLINE: 2023-11-12 23:59:59 diff --git a/TaskC00/run.py b/TaskC00/run.py new file mode 100644 index 0000000..d69b60b --- /dev/null +++ b/TaskC00/run.py @@ -0,0 +1,64 @@ +import sys +import copy + +class FSA: + + def __init__(self): + self.initial_state = '0' + self.final_states = set() + + self.transitions = dict() + self.alphabet = set() + + def add_transition(self, state_from, state_to, symbol): + + if state_from in self.transitions.keys(): + if symbol not in self.transitions[state_from].keys(): + self.transitions[state_from][symbol] = {state_to} + else: + self.transitions[state_from][symbol] |= {state_to} + else: + self.transitions[state_from] = dict() + self.transitions[state_from][symbol] = {state_to} + + def add_final_state(self, state): + self.final_states.add(state) + def get_final_states(self, string): + current_states = {self.initial_state} + for symbol in string: + new_current_states = set() + for current_state in current_states: + try: + new_current_states |= self.transitions[current_state][symbol] + except: + pass + current_states = copy.deepcopy(new_current_states) + return current_states + + def accepts(self, string): + for final_state in self.get_final_states(string): + if final_state in self.final_states: + return True + return False + +fsa = FSA() + +table = open(sys.argv[1]) +for line in table: + line = line.rstrip() + + if len(line.split('\t')) == 3: + a, b, c = line.split('\t') + fsa.add_transition(a, b, c) + fsa.alphabet.add(c) + else: + fsa.add_final_state(line) + + +for line in sys.stdin: + line = line.rstrip() + + if fsa.accepts(line): + print('YES') + else: + print('NO') \ No newline at end of file diff --git a/TaskC00/testnfa.arg b/TaskC00/testnfa.arg new file mode 100644 index 0000000..75dc56c --- /dev/null +++ b/TaskC00/testnfa.arg @@ -0,0 +1,7 @@ +0 1 a +1 0 a +1 2 b +2 4 c +1 3 b +3 +4 diff --git a/TaskC00/testnfa.exp b/TaskC00/testnfa.exp new file mode 100644 index 0000000..c98399b --- /dev/null +++ b/TaskC00/testnfa.exp @@ -0,0 +1,8 @@ +YES +YES +NO +NO +NO +YES +NO +YES diff --git a/TaskC00/testnfa.in b/TaskC00/testnfa.in new file mode 100644 index 0000000..91bb05a --- /dev/null +++ b/TaskC00/testnfa.in @@ -0,0 +1,8 @@ +abc +ab +abcd +aaaabc +aaaaaaaabc +aaaaaaabc +zzz +aaaaaaabc diff --git a/TaskC00/testnfa.out b/TaskC00/testnfa.out new file mode 100644 index 0000000..e9d26f6 --- /dev/null +++ b/TaskC00/testnfa.out @@ -0,0 +1,8 @@ +YES +YES +NO +NO +NO +YES +NO +YES diff --git a/TaskC02/description.txt b/TaskC02/description.txt new file mode 100644 index 0000000..55ac747 --- /dev/null +++ b/TaskC02/description.txt @@ -0,0 +1,14 @@ +Use a non deterministic finite-state automaton (FSA) engine from the TaskC00. +Create your own non deterministic FSA description to check whether the string +ends with "ab" +Don't use external files like in TaskF00 (description should be included in run file). + +The alphabet is "a", "b", "C" + +Read strings from the standard input. +If a string is accepted by the +automaton, write YES, otherwise- write NO. + +POINTS: 3 +DEADLINE: 2023-11-12 23:59:59 +REMAINDER: 1/3 diff --git a/TaskC02/run.py b/TaskC02/run.py new file mode 100644 index 0000000..d69b60b --- /dev/null +++ b/TaskC02/run.py @@ -0,0 +1,64 @@ +import sys +import copy + +class FSA: + + def __init__(self): + self.initial_state = '0' + self.final_states = set() + + self.transitions = dict() + self.alphabet = set() + + def add_transition(self, state_from, state_to, symbol): + + if state_from in self.transitions.keys(): + if symbol not in self.transitions[state_from].keys(): + self.transitions[state_from][symbol] = {state_to} + else: + self.transitions[state_from][symbol] |= {state_to} + else: + self.transitions[state_from] = dict() + self.transitions[state_from][symbol] = {state_to} + + def add_final_state(self, state): + self.final_states.add(state) + def get_final_states(self, string): + current_states = {self.initial_state} + for symbol in string: + new_current_states = set() + for current_state in current_states: + try: + new_current_states |= self.transitions[current_state][symbol] + except: + pass + current_states = copy.deepcopy(new_current_states) + return current_states + + def accepts(self, string): + for final_state in self.get_final_states(string): + if final_state in self.final_states: + return True + return False + +fsa = FSA() + +table = open(sys.argv[1]) +for line in table: + line = line.rstrip() + + if len(line.split('\t')) == 3: + a, b, c = line.split('\t') + fsa.add_transition(a, b, c) + fsa.alphabet.add(c) + else: + fsa.add_final_state(line) + + +for line in sys.stdin: + line = line.rstrip() + + if fsa.accepts(line): + print('YES') + else: + print('NO') \ No newline at end of file diff --git a/TaskC02/test.arg b/TaskC02/test.arg new file mode 100644 index 0000000..ca71b55 --- /dev/null +++ b/TaskC02/test.arg @@ -0,0 +1,6 @@ +0 0 a +0 0 b +0 0 c +0 1 a +1 2 b +2 diff --git a/TaskC02/test.exp b/TaskC02/test.exp new file mode 100644 index 0000000..e09bb02 --- /dev/null +++ b/TaskC02/test.exp @@ -0,0 +1,6 @@ +YES +NO +YES +NO +YES +NO diff --git a/TaskC02/test.in b/TaskC02/test.in new file mode 100644 index 0000000..84f5cfd --- /dev/null +++ b/TaskC02/test.in @@ -0,0 +1,6 @@ +ab +a +abbab +bbbbb +ababaab +b diff --git a/TaskC02/test.out b/TaskC02/test.out new file mode 100644 index 0000000..e7f6515 --- /dev/null +++ b/TaskC02/test.out @@ -0,0 +1,6 @@ +YES +NO +YES +NO +YES +NO From 2d8a843df23732240982554f8e769e2c4c219f22 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sat, 25 Nov 2023 16:07:14 +0100 Subject: [PATCH 02/25] Upload files to 'TaskD01' --- TaskD01/description.txt | 5 +++++ TaskD01/run.py | 13 +++++++++++++ TaskD01/simple.exp | 2 ++ TaskD01/simple.in | 3 +++ TaskD01/simple.out | 2 ++ 5 files changed, 25 insertions(+) create mode 100644 TaskD01/description.txt create mode 100644 TaskD01/run.py create mode 100644 TaskD01/simple.exp create mode 100644 TaskD01/simple.in create mode 100644 TaskD01/simple.out diff --git a/TaskD01/description.txt b/TaskD01/description.txt new file mode 100644 index 0000000..f2365af --- /dev/null +++ b/TaskD01/description.txt @@ -0,0 +1,5 @@ +Write a program to find lines containing the word "Hamlet". +Do use regular expressions. + +POINTS: 1 +DEADLINE: 2023-11-26 23:59:59 \ No newline at end of file diff --git a/TaskD01/run.py b/TaskD01/run.py new file mode 100644 index 0000000..bdcf3a7 --- /dev/null +++ b/TaskD01/run.py @@ -0,0 +1,13 @@ +import re +import sys + +found_lines = [] + + +for line in sys.stdin: + if re.search(r'\bHamlet\b', line): + found_lines.append(line.strip()) + + +if found_lines: + print('\n'.join(found_lines), end='') \ No newline at end of file diff --git a/TaskD01/simple.exp b/TaskD01/simple.exp new file mode 100644 index 0000000..0064e87 --- /dev/null +++ b/TaskD01/simple.exp @@ -0,0 +1,2 @@ +Here comes Hamlet +Hamlet Hamlet again \ No newline at end of file diff --git a/TaskD01/simple.in b/TaskD01/simple.in new file mode 100644 index 0000000..24e23e3 --- /dev/null +++ b/TaskD01/simple.in @@ -0,0 +1,3 @@ +Here comes Hamlet +ABC +Hamlet Hamlet again \ No newline at end of file diff --git a/TaskD01/simple.out b/TaskD01/simple.out new file mode 100644 index 0000000..0064e87 --- /dev/null +++ b/TaskD01/simple.out @@ -0,0 +1,2 @@ +Here comes Hamlet +Hamlet Hamlet again \ No newline at end of file From ee2341d2187df89cdb45428fadacfe3e61d23f69 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sat, 25 Nov 2023 16:08:02 +0100 Subject: [PATCH 03/25] wykonane zadania z tasku D --- TaskD02/description.txt | 7 +++++++ TaskD02/run.py | 13 +++++++++++++ TaskD02/simple.exp | 3 +++ TaskD02/simple.in | 5 +++++ TaskD02/simple.out | 3 +++ 5 files changed, 31 insertions(+) create mode 100644 TaskD02/description.txt create mode 100644 TaskD02/run.py create mode 100644 TaskD02/simple.exp create mode 100644 TaskD02/simple.in create mode 100644 TaskD02/simple.out diff --git a/TaskD02/description.txt b/TaskD02/description.txt new file mode 100644 index 0000000..d10a828 --- /dev/null +++ b/TaskD02/description.txt @@ -0,0 +1,7 @@ +Write a program to find lines containing the word "pies" separated by spaces. +The word does not need to have space on the left if it is the line beginning or space on the right if it is line ending. +Return line no matter of word "pies" casing. +Do use regular expressions. + +POINTS: 1 +DEADLINE: 2023-11-26 23:59:59 \ No newline at end of file diff --git a/TaskD02/run.py b/TaskD02/run.py new file mode 100644 index 0000000..8128990 --- /dev/null +++ b/TaskD02/run.py @@ -0,0 +1,13 @@ +import re +import sys + +found_lines = [] + +for line in sys.stdin: + if re.search(r'\b\s*pies\s*\b', line, flags=re.IGNORECASE): + found_lines.append(line.strip()) + + +if found_lines: + print('\n'.join(found_lines), end='') + diff --git a/TaskD02/simple.exp b/TaskD02/simple.exp new file mode 100644 index 0000000..caa7f93 --- /dev/null +++ b/TaskD02/simple.exp @@ -0,0 +1,3 @@ +Pies ma Ale +Kot i pies to zwierzeta +pies \ No newline at end of file diff --git a/TaskD02/simple.in b/TaskD02/simple.in new file mode 100644 index 0000000..cbf2ba9 --- /dev/null +++ b/TaskD02/simple.in @@ -0,0 +1,5 @@ +Pies ma Ale +Ala ma psa +tu nic nie ma +Kot i pies to zwierzeta +pies \ No newline at end of file diff --git a/TaskD02/simple.out b/TaskD02/simple.out new file mode 100644 index 0000000..caa7f93 --- /dev/null +++ b/TaskD02/simple.out @@ -0,0 +1,3 @@ +Pies ma Ale +Kot i pies to zwierzeta +pies \ No newline at end of file From 92b31192b3bafb64a9418cb613de95ff543c48e5 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sat, 25 Nov 2023 16:08:20 +0100 Subject: [PATCH 04/25] wykonane zadania z tasku D --- TaskD03/description.txt | 6 ++++++ TaskD03/run.py | 14 ++++++++++++++ TaskD03/simple.exp | 3 +++ TaskD03/simple.in | 5 +++++ TaskD03/simple.out | 3 +++ 5 files changed, 31 insertions(+) create mode 100644 TaskD03/description.txt create mode 100644 TaskD03/run.py create mode 100644 TaskD03/simple.exp create mode 100644 TaskD03/simple.in create mode 100644 TaskD03/simple.out diff --git a/TaskD03/description.txt b/TaskD03/description.txt new file mode 100644 index 0000000..114f376 --- /dev/null +++ b/TaskD03/description.txt @@ -0,0 +1,6 @@ +Write a program to find lines containing date from 1900 to 1999 in format '19XX r.' no matter what on the left or right of the expression. +Note that part ' r.' is obligatory. +Do use regular expressions. + +POINTS: 1 +DEADLINE: 2023-11-26 23:59:59 \ No newline at end of file diff --git a/TaskD03/run.py b/TaskD03/run.py new file mode 100644 index 0000000..05f6da4 --- /dev/null +++ b/TaskD03/run.py @@ -0,0 +1,14 @@ +import re +import sys + + +found_lines = [] + +for line in sys.stdin: + if re.search(r'\b19\d{2}\s*r\.\b|\b\W19\d{2}\s*r\.\b|\b19\d{2}\s*r\.\W', line, flags=re.IGNORECASE): + found_lines.append(line.strip()) + + +if found_lines: + print('\n'.join(found_lines), end='') + diff --git a/TaskD03/simple.exp b/TaskD03/simple.exp new file mode 100644 index 0000000..175c58f --- /dev/null +++ b/TaskD03/simple.exp @@ -0,0 +1,3 @@ +Kiedys byl 1934 r. +Kiedys byl 1934 r.fsdfsdfsdf +1934 r. to jakas data \ No newline at end of file diff --git a/TaskD03/simple.in b/TaskD03/simple.in new file mode 100644 index 0000000..e3a93b7 --- /dev/null +++ b/TaskD03/simple.in @@ -0,0 +1,5 @@ +Kiedys byl 1934 r. +Kiedys byl 1934 r.fsdfsdfsdf +Kiedys byl 1935 rok +1934 r. to jakas data +1934 to tez jakas data \ No newline at end of file diff --git a/TaskD03/simple.out b/TaskD03/simple.out new file mode 100644 index 0000000..175c58f --- /dev/null +++ b/TaskD03/simple.out @@ -0,0 +1,3 @@ +Kiedys byl 1934 r. +Kiedys byl 1934 r.fsdfsdfsdf +1934 r. to jakas data \ No newline at end of file From f424d4529c4ba868bfe00baf9a62019f66fc25f6 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sat, 25 Nov 2023 16:08:43 +0100 Subject: [PATCH 05/25] wykonane zadania z tasku D --- TaskD04/description.txt | 6 ++++++ TaskD04/run.py | 21 +++++++++++++++++++++ TaskD04/simple.exp | 4 ++++ TaskD04/simple.in | 5 +++++ TaskD04/simple.out | 4 ++++ 5 files changed, 40 insertions(+) create mode 100644 TaskD04/description.txt create mode 100644 TaskD04/run.py create mode 100644 TaskD04/simple.exp create mode 100644 TaskD04/simple.in create mode 100644 TaskD04/simple.out diff --git a/TaskD04/description.txt b/TaskD04/description.txt new file mode 100644 index 0000000..4db2554 --- /dev/null +++ b/TaskD04/description.txt @@ -0,0 +1,6 @@ +Write a program to find all maximum substrings of digits. +Return only these substrings separated by spaces in their order. +Do use regular expressions. + +POINTS: 2 +DEADLINE: 2023-11-26 23:59:59 \ No newline at end of file diff --git a/TaskD04/run.py b/TaskD04/run.py new file mode 100644 index 0000000..fc5985a --- /dev/null +++ b/TaskD04/run.py @@ -0,0 +1,21 @@ +import re +import sys + +def remove_non_digits(line): + + return re.sub(r'[^0-9\s]', '', line) + + +processed_lines = [] + +for line in sys.stdin: + processed_line = remove_non_digits(line) + processed_line = re.sub(r'^\s+|\s+$', '', processed_line) + processed_line = re.sub(r'\s+', ' ', processed_line) + + digit_groups = re.findall(r'\d+', processed_line) + + if digit_groups: + processed_lines.append(' '.join(digit_groups)) + +print('\n'.join(processed_lines), end='') \ No newline at end of file diff --git a/TaskD04/simple.exp b/TaskD04/simple.exp new file mode 100644 index 0000000..c184ec8 --- /dev/null +++ b/TaskD04/simple.exp @@ -0,0 +1,4 @@ +34234 34 5 +34535 +34 +1992 1999 \ No newline at end of file diff --git a/TaskD04/simple.in b/TaskD04/simple.in new file mode 100644 index 0000000..df710ac --- /dev/null +++ b/TaskD04/simple.in @@ -0,0 +1,5 @@ +34234 34 dfd gfd 5 +34535 +fsdflskfjsdflk +fsdkfj sdf34fdfd +The company was established in 1992 from the merger of Authorware, Inc. (creators of the Authorware package) and MacroMind-Paracomp (producer of Macromind Director). In 1999, Macromedia purchased Allaire and its bi \ No newline at end of file diff --git a/TaskD04/simple.out b/TaskD04/simple.out new file mode 100644 index 0000000..c184ec8 --- /dev/null +++ b/TaskD04/simple.out @@ -0,0 +1,4 @@ +34234 34 5 +34535 +34 +1992 1999 \ No newline at end of file From 3da3b1c6348f9e0937a346dd7de9cc1c80ce9612 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:04:00 +0100 Subject: [PATCH 06/25] Delete 'TaskD01/description.txt' --- TaskD01/description.txt | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 TaskD01/description.txt diff --git a/TaskD01/description.txt b/TaskD01/description.txt deleted file mode 100644 index f2365af..0000000 --- a/TaskD01/description.txt +++ /dev/null @@ -1,5 +0,0 @@ -Write a program to find lines containing the word "Hamlet". -Do use regular expressions. - -POINTS: 1 -DEADLINE: 2023-11-26 23:59:59 \ No newline at end of file From 78e075793ba4937c234e79bd7dcd7281b0331d86 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:04:09 +0100 Subject: [PATCH 07/25] Delete 'TaskD01/run.py' --- TaskD01/run.py | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 TaskD01/run.py diff --git a/TaskD01/run.py b/TaskD01/run.py deleted file mode 100644 index bdcf3a7..0000000 --- a/TaskD01/run.py +++ /dev/null @@ -1,13 +0,0 @@ -import re -import sys - -found_lines = [] - - -for line in sys.stdin: - if re.search(r'\bHamlet\b', line): - found_lines.append(line.strip()) - - -if found_lines: - print('\n'.join(found_lines), end='') \ No newline at end of file From 3d295d51892434d6255228af6403149cca394b32 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:04:16 +0100 Subject: [PATCH 08/25] Delete 'TaskD01/simple.exp' --- TaskD01/simple.exp | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 TaskD01/simple.exp diff --git a/TaskD01/simple.exp b/TaskD01/simple.exp deleted file mode 100644 index 0064e87..0000000 --- a/TaskD01/simple.exp +++ /dev/null @@ -1,2 +0,0 @@ -Here comes Hamlet -Hamlet Hamlet again \ No newline at end of file From 3fd530b13be5a118eb89c2fd66dce802e3528723 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:04:20 +0100 Subject: [PATCH 09/25] Delete 'TaskD01/simple.in' --- TaskD01/simple.in | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 TaskD01/simple.in diff --git a/TaskD01/simple.in b/TaskD01/simple.in deleted file mode 100644 index 24e23e3..0000000 --- a/TaskD01/simple.in +++ /dev/null @@ -1,3 +0,0 @@ -Here comes Hamlet -ABC -Hamlet Hamlet again \ No newline at end of file From 5fc857b78cac5a063a2eb55d8677762f1c8ff219 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:04:26 +0100 Subject: [PATCH 10/25] Delete 'TaskD01/simple.out' --- TaskD01/simple.out | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 TaskD01/simple.out diff --git a/TaskD01/simple.out b/TaskD01/simple.out deleted file mode 100644 index 0064e87..0000000 --- a/TaskD01/simple.out +++ /dev/null @@ -1,2 +0,0 @@ -Here comes Hamlet -Hamlet Hamlet again \ No newline at end of file From 6ecd654deaf97696922a6b2dedfe7d703543d860 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:04:36 +0100 Subject: [PATCH 11/25] Delete 'TaskD02/description.txt' --- TaskD02/description.txt | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 TaskD02/description.txt diff --git a/TaskD02/description.txt b/TaskD02/description.txt deleted file mode 100644 index d10a828..0000000 --- a/TaskD02/description.txt +++ /dev/null @@ -1,7 +0,0 @@ -Write a program to find lines containing the word "pies" separated by spaces. -The word does not need to have space on the left if it is the line beginning or space on the right if it is line ending. -Return line no matter of word "pies" casing. -Do use regular expressions. - -POINTS: 1 -DEADLINE: 2023-11-26 23:59:59 \ No newline at end of file From eece10e455b94275c886295a6e07bd743ef9d5e9 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:04:40 +0100 Subject: [PATCH 12/25] Delete 'TaskD02/run.py' --- TaskD02/run.py | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 TaskD02/run.py diff --git a/TaskD02/run.py b/TaskD02/run.py deleted file mode 100644 index 8128990..0000000 --- a/TaskD02/run.py +++ /dev/null @@ -1,13 +0,0 @@ -import re -import sys - -found_lines = [] - -for line in sys.stdin: - if re.search(r'\b\s*pies\s*\b', line, flags=re.IGNORECASE): - found_lines.append(line.strip()) - - -if found_lines: - print('\n'.join(found_lines), end='') - From 6be920f80e018f566439e960b1b11d00a1b783c1 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:04:44 +0100 Subject: [PATCH 13/25] Delete 'TaskD02/simple.exp' --- TaskD02/simple.exp | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 TaskD02/simple.exp diff --git a/TaskD02/simple.exp b/TaskD02/simple.exp deleted file mode 100644 index caa7f93..0000000 --- a/TaskD02/simple.exp +++ /dev/null @@ -1,3 +0,0 @@ -Pies ma Ale -Kot i pies to zwierzeta -pies \ No newline at end of file From a6545fcaa5af8477d8c6a94ea760127839507b04 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:04:48 +0100 Subject: [PATCH 14/25] Delete 'TaskD02/simple.in' --- TaskD02/simple.in | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 TaskD02/simple.in diff --git a/TaskD02/simple.in b/TaskD02/simple.in deleted file mode 100644 index cbf2ba9..0000000 --- a/TaskD02/simple.in +++ /dev/null @@ -1,5 +0,0 @@ -Pies ma Ale -Ala ma psa -tu nic nie ma -Kot i pies to zwierzeta -pies \ No newline at end of file From 53dd677cfb255b4ffbafadb8c2daf680ac1f1aa3 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:04:52 +0100 Subject: [PATCH 15/25] Delete 'TaskD02/simple.out' --- TaskD02/simple.out | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 TaskD02/simple.out diff --git a/TaskD02/simple.out b/TaskD02/simple.out deleted file mode 100644 index caa7f93..0000000 --- a/TaskD02/simple.out +++ /dev/null @@ -1,3 +0,0 @@ -Pies ma Ale -Kot i pies to zwierzeta -pies \ No newline at end of file From bcc5dd15cb0a467569d8bd8b3354aa50c5eecabe Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:05:24 +0100 Subject: [PATCH 16/25] Delete 'TaskD03/description.txt' --- TaskD03/description.txt | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 TaskD03/description.txt diff --git a/TaskD03/description.txt b/TaskD03/description.txt deleted file mode 100644 index 114f376..0000000 --- a/TaskD03/description.txt +++ /dev/null @@ -1,6 +0,0 @@ -Write a program to find lines containing date from 1900 to 1999 in format '19XX r.' no matter what on the left or right of the expression. -Note that part ' r.' is obligatory. -Do use regular expressions. - -POINTS: 1 -DEADLINE: 2023-11-26 23:59:59 \ No newline at end of file From 24f8a1cceb610f941137888fd2fdede1668e177f Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:05:28 +0100 Subject: [PATCH 17/25] Delete 'TaskD03/run.py' --- TaskD03/run.py | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 TaskD03/run.py diff --git a/TaskD03/run.py b/TaskD03/run.py deleted file mode 100644 index 05f6da4..0000000 --- a/TaskD03/run.py +++ /dev/null @@ -1,14 +0,0 @@ -import re -import sys - - -found_lines = [] - -for line in sys.stdin: - if re.search(r'\b19\d{2}\s*r\.\b|\b\W19\d{2}\s*r\.\b|\b19\d{2}\s*r\.\W', line, flags=re.IGNORECASE): - found_lines.append(line.strip()) - - -if found_lines: - print('\n'.join(found_lines), end='') - From 2f1f8b61b275cd99e680a6096dbf15ffcd7d3516 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:05:31 +0100 Subject: [PATCH 18/25] Delete 'TaskD03/simple.exp' --- TaskD03/simple.exp | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 TaskD03/simple.exp diff --git a/TaskD03/simple.exp b/TaskD03/simple.exp deleted file mode 100644 index 175c58f..0000000 --- a/TaskD03/simple.exp +++ /dev/null @@ -1,3 +0,0 @@ -Kiedys byl 1934 r. -Kiedys byl 1934 r.fsdfsdfsdf -1934 r. to jakas data \ No newline at end of file From b77d5f4b785f551b96bdcb41b980e37adf9e779a Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:05:36 +0100 Subject: [PATCH 19/25] Delete 'TaskD03/simple.in' --- TaskD03/simple.in | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 TaskD03/simple.in diff --git a/TaskD03/simple.in b/TaskD03/simple.in deleted file mode 100644 index e3a93b7..0000000 --- a/TaskD03/simple.in +++ /dev/null @@ -1,5 +0,0 @@ -Kiedys byl 1934 r. -Kiedys byl 1934 r.fsdfsdfsdf -Kiedys byl 1935 rok -1934 r. to jakas data -1934 to tez jakas data \ No newline at end of file From 9d06315142a8e23dca1a3ba8d2fffddc2a81d988 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:05:41 +0100 Subject: [PATCH 20/25] Delete 'TaskD03/simple.out' --- TaskD03/simple.out | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 TaskD03/simple.out diff --git a/TaskD03/simple.out b/TaskD03/simple.out deleted file mode 100644 index 175c58f..0000000 --- a/TaskD03/simple.out +++ /dev/null @@ -1,3 +0,0 @@ -Kiedys byl 1934 r. -Kiedys byl 1934 r.fsdfsdfsdf -1934 r. to jakas data \ No newline at end of file From 70a8f23e6cfa5443f7c748e1727bfd837f5f140e Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:05:50 +0100 Subject: [PATCH 21/25] Delete 'TaskD04/description.txt' --- TaskD04/description.txt | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 TaskD04/description.txt diff --git a/TaskD04/description.txt b/TaskD04/description.txt deleted file mode 100644 index 4db2554..0000000 --- a/TaskD04/description.txt +++ /dev/null @@ -1,6 +0,0 @@ -Write a program to find all maximum substrings of digits. -Return only these substrings separated by spaces in their order. -Do use regular expressions. - -POINTS: 2 -DEADLINE: 2023-11-26 23:59:59 \ No newline at end of file From b7eaa6209f27245717ab1dfdc85a957ea5b25771 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:05:54 +0100 Subject: [PATCH 22/25] Delete 'TaskD04/run.py' --- TaskD04/run.py | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 TaskD04/run.py diff --git a/TaskD04/run.py b/TaskD04/run.py deleted file mode 100644 index fc5985a..0000000 --- a/TaskD04/run.py +++ /dev/null @@ -1,21 +0,0 @@ -import re -import sys - -def remove_non_digits(line): - - return re.sub(r'[^0-9\s]', '', line) - - -processed_lines = [] - -for line in sys.stdin: - processed_line = remove_non_digits(line) - processed_line = re.sub(r'^\s+|\s+$', '', processed_line) - processed_line = re.sub(r'\s+', ' ', processed_line) - - digit_groups = re.findall(r'\d+', processed_line) - - if digit_groups: - processed_lines.append(' '.join(digit_groups)) - -print('\n'.join(processed_lines), end='') \ No newline at end of file From cba04c64cbe05e905840168cab8c41e6a9aa91c7 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:06:01 +0100 Subject: [PATCH 23/25] Delete 'TaskD04/simple.exp' --- TaskD04/simple.exp | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 TaskD04/simple.exp diff --git a/TaskD04/simple.exp b/TaskD04/simple.exp deleted file mode 100644 index c184ec8..0000000 --- a/TaskD04/simple.exp +++ /dev/null @@ -1,4 +0,0 @@ -34234 34 5 -34535 -34 -1992 1999 \ No newline at end of file From 7aa19cf544f81d0f11909e6953b931333da97a70 Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:06:05 +0100 Subject: [PATCH 24/25] Delete 'TaskD04/simple.in' --- TaskD04/simple.in | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 TaskD04/simple.in diff --git a/TaskD04/simple.in b/TaskD04/simple.in deleted file mode 100644 index df710ac..0000000 --- a/TaskD04/simple.in +++ /dev/null @@ -1,5 +0,0 @@ -34234 34 dfd gfd 5 -34535 -fsdflskfjsdflk -fsdkfj sdf34fdfd -The company was established in 1992 from the merger of Authorware, Inc. (creators of the Authorware package) and MacroMind-Paracomp (producer of Macromind Director). In 1999, Macromedia purchased Allaire and its bi \ No newline at end of file From af19e6039da5560ba8fee29a0f93cf46ebfe956b Mon Sep 17 00:00:00 2001 From: Veronika Polevara Date: Sun, 10 Dec 2023 22:06:08 +0100 Subject: [PATCH 25/25] Delete 'TaskD04/simple.out' --- TaskD04/simple.out | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 TaskD04/simple.out diff --git a/TaskD04/simple.out b/TaskD04/simple.out deleted file mode 100644 index c184ec8..0000000 --- a/TaskD04/simple.out +++ /dev/null @@ -1,4 +0,0 @@ -34234 34 5 -34535 -34 -1992 1999 \ No newline at end of file