Merge remote-tracking branch 'wmi_upstream/main'

This commit is contained in:
Pawel Felcyn 2023-11-27 14:01:38 +01:00
commit 1820fc5e14
138 changed files with 104328 additions and 344 deletions

344
README.md
View File

@ -23,347 +23,3 @@ W ten sposób będziemy aktualizować zadania co zajęcia.
Zadania robimy do końca soboty poprzedzającej zajęcia Zadania robimy do końca soboty poprzedzającej zajęcia
Rozwiązanie zapisujemy w pliku run.py Rozwiązanie zapisujemy w pliku run.py
## Zajęcia 2 Wyrażenia regularne
Dokumentacja wyrażeń regularnych w python3: https://docs.python.org/3/library/re.html
### Podstawowe funkcje
search - zwraca pierwsze dopasowanie w napisie
findall - zwraca listę wszystkich dopasowań (nienakładających się na siebie)
match - zwraca dopasowanie od początku string
To tylko podstawowe funkcje, z których będziemy korzystać. W dokumentacji opisane są wszystkie.
### Obiekt match
```
import re
answer = re.search('na','banan')
print(answer)
print(answer.start())
print(answer.end())
print(answer.group())
answer = re.search('na','kabanos')
print(answer)
type(answer)
if answer:
print(answer.group())
else:
pass
```
### Metaznaki
- [] - zbiór znaków
- . - jakikolwiek znak
- ^ - początek napisu
- $ - koniec napisu
- ? - znak występuje lub nie występuje
- \* - zero albo więcej pojawień się
- \+ - jeden albo więcej pojawień się
- {} - dokładnie tyle pojawień się
- | - lub
- () - grupa
- \ -znak ucieczki
- \d digit
- \D nie digit
- \s whitespace
- \S niewhitespace
### Flagi
Można użyć specjalnych flag, np:
`re.search('ma', 'AlA Ma KoTa', re.IGNORECASE)`.
### Przykłady (objaśnienia na laboratoriach)
Do nauki lepiej użyć pythona w wersji interaktywnej, a najlepiej ipython.
```
import re
text = 'Ala ma kota i hamak, oraz 150 bananów.'
re.search('ma',text)
re.match('ma',text)
re.match('Ala ma',text)
re.findall('ma',text)
re.findall('[mn]a',text)
re.findall('[0-9]',text)
re.findall('[0-9abc]',text)
re.findall('[a-z][a-z]ma[a-z]',text)
re.findall('[a-zA-Z][a-zA-Z]ma[a-zA-z0-9]',text)
re.findall('\d',text)
re.search('[0-9][0-9][0-9]',text)
re.search('[\d][\d][\d]',text)
re.search('\d{2}',text)
re.search('\d{3}',text)
re.search('\d+',text)
re.search('\d+ bananów',text)
re.search('\d* bananów','Ala ma dużo bananów')
re.search('\d* bananów',text)
re.search('ma \d? bananów','Ala ma 5 bananów')
re.search('ma ?\d? bananów','Ala ma bananów')
re.search('ma( \d)? bananów','Ala ma bananów')
re.search('\d+ bananów','Ala ma 10 bananów albo 20 bananów')
re.search('\d+ bananów$','Ala ma 10 bananów albo 20 bananów')
text = 'Ala ma kota i hamak, oraz 150 bananów.'
re.search('\d+ bananów',text)
re.search('\d+\sbananów',text)
re.search('kota . hamak',text)
re.search('kota . hamak','Ala ma kota z hamakiem')
re.search('kota .* hamak','Ala ma kota lub hamak')
re.search('\.',text)
re.search('kota|psa','Ala ma kota lub hamak')
re.findall('kota|psa','Ala ma kota lub psa')
re.search('kota (i|lub) psa','Ala ma kota lub psa')
re.search('mam (kota).*(kota|psa)','Ja mam kota. Ala ma psa.').group(0)
re.search('mam (kota).*(kota|psa)','Ja mam kota. Ala ma psa.').group(1)
re.search('mam (kota).*(kota|psa)','Ja mam kota. Ala ma psa.').group(2)
```
### Przykłady wyrażenia regularne 2 (objaśnienia na laboratoriach)
#### ^
```
re.search('[0-9]+', '123-456-789')
re.search('[^0-9][0-9]+[^0-9]', '123-456-789')
```
#### cudzysłów
'' oraz "" - oznaczają to samo w pythonie
' ala ma psa o imieniu "Burek"'
" ala ma psa o imieniu 'Burek' "
' ala ma psa o imieniu \'Burek\' '
" ala ma psa o imieniu \"Burek\" "
#### multiline string
#### raw string
przy raw string znaki \ traktowane są jako zwykłe znaki \
chociaż nawet w raw string nadal są escapowane (ale wtedy \ pozostają również w stringu bez zmian)
https://docs.python.org/3/reference/lexical_analysis.html
dobra praktyka - wszędzie escapować
```
'\\'
print('\\')
r'\\'
print(r'\\')
print("abcd")
print("ab\cd")
print(r"ab\cd")
print("ab\nd")
print(r"ab\nd")
print("\"")
print(r"\"")
print("\")
print(r"\")
re.search('\\', r'a\bc')
re.search(r'\\', r'a\bc')
re.search('\\\\', r'a\bc')
```
#### RE SUB
```
re.sub(pattern, replacement, string)
re.sub('a','b', 'ala ma kota')
```
#### backreferencje:
```
re.search(r' \d+ \d+', 'ala ma 41 41 kota')
re.search(r' \d+ \d+', 'ala ma 41 123 kota')
re.search(r' (\d+) \1', 'ala ma 41 41 kota')
re.search(r' (\d+) \1', 'ala ma 41 123 kota')
```
#### lookahead ( to sa takie assercje):
```
re.search(r'ma kot', 'ala ma kot')
re.search(r'ma kot(?=[ay])', 'ala ma kot')
re.search(r'ma kot(?=[ay])', 'ala ma kotka')
re.search(r'ma kot(?=[ay])', 'ala ma koty')
re.search(r'ma kot(?=[ay])', 'ala ma kota')
re.search(r'ma kot(?![ay])', 'ala ma kot')
re.search(r'ma kot(?![ay])', 'ala ma kotka')
re.search(r'ma kot(?![ay])', 'ala ma koty')
re.search(r'ma kot(?![ay])', 'ala ma kota')
```
#### named groups
```
r = re.search(r'ma (?P<ilepsow>\d+) kotow i (?P<ilekotow>\d+) psow', 'ala ma 100 kotow i 200 psow')
r.groups()
r.groups('ilepsow')
r.groups('ilekotow')
```
#### re.split
```
('a,b.c,d').split(',')
('a,b.c,d').split(',')
('a,b.c,d').split(',.')
re.split(r',', 'a,b.c,d')
re.split(r'[.,]', 'a,b.c,d')
```
#### \w word character
```
\w - matchuje Unicod word character , jeżeli flaga ASCII to [a-zA-Z0-9_]
\w - odwrotne do \W, jezeli flaga ASCI to [^a-zA-Z0-9_]
re.findall(r'\w+', 'ala ma 3 koty.')
re.findall(r'\W+', 'ala ma 3 koty.')
```
#### początek albo koniec słowa | word boundary
```
re.search(r'\bkot\b', 'Ala ma kota')
re.search(r'\bkot\b', 'Ala ma kot')
re.search(r'\bkot\b', 'Ala ma kot.')
re.search(r'\bkot\b', 'Ala ma kot ')
re.search(r'\Bot\B', 'Ala ma kot ')
re.search(r'\Bot\B', 'Ala ma kota ')
```
#### MULTILINE
```
re.findall(r'^Ma', 'Ma kota Ala\nMa psa Jacek')
re.findall(r'^Ma', 'Ma kota Ala\nMa psa Jacek', re.MULTILINE)
```
#### RE.COMPILE
## zajęcia 6
instalacja https://pypi.org/project/google-re2/
### DFA i NDFA
```
import re2 as re
n = 50
regexp = "a?"*n+"a"*n
s = "a"*n
re.match(regexp, s)
```
```
re.match(r"(\d)abc\1", "3abc3") # re2 nie obsługuje backreferencji
```
re2 max memory - podniesienie limitu
time # mierzenie czasu działania
gdyby ktoś chciał poczytać więcej:
https://swtch.com/~rsc/regexp/regexp1.html
### UTF-8
```
c = ""
ord(c)
chr(8459)
8* 16**2 + 0 * 16**(1) + 0*16**(0)
15*16**3 + 15* 16**2 + 15 * 16**(1) + 15*16**(0)
```
```
xxd -b file
xxd file
```
termin oddawania zadań - 15. listopada
## Zajęcia 7
https://www.openfst.org/twiki/bin/view/GRM/Thrax
https://www.cs.jhu.edu/~jason/465/hw-ofst/hw-ofst.pdf
Wszystkie zadania proszę robić na wzór `TaskH00`. Proszę umieszczać gramatykę w pliku `grammar.grm` oraz
opisywać finalną regułę nazwą `FinalRule`.
## KOLOKWIUM
Operatory, obowiązujące na kolokwium
====================================
* kwantyfikatory `-` `*` `+` `?` `{n}` `{n,}` `{n, m}`
* alternatywa — `|`
* klasy znaków — `[...]`
* zanegowane klasy znaków — `[^...]`
* dowolny znak — `.`
* unieważnianie znaków specjalnych — \
* operatory zakotwiczające — `^` `$`
Na kolokwium do każdego z 4 pytań będą 3 podpunkty. Na każdy podpunkt odpowiadamy TAK/NIE. Czas trwania to 15 minut.
- zawsze daszek i dolar
- nie bierzemy pod uwagę capturing (jeżeli są pytania o równoważne)
- proponuję wydrukować cały test w wersji bez opdowiedzi i sprawdzać
Do zaliczenia należy zdobyć conajmniej 10 punktów.

