{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "c51fa7c7",
   "metadata": {},
   "source": [
    "# 12-11 · Analizator tekstu\n",
    "\n",
    "Praktyka do sekcji [„Projekt: Analizator tekstu i częstotliwość słów”"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e2aa0bd7",
   "metadata": {},
   "source": [
    "## Cel\n",
    "\n",
    "Symbole, słowa, unikalne słowa – łańcuch znaków razem, pętle i zbiory."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bd0f63d1",
   "metadata": {},
   "source": [
    "## Pro input() w tym laptopie\n",
    "\n",
    "Ten laptop jest automatyczny, więc `input()` tymczasowo zastąpione wcześniej przygotowanymi odpowiedziami."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "a55b619d",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-17T16:38:35.755618Z",
     "iopub.status.busy": "2026-08-17T16:38:35.755465Z",
     "iopub.status.idle": "2026-08-17T16:38:35.772565Z",
     "shell.execute_reply": "2026-08-17T16:38:35.772121Z"
    }
   },
   "outputs": [],
   "source": [
    "_answers = iter(['Python is great and python is fun'])\n",
    "\n",
    "def input(prompt=\"\"):\n",
    "    answer = next(_answers)\n",
    "    print(prompt + answer)\n",
    "    return answer"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "86902a18",
   "metadata": {},
   "source": [
    "## Sprawa robocza"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "0bf10cdf",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-17T16:38:35.773929Z",
     "iopub.status.busy": "2026-08-17T16:38:35.773812Z",
     "iopub.status.idle": "2026-08-17T16:38:35.777337Z",
     "shell.execute_reply": "2026-08-17T16:38:35.776845Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Введите текст: Python is great and python is fun\n",
      "Символов: 33\n",
      "Слов: 7\n",
      "Уникальных слов: 5\n"
     ]
    }
   ],
   "source": [
    "text = input(\"Введите текст: \")\n",
    "normalized = text.lower().split()\n",
    "unikalnye = set(normalized)\n",
    "\n",
    "kolichestvo_simvolov = len(text)\n",
    "kolichestvo_slov = len(normalized)\n",
    "kolichestvo_unikalnyh = len(unikalnye)\n",
    "\n",
    "print(\"Символов:\", kolichestvo_simvolov)\n",
    "print(\"Слов:\", kolichestvo_slov)\n",
    "print(\"Уникальных слов:\", kolichestvo_unikalnyh)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Cartesian Python 3.14",
   "language": "python",
   "name": "cartesian-python314"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.14.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
