SystemyDialogowe/AJN_final (1).ipynb

465 lines
12 KiB
Plaintext
Raw Normal View History

2022-06-13 19:24:31 +02:00
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
2022-06-14 21:54:31 +02:00
"id": "western-ghost",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [],
"source": [
"%%writefile ./grammar/hello.jsgf\n",
"#JSGF V1.0 UTF-8 pl;\n",
"\n",
"grammar hello;\n",
"\n",
"public <hello> = <words_hello>;\n",
"\n",
"<words_hello> = czesc | hej | witaj | hey | hello | dzień dobry | siema | siemanko;"
]
},
2022-06-14 12:57:51 +02:00
{
"cell_type": "code",
"execution_count": 16,
2022-06-14 21:54:31 +02:00
"id": "affiliated-particular",
2022-06-14 12:57:51 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Writing ./grammar/bye.jsgf\n"
]
}
],
"source": [
"%%writefile ./grammar/bye.jsgf\n",
"#JSGF V1.0 UTF-8 pl;\n",
"\n",
"grammar bye;\n",
"\n",
"public <bye> = <words_bye>;\n",
"\n",
"<words_bye> = do usłyszenia | do widzenia | do zobaczenia | na razie | bye | zegnaj | nara | musze juz isc;\n"
]
},
2022-06-13 19:24:31 +02:00
{
"cell_type": "code",
2022-06-14 21:54:31 +02:00
"execution_count": 30,
"id": "available-carpet",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Overwriting ./grammar/repertuar.jsgf\n"
]
}
],
"source": [
"%%writefile ./grammar/repertuar.jsgf\n",
"#JSGF V1.0 UTF-8 pl;\n",
"\n",
"grammar repertuar;\n",
"\n",
2022-06-14 21:54:31 +02:00
"public <repertuar> = <prosba> [aktualny | obecny | aktualnie | obecnie | teraz] [repertuar] ;\n",
2022-06-13 19:24:31 +02:00
"\n",
"<prosba> = prosze podac | podaj | jaki jest | co [teraz] gracie | co leci | jakie sa filmy | jakie filmy gracie;\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
2022-06-14 21:54:31 +02:00
"id": "arranged-bumper",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [],
"source": [
"%%writefile ./grammar/cancel.jsgf\n",
"#JSGF V1.0 UTF-8 pl;\n",
"\n",
"grammar cancel;\n",
"\n",
"public <odwolaj> = <prosba> <anulacja>;\n",
"\n",
"<prosba> = chce | chcialbym | chcialabym | prosze;\n",
"\n",
"<anulacja> = odwolac | zrezygnowac | anulowac ([bilety]|[bilet]|[z biletow]|[rezerwacje]|[z rezerwacji]);"
]
},
{
"cell_type": "code",
2022-06-14 21:54:31 +02:00
"execution_count": 31,
"id": "controlling-instrument",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Overwriting ./grammar/book.jsgf\n"
]
}
],
"source": [
"%%writefile ./grammar/book.jsgf\n",
"#JSGF V1.0 UTF-8 pl;\n",
"\n",
"grammar book;\n",
"\n",
2022-06-14 21:54:31 +02:00
"public <rezerwuj> = <prosba> [<ilosc_biletow>] [[do kina] | [na seans]] [<tytul_filmu>] [<dzien_rezerwacji>] [<godzina_rezerwacji>];\n",
2022-06-13 19:24:31 +02:00
"\n",
"<prosba> = (chce | chcialbym | chcialabym | poprosze) [zarezerwowac];\n",
"\n",
"<ilosc_biletow> = <liczba> {ilosc} (bilety | biletow | bilet);\n",
"\n",
"<liczba> = jeden | dwa | trzy | cztery | piec | szesc | siedem | osiem | dziewiec | dziesiec |1|2|3|4|5|6|7|8|9|10;\n",
"\n",
"<tytul_filmu> = na [film] <tytul> {tytul};\n",
"\n",
"<tytul> = Batman | Batmana | Uncharted | Pitbull | Ambulans | Bunkier strachu | Corka | Corke | Inni ludzie | Śmierć na Nilu | Skarb Mikołajka;\n",
"\n",
"<dzien_rezerwacji> = na <dzien> {dzien};\n",
"\n",
"<dzien> = (dzisiaj | jutro | poniedziałek | wtorek | srode | czwartek | piatek | sobotę | niedziele) | <data>;\n",
"\n",
2022-06-14 21:54:31 +02:00
"<data> = (8|9|10|11|12|13|14|15) [czerwca] ; \n",
2022-06-13 19:24:31 +02:00
"\n",
"<godzina_rezerwacji> = na [godzinę] <godzina_z_minutami> {godzina};\n",
"\n",
"<godzina_z_minutami> = <godzina> [<minuty>];\n",
"\n",
"<godzina> = 10|11|12|13|14|15|16|17|18|19|20|21|22|23 | dziesiata | jedenasta | dwunasta | trzynasta | czternasta | pietnasta | szesnasta | siedemnasta | osiemnasta | dziewietnasta | dwudziesta;\n",
"\n",
"<minuty> = pietnaście | trzydzieści | czterdziesci piec| 15 | 30 | 45;"
]
},
{
"cell_type": "code",
2022-06-14 21:54:31 +02:00
"execution_count": 20,
"id": "center-conversation",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Overwriting ./grammar/ilosc_bil.jsgf\n"
]
}
],
"source": [
"%%writefile ./grammar/ilosc_bil.jsgf\n",
"#JSGF V1.0 UTF-8 pl;\n",
"\n",
"grammar ilosc_bil;\n",
"\n",
2022-06-14 21:54:31 +02:00
"public <ilosc_bil> = [<prosba>] [<ilosc_biletow>] [do kina] | [na seans];\n",
2022-06-13 19:24:31 +02:00
"\n",
"<prosba> = (chce | chcialbym | chcialabym | poprosze) [zarezerwowac];\n",
"\n",
"<ilosc_biletow> = <liczba> {ilosc} [(bilety | biletow | bilet)];\n",
"\n",
"<liczba> = jeden | dwa | trzy | cztery | piec | szesc | siedem | osiem | dziewiec | dziesiec |1|2|3|4|5|6|7|8|9|10;\n"
]
},
{
"cell_type": "code",
2022-06-14 21:54:31 +02:00
"execution_count": 23,
"id": "circular-matter",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Overwriting ./grammar/tyt_filmu.jsgf\n"
]
}
],
"source": [
"%%writefile ./grammar/tyt_filmu.jsgf\n",
"#JSGF V1.0 UTF-8 pl;\n",
"\n",
"grammar tyt_filmu;\n",
"\n",
"public <tyt_filmu> = [<prosba>] [<tytul_filmu>];\n",
"\n",
2022-06-14 21:54:31 +02:00
"<prosba> = (chce | chcialbym | chcialabym | poprosze) [zarezerwowac] [bilet | bilety];\n",
2022-06-13 19:24:31 +02:00
"\n",
"<tytul_filmu> = [na] [film] <tytul> {tytul};\n",
"\n",
"<tytul> = Batman | Batmana | Uncharted | Pitbull | Ambulans | Bunkier strachu | Corka | Corke | Inni ludzie | Śmierć na Nilu | Skarb Mikołajka;"
]
},
{
"cell_type": "code",
2022-06-14 21:54:31 +02:00
"execution_count": 27,
"id": "animated-metallic",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Overwriting ./grammar/dni.jsgf\n"
]
}
],
"source": [
"%%writefile ./grammar/dni.jsgf\n",
"#JSGF V1.0 UTF-8 pl;\n",
"\n",
"grammar dni;\n",
"\n",
"public <dni> = [<prosba>] [<dzien_rezerwacji>];\n",
"\n",
"<prosba> = (chce | chcialbym | chcialabym | poprosze) [zarezerwowac];\n",
"\n",
2022-06-14 21:54:31 +02:00
"<dzien_rezerwacji> = [na] <dzien> {dzien};\n",
2022-06-13 19:24:31 +02:00
"\n",
2022-06-14 21:54:31 +02:00
"<dzien> = (dzis | dzisiaj | jutro | poniedziałek | wtorek | srode | czwartek | piatek | sobotę | niedziele) | <data>;\n",
2022-06-13 19:24:31 +02:00
"\n",
2022-06-14 21:54:31 +02:00
"<data> = (15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30) czerwca; \n"
2022-06-13 19:24:31 +02:00
]
},
{
"cell_type": "code",
2022-06-14 21:54:31 +02:00
"execution_count": 26,
"id": "recognized-aaron",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Overwriting ./grammar/godziny.jsgf\n"
]
}
],
"source": [
"%%writefile ./grammar/godziny.jsgf\n",
"#JSGF V1.0 UTF-8 pl;\n",
"\n",
"grammar godziny;\n",
"\n",
2022-06-14 12:57:51 +02:00
"public <godziny> = [<prosba>] <godzina_rezerwacji>;\n",
2022-06-13 19:24:31 +02:00
"\n",
"<prosba> = (chce | chcialbym | chcialabym | poprosze) [zarezerwowac];\n",
"\n",
2022-06-14 21:54:31 +02:00
"<godzina_rezerwacji> = [na] [godzine] <godzina_z_minutami> {godzina};\n",
2022-06-13 19:24:31 +02:00
"\n",
"<godzina_z_minutami> = <godzina> [<minuty>];\n",
"\n",
"<godzina> = 10|11|12|13|14|15|16|17|18|19|20|21|22|23 | dziesiata | jedenasta | dwunasta | trzynasta | czternasta | pietnasta | szesnasta | siedemnasta | osiemnasta | dziewietnasta | dwudziesta;\n",
"\n",
2022-06-14 21:54:31 +02:00
"<minuty> = pietnaście | trzydzieści | czterdziesci piec | 15 | 30 | 45;"
2022-06-13 19:24:31 +02:00
]
},
{
"cell_type": "code",
"execution_count": 7,
2022-06-14 21:54:31 +02:00
"id": "whole-diary",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Overwriting ./grammar/miejsca.jsgf\n"
]
}
],
"source": [
"%%writefile ./grammar/miejsca.jsgf\n",
"#JSGF V1.0 UTF-8 pl;\n",
"\n",
"grammar miejsca;\n",
"\n",
"public <miejsca> = [z | na | w] <miejsce> {miejsce};\n",
"\n",
"<miejsce> = dole | gorze | srodku | tylu | blizej | przodu;\n"
]
},
{
"cell_type": "code",
2022-06-14 21:54:31 +02:00
"execution_count": 32,
"id": "mineral-converter",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Overwriting ./grammar/nr_tel.jsgf\n"
]
}
],
"source": [
"%%writefile ./grammar/nr_tel.jsgf\n",
"#JSGF V1.0 UTF-8 pl;\n",
"\n",
"grammar numer;\n",
"\n",
"public <numer> = <nr> {numer};\n",
"\n",
2022-06-14 21:54:31 +02:00
"<nr> = <cyfra><cyfra><cyfra>+;\n",
2022-06-14 12:57:51 +02:00
"\n",
"<cyfra> = 0|1|2|3|4|5|6|7|8|9\n"
2022-06-13 19:24:31 +02:00
]
},
{
"cell_type": "code",
2022-06-14 21:54:31 +02:00
"execution_count": 38,
"id": "adaptive-recycling",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [
{
2022-06-14 12:57:51 +02:00
"name": "stdout",
"output_type": "stream",
"text": [
2022-06-14 21:54:31 +02:00
"Overwriting ./grammar/zapytanie.jsgf\n"
2022-06-13 19:24:31 +02:00
]
}
],
2022-06-14 21:54:31 +02:00
"source": [
"%%writefile ./grammar/zapytanie.jsgf\n",
"#JSGF V1.0 UTF-8 pl;\n",
"\n",
"grammar zapytanie;\n",
"\n",
"public <zapytanie> = <pytanie>;\n",
"\n",
"<pytanie> = mam pytanie | jakie sa ([ulgi] | [ceny]) | o czym ([to] | [jest]) [<tytul>];\n",
"\n",
"<tytul> = Batman | Batmana | Uncharted | Pitbull | Ambulans | Bunkier strachu | Corka | Corke | Inni ludzie | Śmierć na Nilu | Skarb Mikołajka;"
]
},
{
"cell_type": "code",
"execution_count": 37,
"id": "lesser-specific",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Overwriting ./grammar/seanse.jsgf\n"
]
}
],
"source": [
"%%writefile ./grammar/seanse.jsgf\n",
"#JSGF V1.0 UTF-8 pl;\n",
"\n",
"grammar seanse;\n",
"\n",
"public <seanse> = <godz>;\n",
"\n",
"<godz> = o ktorej ([gracie] | [jest] | [leci]) [<tytul>]| w jakich godzinach ([gracie] | [leci] | [jest]) [<tytul>] | jakie [sa] [dostepne] [seanse];\n",
"\n",
"<tytul> = Batman | Batmana | Uncharted | Pitbull | Pitbulla | Pitbula | Ambulans | Bunkier strachu | Corka | Corke | Inni ludzie | Śmierć na Nilu | Skarb Mikołajka;"
]
2022-06-13 19:24:31 +02:00
},
{
"cell_type": "code",
"execution_count": null,
2022-06-14 21:54:31 +02:00
"id": "canadian-warrior",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
2022-06-14 21:54:31 +02:00
"id": "operating-formula",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [],
"source": [
2022-06-14 12:57:51 +02:00
"!jupyter nbconvert --to script MST.ipynb"
2022-06-13 19:24:31 +02:00
]
},
{
"cell_type": "code",
"execution_count": null,
2022-06-14 21:54:31 +02:00
"id": "trying-gibraltar",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [],
"source": [
2022-06-14 12:57:51 +02:00
"!jupyter nbconvert --to script AJN_final.ipynb"
2022-06-13 19:24:31 +02:00
]
},
{
"cell_type": "code",
"execution_count": null,
2022-06-14 21:54:31 +02:00
"id": "raising-partner",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [],
2022-06-14 12:57:51 +02:00
"source": []
2022-06-13 19:24:31 +02:00
},
{
"cell_type": "code",
"execution_count": null,
2022-06-14 21:54:31 +02:00
"id": "orange-partner",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
2022-06-14 21:54:31 +02:00
"id": "chief-nursery",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
2022-06-14 21:54:31 +02:00
"id": "attached-seeker",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
2022-06-14 21:54:31 +02:00
"id": "usual-handle",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
2022-06-14 21:54:31 +02:00
"id": "executive-liability",
2022-06-13 19:24:31 +02:00
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
2022-06-14 21:54:31 +02:00
"display_name": "Python 3",
2022-06-13 19:24:31 +02:00
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
2022-06-14 21:54:31 +02:00
"version": "3.7.3"
2022-06-13 19:24:31 +02:00
}
},
"nbformat": 4,
"nbformat_minor": 5
}