12
TaskC00/description.txt Normal file
View File

@ -0,0 +1,12 @@
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.

4041
TaskC00/long.arg Normal file

File diff suppressed because it is too large Load Diff

7
TaskC00/long.exp Normal file
View File

@ -0,0 +1,7 @@
NO
NO
YES
YES
NO
NO
NO

7
TaskC00/long.in Normal file
View File

@ -0,0 +1,7 @@
aaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
xyz
aba
a

16
TaskC00/test1.arg Normal file
View File

@ -0,0 +1,16 @@
0 1 x
1 2 y
2 3 z
0 4 y
0 4 z
1 4 x
1 4 z
2 4 x
2 4 y
3 4 x
3 4 y
3 4 z
4 4 x
4 4 y
4 4 z
3

9
TaskC00/test1.exp Normal file
View File

@ -0,0 +1,9 @@
NO
YES
NO
NO
NO
NO
NO
NO
NO

9
TaskC00/test1.in Normal file
View File

@ -0,0 +1,9 @@
xxyz
xyz
xy
zz
xxy
yzx
x
xyzz

7
TaskC00/testnfa.arg Normal file
View File

@ -0,0 +1,7 @@
0 1 a
1 0 a
1 2 b
2 4 c
1 3 b
3
4

8
TaskC00/testnfa.exp Normal file
View File

