From f04c8165644573730936732f1bba3dada1996155 Mon Sep 17 00:00:00 2001 From: Filip Gralinski Date: Sat, 2 Jan 2021 12:59:27 +0100 Subject: [PATCH] test new task --- TaskG01/description.txt | 44 +++++++++++++++++++++++++++++++++++++++++ TaskG01/simple.exp | 24 ++++++++++++++++++++++ TaskG01/simple.in | 24 ++++++++++++++++++++++ blend.sh | 2 +- 4 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 TaskG01/description.txt create mode 100644 TaskG01/simple.exp create mode 100644 TaskG01/simple.in diff --git a/TaskG01/description.txt b/TaskG01/description.txt new file mode 100644 index 0000000..8f08d72 --- /dev/null +++ b/TaskG01/description.txt @@ -0,0 +1,44 @@ +UNDER TESTING. DO NOT SOLVE YET. + +Use regular expressions to mark Polish first-person masculine forms. + +You should handle the following types of expressions: + +* first-person masculine past forms of verbs ("zrobiłem", "pisałem", etc.), +* first-person singular masculine forms of the verb "być" ("be") combined + with singular masculine nominative forms of adjectives ("wysoki", "sprytny", etc.), + assuming that the form of the verb "być" is to the left of the adjective, not + more than 3 other words, +* the verb "będę" combined with the past participle (i.e. 3rd person + masculine imperfect form, e.g. "robił", pisał"), assuming + that "będę" is to the left of the adjective, not + more than 3 other words to the left of the participle OR directly + to the right of the participle ("robił będę"). + +The first-person masculine forms should be marked with curly brackets. +You should mark only the masculine form. Do not mark the form of "być" +(unless it clearly a masculine form, i.e. for "byłem"). + +The match should case-insensitive. + +The PoliMorf dictionary of inflected forms should be applied: +http://zil.ipipan.waw.pl/PoliMorf?action=AttachFile&do=get&target=PoliMorf-0.6.7.tab.gz + +Suggested steps: + +1. Extract all the needed forms from the PoliMorf dictionary: + +* 1st person masculine past forms of verbs +* singular masculine nominative forms of adjectives +* masculine past participle (3rd person masculine imperfect forms of verbs) + +You could do this using grep/cut commands — to obtain a simple text files +with a word in each line. You can do this once and commit the 3 files to your repository. + +2. In your `run` script/program, read the 3 files and create a large +expression with alternatives. Use a regexp library based on DFAs (determintistic +finite-automatons). + +POINTS: 4 +DEADLINE: 2021-01-20 15:30:00 +REMAINDER: 0/2 diff --git a/TaskG01/simple.exp b/TaskG01/simple.exp new file mode 100644 index 0000000..cafc8d1 --- /dev/null +++ b/TaskG01/simple.exp @@ -0,0 +1,24 @@ +Tu nic nie ma. +Wczoraj {ugotowałem} ziemniaki. +{Jechałem}, {jechałem} i {jechałem}, a potem się {zatrzymałem}. +{Umyłem} się mydłem. +Jestem {wysoki}. +Jest wysoki. +Mówią, że jestem od zawsze niezwykle {sprytny}. +aaaa {byłem} aaa {zielony} ddd +aaaa {byłem} aaa bbb {zielony} ddd +aaaa {byłem} aaa bbb ccc {zielony} ddd +aaaa {byłem} aaa bbb ccc ddd zielony ddd +aaaa był aaa bbb zielony ddd +aaaa byłam aaa bbb zielony ddd +aaaa byłam aaa bbb zielona ddd +teraz będę {pisał} książkę +będę teraz {pisał} książkę +będę teraz dla ciebie {pisał} książkę +teraz dla ciebie {pisał} będę księżkę +będę i on napisał książkę +aaa będę {śpiewał} bbb +aaa będę ccc {śpiewał} bbb +aaa będę ccc ddd {śpiewał} bbb +aaa będę ccc ddd eee {śpiewał} bbb +aaa będę ccc ddd eee fff śpiewał bbb diff --git a/TaskG01/simple.in b/TaskG01/simple.in new file mode 100644 index 0000000..0670aed --- /dev/null +++ b/TaskG01/simple.in @@ -0,0 +1,24 @@ +Tu nic nie ma. +Wczoraj ugotowałem ziemniaki. +Jechałem, jechałem i jechałem, a potem się zatrzymałem. +Umyłem się mydłem. +Jestem wysoki. +Jest wysoki. +Mówią, że jestem od zawsze niezwykle sprytny. +aaaa byłem aaa zielony ddd +aaaa byłem aaa bbb zielony ddd +aaaa byłem aaa bbb ccc zielony ddd +aaaa byłem aaa bbb ccc ddd zielony ddd +aaaa był aaa bbb zielony ddd +aaaa byłam aaa bbb zielony ddd +aaaa byłam aaa bbb zielona ddd +teraz będę pisał książkę +będę teraz pisał książkę +będę teraz dla ciebie pisał książkę +teraz dla ciebie pisał będę księżkę +będę i on napisał książkę +aaa będę śpiewał bbb +aaa będę ccc śpiewał bbb +aaa będę ccc ddd śpiewał bbb +aaa będę ccc ddd eee śpiewał bbb +aaa będę ccc ddd eee fff śpiewał bbb diff --git a/blend.sh b/blend.sh index 994d759..9d2eac0 100755 --- a/blend.sh +++ b/blend.sh @@ -21,7 +21,7 @@ cp "${PREFIX}/count-points.pl" arena/ cp "${PREFIX}/overrides.txt" arena/ cp "${PREFIX}/Makefile" arena/ -for TX in X01 X02 X03 A01 B01 B02 B03 B04 D00 D01 D02 D03 D04 D05 E00 E01 E02 E03 E04 E05 E06 E07 E08 E09 F00 F01 F02 F03 F04 F05 F06 # X04 X05 X06 X07 X08 B00 B01 B02 B03 B04 B05 B06 C00 C01 C02 C03 C04 C05 C06 E01 E02 E03 E04 E05 E06 E07 # X05 X06 X07 X08 X09 X10 B03 B04 X10 +for TX in X01 X02 X03 A01 B01 B02 B03 B04 D00 D01 D02 D03 D04 D05 E00 E01 E02 E03 E04 E05 E06 E07 E08 E09 F00 F01 F02 F03 F04 F05 F06 G01 # X04 X05 X06 X07 X08 B00 B01 B02 B03 B04 B05 B06 C00 C01 C02 C03 C04 C05 C06 E01 E02 E03 E04 E05 E06 E07 # X05 X06 X07 X08 X09 X10 B03 B04 X10 do mkdir -p arena/Task$TX done