From 959cf021a0d3318de86568909ef1dd57a7d8f0f8 Mon Sep 17 00:00:00 2001 From: Kamil Kubiak Date: Sat, 20 Apr 2024 19:56:41 +0200 Subject: [PATCH] 'labs3' --- lab/lab_02.ipynb | 5 ++--- lab/lab_03.ipynb | 54 +++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 51 insertions(+), 8 deletions(-) diff --git a/lab/lab_02.ipynb b/lab/lab_02.ipynb index b8883e1..12f0a24 100644 --- a/lab/lab_02.ipynb +++ b/lab/lab_02.ipynb @@ -344,7 +344,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 19, "id": "genetic-cradle", "metadata": {}, "outputs": [ @@ -354,8 +354,7 @@ "text": [ "Wciśnij przycisk Enter -> Wciśnij przycisk Enter [ SCORE = 1.0 ]\n", "Wciśnij przycisk Enter -> Wciśnij przycisk ENTER [ SCORE = 0.8181818181818181 ]\n", - "Wciśnij przycisk Enter -> Wciśnij przycisk Enter! [ SCORE = 0.9565217391304348 ]\n", - "Wciśnij przycisk Enter -> Wciśnij przycisk Enter [ SCORE = 1.0 ]\n" + "Wciśnij przycisk Enter -> Wciśnij przycisk Enter! [ SCORE = 0.9565217391304348 ]\n" ] } ], diff --git a/lab/lab_03.ipynb b/lab/lab_03.ipynb index 1067d98..c2cdd2c 100644 --- a/lab/lab_03.ipynb +++ b/lab/lab_03.ipynb @@ -63,7 +63,14 @@ "id": "diverse-sunglasses", "metadata": {}, "source": [ - "Odpowiedź:" + "Odpowiedź:\n", + "\n", + "slides of metal cabinet\n", + "\n", + "Źródła - tłumaczono z PL -> ENG oraz ENG -> PL\n", + "https://translate.google.pl/?hl=pl&sl=en&tl=pl&text=metal%20cabinet%20slides&op=translate\n", + "\n", + "https://www.deepl.com/pl/translator#en/pl/slides%20of%20metal%20cabinet" ] }, { @@ -128,13 +135,50 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 97, "id": "cognitive-cedar", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "program(14, 21)\n", + "program(291, 298)\n", + "program(468, 475)\n", + "program(516, 523)\n", + "program(533, 540)\n", + "application(80, 91)\n", + "application(164, 175)\n", + "application(322, 333)\n", + "applet(302, 308)\n", + "compile(56, 63)\n" + ] + } + ], "source": [ - "def terminology_lookup():\n", - " return []" + "import re\n", + "\n", + "text = \" For all Java programmers:\"\n", + "text += \" This section explains how to compile and run a Swing application from the command line.\"\n", + "text += \" For information on compiling and running a Swing application using NetBeans IDE,\"\n", + "text += \" see Running Tutorial Examples in NetBeans IDE. The compilation instructions work for all Swing programs\"\n", + "text += \" — applets, as well as applications. Here are the steps you need to follow:\"\n", + "text += \" Install the latest release of the Java SE platform, if you haven't already done so.\"\n", + "text += \" Create a program that uses Swing components. Compile the program. Run the program.\"\n", + "\n", + "dictionary = ['program', 'application', 'applet', 'compile']\n", + "\n", + "def terminology_lookup(): \n", + " for entry in dictionary:\n", + " p = r\"\\b\" + entry + \"\\w+\" \n", + " p1 = r\"\\b\" + entry\n", + " re_pattern = re.compile(p1)\n", + " match = re_pattern.finditer(text)\n", + " for x in match:\n", + " print(entry + str(x.span()))\n", + " \n", + "terminology_lookup()" ] }, {