@ -0,0 +1,8 @@
YES
YES
NO
NO
NO
YES
NO
YES

8
TaskC00/testnfa.in Normal file
View File

@ -0,0 +1,8 @@
abc
ab
abcd
aaaabc
aaaaaaaabc
aaaaaaabc
zzz
aaaaaaabc

11
TaskC01/description.txt Normal file
View File

@ -0,0 +1,11 @@
Use a non deterministic finite-state automaton (FSA) engine from the TaskC00.
Create your own non deterministic FSA description to check whether the string second letter
from right is 'b'.
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.

6
TaskC01/test.exp Normal file
View File

@ -0,0 +1,6 @@
YES
YES
NO
NO
NO
YES

6
TaskC01/test.in Normal file
View File

@ -0,0 +1,6 @@
abc
abbc
bca
b
abaa
aaacbb

11
TaskC02/description.txt Normal file
View File

@ -0,0 +1,11 @@
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.

6
TaskC02/test.exp Normal file
View File

@ -0,0 +1,6 @@
YES
NO
YES
NO
YES
NO

6
TaskC02/test.in Normal file
View File

@ -0,0 +1,6 @@
ab
a
abbab
bbbbb
ababaab
b

10
TaskC03/description.txt Normal file
View File

@ -0,0 +1,10 @@
Use a non deterministic finite-state automaton (FSA) engine from the TaskC00.
Create your own non deterministic FSA description to check whether the string
contains "abc"
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.

7
TaskC03/test.exp Normal file
View File

@ -0,0 +1,7 @@
YES
YES
YES
NO
NO
NO
NO

7
TaskC03/test.in Normal file
View File

@ -0,0 +1,7 @@
abc
acabc
acabccb
abbab
bbbbb
ababaab
bc

22
TaskC04/description.txt Normal file
View File

@ -0,0 +1,22 @@
Deterministic automaton III
===========================
Read a description of a finite-state automaton in the AT&T format
(without weights) from the file in the first argument. Then, read strings from the
standard input. If a string is
accepted by the automated, write YES, a space and the string on the
standard output, otherwise — write NO, a space and the string.
If there is a non-determinism in the automaton, the first transition should be chosen.
The automaton can contain epsilon transitions ("<eps>" instead of a
character). They should be interpreted as follows: an epsilon
transition can be used (without "eating" a character from the input),
if there is no other transition applicable. You can assume that there
is at most one epsilon transition from a given state and that there
are no cycles with epsilon transition.
Your program does not have to check whether the description is correct
and whether the automaton is deterministic. You can assume that the
automaton does not contain epsilon transitions.

8
TaskC04/eps.arg Normal file
View File

@ -0,0 +1,8 @@
0 1 a
1 0 a
1 2 b
2 4 c
1 3 <eps>
3 4 d
3
4

10
TaskC04/eps.exp Normal file
View File

@ -0,0 +1,10 @@
TRUE a
FALSE aa
TRUE aaa
TRUE abc
TRUE aaabc
FALSE aaabcd
FALSE aabc
FALSE abd
TRUE ad
FALSE aad

10
TaskC04/eps.in Normal file
View File

@ -0,0 +1,10 @@
a
aa
aaa
abc
aaabc
aaabcd
aabc
abd
ad
aad

4041
TaskC04/long.arg Normal file

File diff suppressed because it is too large Load Diff

7
TaskC04/long.exp Normal file
View File

@ -0,0 +1,7 @@
FALSE aaa
FALSE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
TRUE aaaa
TRUE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
xyz
aba
a

5
TaskC04/simple1.arg Normal file
View File

@ -0,0 +1,5 @@
# prosty automat akceptujący tylko napis "abc"
0 1 a
1 2 b
2 3 c
3

8
TaskC04/simple1.exp Normal file
View File

@ -0,0 +1,8 @@
FALSE a
FALSE ab
TRUE abc
FALSE abcd
FALSE aaaaab
TRUE abc
FALSE xyz
FALSE 0

8
TaskC04/simple1.in Normal file
View File

@ -0,0 +1,8 @@
a
ab
abc
abcd
aaaaab
abc
xyz
0

9
TaskC04/simple2.arg Normal file
View File

@ -0,0 +1,9 @@
# automat akceptujący napis "ab*c" (b powielony dowolną liczbę razy) i "kot"
0 1 a
1 1 b
1 2 c
0 3 k
3 4 o
4 5 t
2
5

9
TaskC04/simple2.exp Normal file
View File

@ -0,0 +1,9 @@
TRUE kot
TRUE ac
TRUE abc
TRUE abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc
FALSE abcd
FALSE abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccc
FALSE kotek
FALSE kotabc
TRUE kot

9
TaskC04/simple2.in Normal file
View File

@ -0,0 +1,9 @@
kot
ac
abc
abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc
abcd
abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccc
kotek
kotabc
kot

49
TaskC05/description.txt Normal file
View File

@ -0,0 +1,49 @@
Dictionary
==========
Your program should read a finite-state automaton from file in the first argument.
The automaton is deterministic, you can assume it does not contain
cycles.
Each automaton path is labeled with a symbol sequence of the following form:
<input word>;<description>
e.g.:
biały;ADJ
dom;N
piła;N
piła;V
stali;N
stali;V
stali;ADJ
Next you should read words from the standard input.
For each word, you should all automaton
paths that begin a given word, the following symbol is ';'
(semicolon), e.g. for the word 'dom' we are looking for paths
beginning with 'dom;'. If there is no such path, the following message
should be printed:
<input word>;OOV
For instance, for the automaton given above and the input:
budynek
dom
piła
we should get:
budynek;OOV
dom;N
piła;N
piła;V
If there is more than one path for a given word, they should be given in alphabetical order.
The program does not have to check whether the automaton is correct
and whether it is deterministic and does not contain cycles.

31
TaskC05/elem.arg Normal file
View File

@ -0,0 +1,31 @@
0 1 b
0 2 d
0 3 p
0 4 s
1 5 i
2 6 o
3 7 i
4 8 t
5 9 a
6 10 m
7 11 ł
8 12 a
9 13 ł
10 14 ;
11 15 a
12 16 l
13 17 y
14 24 N
15 18 ;
16 19 i
17 20 ;
18 24 N
18 24 V
19 21 ;
20 22 A
21 22 A
21 24 N
21 24 V
22 23 D
23 24 J
24

1
TaskC05/elem.exp Normal file
View File

@ -0,0 +1 @@
dom;N

1
TaskC05/elem.in Normal file
View File

@ -0,0 +1 @@
dom

15125
TaskC05/medium.arg Normal file

File diff suppressed because it is too large Load Diff

7
TaskC05/medium.exp Normal file
View File

@ -0,0 +1,7 @@
arbuz;N
arbuza;N
arbuzowi;ADJ
arbuzowi;N
azylant;N
azylanci;N
azylantowie;OOV

6
TaskC05/medium.in Normal file
View File

@ -0,0 +1,6 @@
arbuz
arbuza
arbuzowi
azylant
azylanci
azylantowie

31
TaskC05/multi.arg Normal file
View File

@ -0,0 +1,31 @@
0 1 b
0 2 d
0 3 p
0 4 s
1 5 i
2 6 o
3 7 i
4 8 t
5 9 a
6 10 m
7 11 ł
8 12 a
9 13 ł
10 14 ;
11 15 a
12 16 l
13 17 y
14 24 N
15 18 ;
16 19 i
17 20 ;
18 24 N
18 24 V
19 21 ;
20 22 A
21 22 A
21 24 N
21 24 V
22 23 D
23 24 J
24

2
TaskC05/multi.exp Normal file
View File

@ -0,0 +1,2 @@
piła;N
piła;V

1
TaskC05/multi.in Normal file
View File

@ -0,0 +1 @@
piła

31
TaskC05/oov.arg Normal file
View File

@ -0,0 +1,31 @@
0 1 b
0 2 d
0 3 p
0 4 s
1 5 i
2 6 o
3 7 i
4 8 t
5 9 a
6 10 m
7 11 ł
8 12 a
9 13 ł
10 14 ;
11 15 a
12 16 l
13 17 y
14 24 N
15 18 ;
16 19 i
17 20 ;
18 24 N
18 24 V
19 21 ;
20 22 A
21 22 A
21 24 N
21 24 V
22 23 D
23 24 J
24

1
TaskC05/oov.exp Normal file
View File

@ -0,0 +1 @@
budynek;OOV

1
TaskC05/oov.in Normal file
View File

@ -0,0 +1 @@
budynek

21
TaskC06/description.txt Normal file
View File

@ -0,0 +1,21 @@
Paths
======
Your program should read a finite-state automaton from
the standard input.
The automaton is deterministic, you can assume it does not contain
cycles. The automaton alphabet is the set of Polish lower-case letters
(English letters plus: ą, ć, ę, ł, ń, ó, ś, ź and ż).
Your program should print, on standard output, all the paths of the
automaton in alphabetical order (to be precise: order induced by byte
codes of strings, not according to the standard Polish order). "Print
a path" means print a text line containing all subsequent characters.
The program does not have to check whether the automaton is correct
and whether it is deterministic and does not contain cycles.
Weights (if any) should be disregarded.
NOTE 1. You can add `LANG=C sort` to your Bash wrapper for the write sort.

50648
TaskC06/medium.exp Normal file

File diff suppressed because it is too large Load Diff

14774
TaskC06/medium.in Normal file

File diff suppressed because it is too large Load Diff

1
TaskC06/medium2.exp Normal file
View File

@ -0,0 +1 @@
a

13989
TaskC06/medium2.in Normal file

File diff suppressed because it is too large Load Diff

4
TaskC06/small.exp Normal file
View File

@ -0,0 +1,4 @@
biały
dom
piła
stali

18
TaskC06/small.in Normal file
View File

@ -0,0 +1,18 @@
0 1 b
0 2 d
0 3 p
0 4 s
1 5 i
2 6 o
3 7 i
4 8 t
5 9 a
6 14 m
7 10 ł
8 11 a
9 12 ł
10 14 a
11 13 l
12 14 y
13 14 i
14

3
TaskC06/small2.exp Normal file
View File

@ -0,0 +1,3 @@
biały
piła
stali

18
TaskC06/small2.in Normal file
View File

@ -0,0 +1,18 @@
0 1 b
0 2 d
0 3 p
0 4 s
1 5 i
2 6 o
3 7 i
4 8 t
5 9 a
6 15 m
7 10 ł
8 11 a
9 12 ł
10 14 a
11 13 l
12 14 y
13 14 i
14

3
TaskD01/description.txt Normal file
View File

@ -0,0 +1,3 @@
Write a program to find lines containing the word "Hamlet".
Do use regular expressions.

0
TaskD01/shakespeare.exp Normal file
View File

0
TaskD01/shakespeare.in Normal file
View File

2
TaskD01/simple.exp Normal file
View File

@ -0,0 +1,2 @@
Here comes Hamlet
Hamlet Hamlet again

3
TaskD01/simple.in Normal file
View File

@ -0,0 +1,3 @@
Here comes Hamlet
ABC
Hamlet Hamlet again

4
TaskD02/description.txt Normal file
View File

@ -0,0 +1,4 @@
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.

View File

View File

3
TaskD02/simple.exp Normal file
View File

@ -0,0 +1,3 @@
Pies ma Alę
Kot i pies to zwierzęta
pies

5
TaskD02/simple.in Normal file
View File

@ -0,0 +1,5 @@
Pies ma Alę
Ala ma psa
tu nic nie ma
Kot i pies to zwierzęta
pies

4
TaskD03/description.txt Normal file
View File

@ -0,0 +1,4 @@
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.

View File

View File

3
TaskD03/simple.exp Normal file
View File

@ -0,0 +1,3 @@
Kiedyś był 1934 r.
Kiedyś był 1934 r.fsdfsdfsdf
1934 r. to jakaś data

5
TaskD03/simple.in Normal file
View File

@ -0,0 +1,5 @@
Kiedyś był 1934 r.
Kiedyś był 1934 r.fsdfsdfsdf
Kiedyś był 1935 rok
1934 r. to jakaś data
1934 to też jakaś data

3
TaskD04/description.txt Normal file
View File

@ -0,0 +1,3 @@
Write a program to find all maximum substrings of digits.
Return only these substrings separated by spaces in their order.
Do use regular expressions.

View File

View File

4
TaskD04/simple.exp Normal file
View File

@ -0,0 +1,4 @@
34234 34 5
34535
34
1992 1999

5
TaskD04/simple.in Normal file
View File

@ -0,0 +1,5 @@
34234 34 dfd gfd 5
34535
fsdflskfjsdflk
fsdkfj sdf34fdfd
Firma powstała w 1992 r., z połączenia Authorware, Inc. (twórców pakietu Authorware) i MacroMind-Paracomp (producenta Macromind Director). W 1999 r. Macromedia zakupiła firmę Allaire i jej bi

36
TaskE00/description.txt Normal file
View File

@ -0,0 +1,36 @@
Liczby podzielne przez 5
========================
Napisać program, który wczytuje kolejne wiersze ze standardowego
wejścia i analizuje każdy wiersz (bez znaku końca wiersza). Należy w
jak największym stopniu wykorzystać wyrażenia regularne (np. nie wolno
użyć negacji jako operacji w danym języku programowania, jeśli da się
to wyrazić w samym wyrażeniu regularnym). Tam, gdzie to możliwe należy
użyć pojedynczego wyrażenia regularnego.
Write a program, which loads consecutive lines from standard input
and analyze every line (with no newline character). You should
use regular expressions to the greatest extent possible (e.g. you
can not use negation in the programming language if it is
possible to express the same in regular expression). Wherever possible,
use one regular expression.
Dla każdego napisu należy sprawdzić, czy zadany napis jest liczbą całkowitą
podzielną przez 5. Napis nie powinien zawierać zer nieznaczących.
Jeśli napis spełnia tak określony warunek, należy wypisać na
standardowym wyjściu 'yes', w przeciwnym razie — 'no'.
For each string check, if the given string is an integer divisible by 5.
The string should not contain leading zeros.
If the string fulfills the condition, you should print 'yes' on the
standard output and 'no' otherwise.
UWAGA! Zadanie przeznaczone dla studentów, których numer indeksu
dzieli się przez 10 z resztą 0.
Attention. The task is for students whose students id remainder of the division by 10 is 0.
POINTS: 1
DEADLINE: 2021-12-04 23:59:59
REMAINDER: 0/10

10
TaskE00/test.exp Normal file
View File

@ -0,0 +1,10 @@
yes
yes
no
yes
no
no
yes
no
yes
no

10
TaskE00/test.in Normal file
View File

@ -0,0 +1,10 @@
-1005
-50
-76
0
00
01000
1000
353
465
@!q

35
TaskE01/description.txt Normal file
View File

@ -0,0 +1,35 @@
Liczby podzielne przez 25
=========================
Napisać program, który wczytuje kolejne wiersze ze standardowego
wejścia i analizuje każdy wiersz (bez znaku końca wiersza). Należy w
jak największym stopniu wykorzystać wyrażenia regularne (np. nie wolno
użyć negacji jako operacji w danym języku programowania, jeśli da się
to wyrazić w samym wyrażeniu regularnym). Tam, gdzie to możliwe należy
użyć pojedynczego wyrażenia regularnego.
Write a program, which loads consecutive lines from standard input
and analyze every line (with no newline character). You should
use regular expressions to the greatest extent possible (e.g. you
can not use negation in the programming language if it is
possible to express the same in regular expression). Wherever possible,
use one regular expression.
Dla każdego napisu należy sprawdzić, czy zadany napis jest dodatnią liczbą
podzielną przez 25.
Jeśli napis spełnia tak określony warunek, należy wypisać na
standardowym wyjściu 'yes', w przeciwnym razie — 'no'.
For each string check, if the given string is a positive integer divisible by 25.
If the string fulfills the condition, you should print 'yes' on the
standard output and 'no' otherwise.
UWAGA! Zadanie przeznaczone dla studentów, których numer indeksu
dzieli się przez 10 z resztą 1.
Attention. The task is for students whose students id remainder of the division by 10 is 1.
POINTS: 1
DEADLINE: 2021-12-04 23:59:59
REMAINDER: 1/10

8
TaskE01/test.exp Normal file
View File

@ -0,0 +1,8 @@
no
yes
yes
yes
no
no
no
no

8
TaskE01/test.in Normal file
View File

@ -0,0 +1,8 @@
0
1000
111111125
25
353
465
@!q
x50

36
TaskE02/description.txt Normal file
View File

@ -0,0 +1,36 @@
Kody pocztowe
=============
Napisać program, który wczytuje kolejne wiersze ze standardowego
wejścia i analizuje każdy wiersz (bez znaku końca wiersza). Należy w
jak największym stopniu wykorzystać wyrażenia regularne (np. nie wolno
użyć negacji jako operacji w danym języku programowania, jeśli da się
to wyrazić w samym wyrażeniu regularnym). Tam, gdzie to możliwe należy
użyć pojedynczego wyrażenia regularnego.
Write a program, which loads consecutive lines from standard input
and analyze every line (with no newline character). You should
use regular expressions to the greatest extent possible (e.g. you
can not use negation in the programming language if it is
possible to express the same in regular expression). Wherever possible,
use one regular expression.
Dla każdego napisu należy wydobyć z kodu pocztowego kod miasta (2 pierwsze
cyfry). Jeśli napis nie jest kodem pocztowym, należy wypisać "<NONE>".
Zakładamy, że kod pocztowy składa się z 2 cyfr, minusa i 3 cyfr. Jeśli
napis nie spełnia podanych warunków, należy wypisać "<NONE>".
For each string, extract the postal code of a city (2 first digits).
If the string is not a postal code, you should print "<NONE>".
We assume that the postal code consists of 2 digits, minus character, and 3 digits.
If the string doesn't fulfill the condition, you should print "<NONE>".
UWAGA! Zadanie przeznaczone dla studentów, których numer indeksu
dzieli się przez 10 z resztą 2.
Attention. The task is for students whose students id remainder of the division by 10 is 2.
POINTS: 1
DEADLINE: 2021-12-04 23:59:59
REMAINDER: 2/10

6
TaskE02/test.exp Normal file
View File

@ -0,0 +1,6 @@
<NONE>
<NONE>
23
<NONE>
61
<NONE>

6
TaskE02/test.in Normal file
View File

@ -0,0 +1,6 @@
!@#$%^&
0-333
23-000
61-23
61-680
BigFoot

37
TaskE03/description.txt Normal file
View File

@ -0,0 +1,37 @@
Numer NIP
=========
Napisać program, który wczytuje kolejne wiersze ze standardowego
wejścia i analizuje każdy wiersz (bez znaku końca wiersza). Należy w
jak największym stopniu wykorzystać wyrażenia regularne (np. nie wolno
użyć negacji jako operacji w danym języku programowania, jeśli da się
to wyrazić w samym wyrażeniu regularnym). Tam, gdzie to możliwe należy
użyć pojedynczego wyrażenia regularnego.
Write a program, which loads consecutive lines from standard input
and analyze every line (with no newline character). You should
use regular expressions to the greatest extent possible (e.g. you
can not use negation in the programming language if it is
possible to express the same in regular expression). Wherever possible,
use one regular expression.
Dla każdego napisu należy sprawdzić, czy napis jest numerem NIP zapisanym w
formacie xxx-xxx-xx-xx bądź xxx-xx-xx-xxx. Nie trzeba brać pod uwagę sumy
kontrolnej.
Jeśli napis spełnia tak określony warunek, należy wypisać na
standardowym wyjściu 'yes', w przeciwnym razie — 'no'.
For each string check, if the string is NIP number written in
xxx-xxx-xx-xx bądź xxx-xx-xx-xxx format. You don't need to consider a checksum.
If the string fulfills the condition, you should print 'yes' on the
standard output and 'no' otherwise.
UWAGA! Zadanie przeznaczone dla studentów, których numer indeksu
dzieli się przez 10 z resztą 3.
Attention. The task is for students whose students id remainder of the division by 10 is 3.
POINTS: 1
DEADLINE: 2021-12-04 23:59:59
REMAINDER: 3/10

5
TaskE03/test.exp Normal file
View File

@ -0,0 +1,5 @@
yes
yes
yes
no
no

5
TaskE03/test.in Normal file
View File

@ -0,0 +1,5 @@
000-00-00-000
345-45-12-334
345-455-12-34
345-455-12-349
3454551234

37
TaskE04/description.txt Normal file
View File

@ -0,0 +1,37 @@
Telefon filmowy
===============
Napisać program, który wczytuje kolejne wiersze ze standardowego
wejścia i analizuje każdy wiersz (bez znaku końca wiersza). Należy w
jak największym stopniu wykorzystać wyrażenia regularne (np. nie wolno
użyć negacji jako operacji w danym języku programowania, jeśli da się
to wyrazić w samym wyrażeniu regularnym). Tam, gdzie to możliwe należy
użyć pojedynczego wyrażenia regularnego.
Write a program, which loads consecutive lines from standard input
and analyze every line (with no newline character). You should
use regular expressions to the greatest extent possible (e.g. you
can not use negation in the programming language if it is
possible to express the same in regular expression). Wherever possible,
use one regular expression.
Dla każdego napisu należy sprawdzić, czy napis jest 9-cyfrowym numerem
telefonu zapisanym w formacie "NNN-NNN-NNN" badź "NNN NNN NNN" zaczynającym
sie od kombinacji "555".
Jeśli napis spełnia tak określony warunek, należy wypisać na
standardowym wyjściu 'yes', w przeciwnym razie — 'no'.
For each string, you should check, if the string is a 9-digit phone number
written in "NNN-NNN-NNN" or "NNN NNN NNN" format, which starts with "555".
If the string fulfills the condition, you should print 'yes' on the
standard output and 'no' otherwise.
UWAGA! Zadanie przeznaczone dla studentów, których numer indeksu
dzieli się przez 10 z resztą 4.
Attention. The task is for students whose students id remainder of the division by 10 is 4.
POINTS: 1
DEADLINE: 2021-12-04 23:59:59
REMAINDER: 4/10

12
TaskE04/test.exp Normal file
View File

@ -0,0 +1,12 @@
no
no
no
yes
no
yes
no
yes
yes
no
no
no

12
TaskE04/test.in Normal file
View File

@ -0,0 +1,12 @@
055-555-555
505-324-555
551-233-455
555 000 000
555 000-000
555 123 456
555-000 000
555-000-000
555-123-456
556 345 667
556 345 6675
556 345-667

38
TaskE05/description.txt Normal file
View File

@ -0,0 +1,38 @@
Akronim
=======
Napisać program, który wczytuje kolejne wiersze ze standardowego
wejścia i analizuje każdy wiersz (bez znaku końca wiersza). Należy w
jak największym stopniu wykorzystać wyrażenia regularne (np. nie wolno
użyć negacji jako operacji w danym języku programowania, jeśli da się
to wyrazić w samym wyrażeniu regularnym). Tam, gdzie to możliwe należy
użyć pojedynczego wyrażenia regularnego.
Write a program, which loads consecutive lines from standard input
and analyze every line (with no newline character). You should
use regular expressions to the greatest extent possible (e.g. you
can not use negation in the programming language if it is
possible to express the same in regular expression). Wherever possible,
use one regular expression.
Dla każdego napisu należy sprawdzić, czy napis jest akronimem (ciągiem co
najmniej dwóch i co najwyżej pięciu wielkich liter. Dodatkowo należy
uwzględnić akronimy "PCMCIA" i "WYSIWYG".
Jeśli napis spełnia tak określony warunek, należy wypisać na
standardowym wyjściu 'yes', w przeciwnym razie — 'no'.
For each string, check if the string is an acronym (sequence
of at least 2 and at most 5 capital letters.
Additionally, you should include acronyms "PCMCIA" i "WYSIWYG".
If the string fulfills the condition, you should print 'yes' on the
standard output and 'no' otherwise.
UWAGA! Zadanie przeznaczone dla studentów, których numer indeksu
dzieli się przez 10 z resztą 5.
Attention. The task is for students whose students id remainder of the division by 10 is 5.
POINTS: 1
DEADLINE: 2021-12-04 23:59:59
REMAINDER: 5/10

11
TaskE05/test.exp Normal file
View File

@ -0,0 +1,11 @@
no
yes
yes
no
yes
yes
no
no
no
yes
yes

11
TaskE05/test.in Normal file
View File

@ -0,0 +1,11 @@
AAAAAA
ABCDE
ATX
P
PC
PCMCIA
PCMCIB
Pc
WYSIWYA
WYSIWYG
ZZZZ

35
TaskE06/description.txt Normal file
View File

@ -0,0 +1,35 @@
Liczba pięcio bądź sześciocyfrowa
=================================
Napisać program, który wczytuje kolejne wiersze ze standardowego
wejścia i analizuje każdy wiersz (bez znaku końca wiersza). Należy w
jak największym stopniu wykorzystać wyrażenia regularne (np. nie wolno
użyć negacji jako operacji w danym języku programowania, jeśli da się
to wyrazić w samym wyrażeniu regularnym). Tam, gdzie to możliwe należy
użyć pojedynczego wyrażenia regularnego.
Write a program, which loads consecutive lines from standard input
and analyze every line (with no newline character). You should
use regular expressions to the greatest extent possible (e.g. you
can not use negation in the programming language if it is
possible to express the same in regular expression). Wherever possible,
use one regular expression.
Dla każdego napisu należy sprawdzić, czy napis reprezentuje liczbę pięcio-
bądź sześciocyfrową. Liczba nie powinna zawierać zer nieznaczących.
Jeśli napis spełnia tak określony warunek, należy wypisać na
standardowym wyjściu 'yes', w przeciwnym razie — 'no'.
For each string, check if the given string represents
5 or 6 digits number. The number should not contain leading zeros.
If the string fulfills the condition, you should print 'yes' on the
standard output and 'no' otherwise.
UWAGA! Zadanie przeznaczone dla studentów, których numer indeksu
dzieli się przez 10 z resztą 6.
Attention. The task is for students whose students id remainder of the division by 10 is 6.
POINTS: 1
DEADLINE: 2021-12-04 23:59:59
REMAINDER: 6/10

10
TaskE06/test.exp Normal file
View File

@ -0,0 +1,10 @@
no
no
yes
yes
yes
yes
no
no
yes
yes

10
TaskE06/test.in Normal file
View File

@ -0,0 +1,10 @@
012345
0123456
10000
100001
12345
123456
333333333333
9999
99999
999999

35
TaskE07/description.txt Normal file
View File

@ -0,0 +1,35 @@
Gwiazdek
========
Napisać program, który wczytuje kolejne wiersze ze standardowego
wejścia i analizuje każdy wiersz (bez znaku końca wiersza). Należy w
jak największym stopniu wykorzystać wyrażenia regularne (np. nie wolno
użyć negacji jako operacji w danym języku programowania, jeśli da się
to wyrazić w samym wyrażeniu regularnym). Tam, gdzie to możliwe należy
użyć pojedynczego wyrażenia regularnego.
Write a program, which loads consecutive lines from standard input
and analyze every line (with no newline character). You should
use regular expressions to the greatest extent possible (e.g. you
can not use negation in the programming language if it is
possible to express the same in regular expression). Wherever possible,
use one regular expression.
Dla każdego napisu należy sprawdzić, czy napis składa się z samych gwiazdek
(co najmniej jednej).
Jeśli napis spełnia tak określony warunek, należy wypisać na
standardowym wyjściu 'yes', w przeciwnym razie — 'no'.
For each string, check if the given string consists of only asterisks (at least one).
If the string fulfills the condition, you should print 'yes' on the
standard output and 'no' otherwise.
UWAGA! Zadanie przeznaczone dla studentów, których numer indeksu
dzieli się przez 10 z resztą 7.
Attention. The task is for students whose students id remainder of the division by 10 is 7.
POINTS: 1
DEADLINE: 2021-12-04 23:59:59
REMAINDER: 7/10

7
TaskE07/test.exp Normal file
View File

@ -0,0 +1,7 @@
yes
yes
yes
yes
no
no
no

7
TaskE07/test.in Normal file
View File

@ -0,0 +1,7 @@
*
**
***
***********
*a
+
a*

38
TaskE08/description.txt Normal file
View File

@ -0,0 +1,38 @@
Chichot
=======
Napisać program, który wczytuje kolejne wiersze ze standardowego
wejścia i analizuje każdy wiersz (bez znaku końca wiersza). Należy w
jak największym stopniu wykorzystać wyrażenia regularne (np. nie wolno
użyć negacji jako operacji w danym języku programowania, jeśli da się
to wyrazić w samym wyrażeniu regularnym). Tam, gdzie to możliwe należy
użyć pojedynczego wyrażenia regularnego.
Write a program, which loads consecutive lines from standard input
and analyze every line (with no newline character). You should
use regular expressions to the greatest extent possible (e.g. you
can not use negation in the programming language if it is
possible to express the same in regular expression). Wherever possible,
use one regular expression.
Dla każdego napisu należy sprawdzić, czy napis jest chichotem tzn. "hi"
powtórzonym przynajmniej 2 razy, po czym następuje opcjonalny ciąg
wykrzykników.
Jeśli napis spełnia tak określony warunek, należy wypisać na
standardowym wyjściu 'yes', w przeciwnym razie — 'no'.
For each string, check if the given string consists of a sequence
"hi" repeated at least 2 times followed by optional sequences of
exclamation marks.
If the string fulfills the condition, you should print 'yes' on the
standard output and 'no' otherwise.
UWAGA! Zadanie przeznaczone dla studentów, których numer indeksu
dzieli się przez 10 z resztą 8.
Attention. The task is for students whose students id remainder of the division by 10 is 8.
POINTS: 1
DEADLINE: 2021-12-04 23:59:59
REMAINDER: 8/10

Some files were not shown because too many files have changed in this diff Show More