|
@@ -0,0 +1,497 @@
|
|
|
+{
|
|
|
+ "cells": [
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": 2,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [],
|
|
|
+ "source": [
|
|
|
+ "import sqlite3\n",
|
|
|
+ "import pandas as pd\n",
|
|
|
+ "import dtale\n",
|
|
|
+ "import unicodedata\n",
|
|
|
+ "from simple_query_test_pandas import ricercaforme\n",
|
|
|
+ "from simple_query_test_pandas import ricercalemmi\n",
|
|
|
+ "from simple_query_test_pandas import ricercaformelemmi \n",
|
|
|
+ "from simple_query_test_pandas import ricercalemmiforme\n",
|
|
|
+ "from simple_query_test_pandas import inizialeraddoppiata\n",
|
|
|
+ "from simple_query_test_pandas import interpreter\n",
|
|
|
+ "from test_occorrenzario_pandas import findtexts\n",
|
|
|
+ "from test_occorrenzario_pandas import findcontexts\n",
|
|
|
+ "from test_occorrenzario_pandas import findbib\n",
|
|
|
+ "from test_cooccorrenze import ricerca_cooccorrenze\n",
|
|
|
+ "from test_contesti_singoli import findbib, findcontexts, findlinks, findtexts, singlecontexts, singlefindbib\n",
|
|
|
+ "import warnings\n",
|
|
|
+ "warnings.filterwarnings('ignore')"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "attachments": {},
|
|
|
+ "cell_type": "markdown",
|
|
|
+ "metadata": {},
|
|
|
+ "source": [
|
|
|
+ "<h2>Ricerca di contesti singoli</h2>"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "attachments": {},
|
|
|
+ "cell_type": "markdown",
|
|
|
+ "metadata": {},
|
|
|
+ "source": [
|
|
|
+ "ricerca per forme di: filius (primo contesto utile)"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "attachments": {},
|
|
|
+ "cell_type": "markdown",
|
|
|
+ "metadata": {},
|
|
|
+ "source": [
|
|
|
+ "\n",
|
|
|
+ "\n",
|
|
|
+ ""
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": 4,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [
|
|
|
+ {
|
|
|
+ "data": {
|
|
|
+ "text/html": [
|
|
|
+ "\n",
|
|
|
+ " <iframe\n",
|
|
|
+ " width=\"100%\"\n",
|
|
|
+ " height=\"475\"\n",
|
|
|
+ " src=\"http://MacBook-Air-di-Leonardo-2.local:40000/dtale/iframe/6\"\n",
|
|
|
+ " frameborder=\"0\"\n",
|
|
|
+ " allowfullscreen\n",
|
|
|
+ " \n",
|
|
|
+ " ></iframe>\n",
|
|
|
+ " "
|
|
|
+ ],
|
|
|
+ "text/plain": [
|
|
|
+ "<IPython.lib.display.IFrame at 0x1741e9150>"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "metadata": {},
|
|
|
+ "output_type": "display_data"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "data": {
|
|
|
+ "text/plain": []
|
|
|
+ },
|
|
|
+ "execution_count": 4,
|
|
|
+ "metadata": {},
|
|
|
+ "output_type": "execute_result"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "source": [
|
|
|
+ "parola = \"filius\"\n",
|
|
|
+ "path = \"/Users/leonardocanova/Library/CloudStorage/OneDrive-ConsiglioNazionaledelleRicerche/TIGRO/Ricerche/db/first_db\"\n",
|
|
|
+ "# tipo di ricerca (0 per forme, 1 per lemmi, 2 per lemmi con opzione \"mostra occorrenze non lemmatizzate\")\n",
|
|
|
+ "type= 0\n",
|
|
|
+ "listOcc = [\"occ00001\", \"occ00002\", \"occ00003\"]\n",
|
|
|
+ "search=ricercaforme(interpreter(parola), path, 0, 0)\n",
|
|
|
+ "textlist=findtexts(type, search, listOcc, path)\n",
|
|
|
+ "contexts = findcontexts(textlist, 30, 0, listOcc, path)\n",
|
|
|
+ "context = singlecontexts(contexts, 0, 30, 0, 0, listOcc, path)\n",
|
|
|
+ "links = findlinks(context, path)\n",
|
|
|
+ "bibliocontext = singlefindbib(links, path)\n",
|
|
|
+ "dtale.show(bibliocontext)"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "attachments": {},
|
|
|
+ "cell_type": "markdown",
|
|
|
+ "metadata": {},
|
|
|
+ "source": [
|
|
|
+ "ricerca per forme di: tarda (primo contesto utile)"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "attachments": {},
|
|
|
+ "cell_type": "markdown",
|
|
|
+ "metadata": {},
|
|
|
+ "source": [
|
|
|
+ "\n",
|
|
|
+ "\n",
|
|
|
+ ""
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": 5,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [
|
|
|
+ {
|
|
|
+ "data": {
|
|
|
+ "text/html": [
|
|
|
+ "\n",
|
|
|
+ " <iframe\n",
|
|
|
+ " width=\"100%\"\n",
|
|
|
+ " height=\"475\"\n",
|
|
|
+ " src=\"http://MacBook-Air-di-Leonardo-2.local:40000/dtale/iframe/7\"\n",
|
|
|
+ " frameborder=\"0\"\n",
|
|
|
+ " allowfullscreen\n",
|
|
|
+ " \n",
|
|
|
+ " ></iframe>\n",
|
|
|
+ " "
|
|
|
+ ],
|
|
|
+ "text/plain": [
|
|
|
+ "<IPython.lib.display.IFrame at 0x1741ebd90>"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "metadata": {},
|
|
|
+ "output_type": "display_data"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "data": {
|
|
|
+ "text/plain": []
|
|
|
+ },
|
|
|
+ "execution_count": 5,
|
|
|
+ "metadata": {},
|
|
|
+ "output_type": "execute_result"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "source": [
|
|
|
+ "parola = \"tarda\"\n",
|
|
|
+ "path = \"/Users/leonardocanova/Library/CloudStorage/OneDrive-ConsiglioNazionaledelleRicerche/TIGRO/Ricerche/db/first_db\"\n",
|
|
|
+ "# tipo di ricerca (0 per forme, 1 per lemmi, 2 per lemmi con opzione \"mostra occorrenze non lemmatizzate\")\n",
|
|
|
+ "type= 0\n",
|
|
|
+ "listOcc = [\"occ00001\", \"occ00002\", \"occ00003\"]\n",
|
|
|
+ "search=ricercaforme(interpreter(parola), path, 0, 0)\n",
|
|
|
+ "textlist=findtexts(type, search, listOcc, path)\n",
|
|
|
+ "contexts = findcontexts(textlist, 30, 0, listOcc, path)\n",
|
|
|
+ "context = singlecontexts(contexts, 0, 30, 0, 0, listOcc, path)\n",
|
|
|
+ "links = findlinks(context, path)\n",
|
|
|
+ "bibliocontext = singlefindbib(links, path)\n",
|
|
|
+ "dtale.show(bibliocontext)"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "attachments": {},
|
|
|
+ "cell_type": "markdown",
|
|
|
+ "metadata": {},
|
|
|
+ "source": [
|
|
|
+ "ricerca per forme di: amistade (contesto n. 29)"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": 3,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [
|
|
|
+ {
|
|
|
+ "data": {
|
|
|
+ "text/html": [
|
|
|
+ "\n",
|
|
|
+ " <iframe\n",
|
|
|
+ " width=\"100%\"\n",
|
|
|
+ " height=\"475\"\n",
|
|
|
+ " src=\"http://MacBook-Air-di-Leonardo-2.local:40000/dtale/iframe/5\"\n",
|
|
|
+ " frameborder=\"0\"\n",
|
|
|
+ " allowfullscreen\n",
|
|
|
+ " \n",
|
|
|
+ " ></iframe>\n",
|
|
|
+ " "
|
|
|
+ ],
|
|
|
+ "text/plain": [
|
|
|
+ "<IPython.lib.display.IFrame at 0x161845180>"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "metadata": {},
|
|
|
+ "output_type": "display_data"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "data": {
|
|
|
+ "text/plain": []
|
|
|
+ },
|
|
|
+ "execution_count": 3,
|
|
|
+ "metadata": {},
|
|
|
+ "output_type": "execute_result"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "source": [
|
|
|
+ "parola = \"amistade\"\n",
|
|
|
+ "path = \"/Users/leonardocanova/Library/CloudStorage/OneDrive-ConsiglioNazionaledelleRicerche/TIGRO/Ricerche/db/first_db\"\n",
|
|
|
+ "# tipo di ricerca (0 per forme, 1 per lemmi, 2 per lemmi con opzione \"mostra occorrenze non lemmatizzate\")\n",
|
|
|
+ "type= 0\n",
|
|
|
+ "listOcc = [\"occ00001\", \"occ00002\", \"occ00003\"]\n",
|
|
|
+ "search=ricercaforme(interpreter(parola), path, 0, 0)\n",
|
|
|
+ "textlist=findtexts(type, search, listOcc, path)\n",
|
|
|
+ "contexts = findcontexts(textlist, 30, 0, listOcc, path)\n",
|
|
|
+ "context = singlecontexts(contexts, 28, 30, 0, 0, listOcc, path)\n",
|
|
|
+ "links = findlinks(context, path)\n",
|
|
|
+ "bibliocontext = singlefindbib(links, path)\n",
|
|
|
+ "dtale.show(bibliocontext)"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "attachments": {},
|
|
|
+ "cell_type": "markdown",
|
|
|
+ "metadata": {},
|
|
|
+ "source": [
|
|
|
+ "ricerca per forme di: orgoglia"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "attachments": {},
|
|
|
+ "cell_type": "markdown",
|
|
|
+ "metadata": {},
|
|
|
+ "source": [
|
|
|
+ ""
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": 5,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [
|
|
|
+ {
|
|
|
+ "data": {
|
|
|
+ "text/html": [
|
|
|
+ "\n",
|
|
|
+ " <iframe\n",
|
|
|
+ " width=\"100%\"\n",
|
|
|
+ " height=\"475\"\n",
|
|
|
+ " src=\"http://MacBook-Air-di-Leonardo-2.local:40000/dtale/iframe/7\"\n",
|
|
|
+ " frameborder=\"0\"\n",
|
|
|
+ " allowfullscreen\n",
|
|
|
+ " \n",
|
|
|
+ " ></iframe>\n",
|
|
|
+ " "
|
|
|
+ ],
|
|
|
+ "text/plain": [
|
|
|
+ "<IPython.lib.display.IFrame at 0x16188f970>"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "metadata": {},
|
|
|
+ "output_type": "display_data"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "data": {
|
|
|
+ "text/plain": []
|
|
|
+ },
|
|
|
+ "execution_count": 5,
|
|
|
+ "metadata": {},
|
|
|
+ "output_type": "execute_result"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "source": [
|
|
|
+ "parola = \"orgoglia\"\n",
|
|
|
+ "path = \"/Users/leonardocanova/Library/CloudStorage/OneDrive-ConsiglioNazionaledelleRicerche/TIGRO/Ricerche/db/first_db\"\n",
|
|
|
+ "# tipo di ricerca (0 per forme, 1 per lemmi, 2 per lemmi con opzione \"mostra occorrenze non lemmatizzate\")\n",
|
|
|
+ "type= 0\n",
|
|
|
+ "listOcc = [\"occ00001\", \"occ00002\", \"occ00003\"]\n",
|
|
|
+ "search=ricercaforme(interpreter(parola), path, 0, 0)\n",
|
|
|
+ "textlist=findtexts(type, search, listOcc, path)\n",
|
|
|
+ "contexts = findcontexts(textlist, 30, 0, listOcc, path)\n",
|
|
|
+ "context = singlecontexts(contexts, 0, 30, 0, 0, listOcc, path)\n",
|
|
|
+ "links = findlinks(context, path)\n",
|
|
|
+ "bibliocontext = singlefindbib(links, path)\n",
|
|
|
+ "dtale.show(bibliocontext)"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "attachments": {},
|
|
|
+ "cell_type": "markdown",
|
|
|
+ "metadata": {},
|
|
|
+ "source": [
|
|
|
+ "ricerca per forme di: intradetta"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": 6,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [
|
|
|
+ {
|
|
|
+ "data": {
|
|
|
+ "text/html": [
|
|
|
+ "\n",
|
|
|
+ " <iframe\n",
|
|
|
+ " width=\"100%\"\n",
|
|
|
+ " height=\"475\"\n",
|
|
|
+ " src=\"http://MacBook-Air-di-Leonardo-2.local:40000/dtale/iframe/8\"\n",
|
|
|
+ " frameborder=\"0\"\n",
|
|
|
+ " allowfullscreen\n",
|
|
|
+ " \n",
|
|
|
+ " ></iframe>\n",
|
|
|
+ " "
|
|
|
+ ],
|
|
|
+ "text/plain": [
|
|
|
+ "<IPython.lib.display.IFrame at 0x1618686a0>"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "metadata": {},
|
|
|
+ "output_type": "display_data"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "data": {
|
|
|
+ "text/plain": []
|
|
|
+ },
|
|
|
+ "execution_count": 6,
|
|
|
+ "metadata": {},
|
|
|
+ "output_type": "execute_result"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "source": [
|
|
|
+ "parola = \"intradetta\"\n",
|
|
|
+ "path = \"/Users/leonardocanova/Library/CloudStorage/OneDrive-ConsiglioNazionaledelleRicerche/TIGRO/Ricerche/db/first_db\"\n",
|
|
|
+ "# tipo di ricerca (0 per forme, 1 per lemmi, 2 per lemmi con opzione \"mostra occorrenze non lemmatizzate\")\n",
|
|
|
+ "type= 0\n",
|
|
|
+ "listOcc = [\"occ00001\", \"occ00002\", \"occ00003\"]\n",
|
|
|
+ "search=ricercaforme(interpreter(parola), path, 0, 0)\n",
|
|
|
+ "textlist=findtexts(type, search, listOcc, path)\n",
|
|
|
+ "contexts = findcontexts(textlist, 30, 0, listOcc, path)\n",
|
|
|
+ "context = singlecontexts(contexts, 0, 30, 0, 0, listOcc, path)\n",
|
|
|
+ "links = findlinks(context, path)\n",
|
|
|
+ "bibliocontext = singlefindbib(links, path)\n",
|
|
|
+ "dtale.show(bibliocontext)"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "attachments": {},
|
|
|
+ "cell_type": "markdown",
|
|
|
+ "metadata": {},
|
|
|
+ "source": [
|
|
|
+ "\n",
|
|
|
+ "ricerca per forme di: pennace"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": 7,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [
|
|
|
+ {
|
|
|
+ "data": {
|
|
|
+ "text/html": [
|
|
|
+ "\n",
|
|
|
+ " <iframe\n",
|
|
|
+ " width=\"100%\"\n",
|
|
|
+ " height=\"475\"\n",
|
|
|
+ " src=\"http://MacBook-Air-di-Leonardo-2.local:40000/dtale/iframe/9\"\n",
|
|
|
+ " frameborder=\"0\"\n",
|
|
|
+ " allowfullscreen\n",
|
|
|
+ " \n",
|
|
|
+ " ></iframe>\n",
|
|
|
+ " "
|
|
|
+ ],
|
|
|
+ "text/plain": [
|
|
|
+ "<IPython.lib.display.IFrame at 0x16186a500>"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "metadata": {},
|
|
|
+ "output_type": "display_data"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "data": {
|
|
|
+ "text/plain": []
|
|
|
+ },
|
|
|
+ "execution_count": 7,
|
|
|
+ "metadata": {},
|
|
|
+ "output_type": "execute_result"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "source": [
|
|
|
+ "parola = \"pennace\"\n",
|
|
|
+ "path = \"/Users/leonardocanova/Library/CloudStorage/OneDrive-ConsiglioNazionaledelleRicerche/TIGRO/Ricerche/db/first_db\"\n",
|
|
|
+ "# tipo di ricerca (0 per forme, 1 per lemmi, 2 per lemmi con opzione \"mostra occorrenze non lemmatizzate\")\n",
|
|
|
+ "type= 0\n",
|
|
|
+ "listOcc = [\"occ00001\", \"occ00002\", \"occ00003\"]\n",
|
|
|
+ "search=ricercaforme(interpreter(parola), path, 0, 0)\n",
|
|
|
+ "textlist=findtexts(type, search, listOcc, path)\n",
|
|
|
+ "contexts = findcontexts(textlist, 30, 0, listOcc, path)\n",
|
|
|
+ "context = singlecontexts(contexts, 0, 30, 0, 0, listOcc, path)\n",
|
|
|
+ "links = findlinks(context, path)\n",
|
|
|
+ "bibliocontext = singlefindbib(links, path)\n",
|
|
|
+ "dtale.show(bibliocontext)"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "attachments": {},
|
|
|
+ "cell_type": "markdown",
|
|
|
+ "metadata": {},
|
|
|
+ "source": [
|
|
|
+ "ricerca di: “Ldovere Lavere” (per L vedi l’esempio che Lquesto anche se non ho mai capito a cosa serva, secondo me è funzionale solo la ricerca con G)\n",
|
|
|
+ "\n",
|
|
|
+ "\n",
|
|
|
+ "\n",
|
|
|
+ ""
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": null,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [],
|
|
|
+ "source": [
|
|
|
+ "ricerca = [[\"dovere\", \"1\", 0, 0], [\"avere\", \"1\", 0, 0]]\n",
|
|
|
+ "cooccorrenze = ricerca_cooccorrenze(ricerca, 1, 1, 0, \"/Users/leonardocanova/Library/CloudStorage/OneDrive-ConsiglioNazionaledelleRicerche/TIGRO/Ricerche/db/first_db\")\n",
|
|
|
+ "dtale.show(cooccorrenze)"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": null,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [],
|
|
|
+ "source": [
|
|
|
+ "ricerca = [[\"dovere\", \"1\", 0, 0], [\"avere\", \"1\", 0, 0]]\n",
|
|
|
+ "cooccorrenze = ricerca_cooccorrenze(ricerca, 1, 1, 0, \"/Users/leonardocanova/Library/CloudStorage/OneDrive-ConsiglioNazionaledelleRicerche/TIGRO/Ricerche/db/first_db\")\n",
|
|
|
+ "dtale.show(cooccorrenze)"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "attachments": {},
|
|
|
+ "cell_type": "markdown",
|
|
|
+ "metadata": {},
|
|
|
+ "source": [
|
|
|
+ "ricerca di: \"Gdovere Gavere\"\n",
|
|
|
+ "\n",
|
|
|
+ "\n",
|
|
|
+ "\n",
|
|
|
+ ""
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "cell_type": "code",
|
|
|
+ "execution_count": null,
|
|
|
+ "metadata": {},
|
|
|
+ "outputs": [],
|
|
|
+ "source": [
|
|
|
+ "ricerca = [[\"dovere\", \"2\", 0, 0], [\"avere\", \"2\", 0, 0]]\n",
|
|
|
+ "cooccorrenze = ricerca_cooccorrenze(ricerca, 1, 1, 0, \"/Users/leonardocanova/Library/CloudStorage/OneDrive-ConsiglioNazionaledelleRicerche/TIGRO/Ricerche/db/first_db\")\n",
|
|
|
+ "dtale.show(cooccorrenze)"
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "metadata": {
|
|
|
+ "kernelspec": {
|
|
|
+ "display_name": "Python 3 (ipykernel)",
|
|
|
+ "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",
|
|
|
+ "version": "3.10.4"
|
|
|
+ },
|
|
|
+ "vscode": {
|
|
|
+ "interpreter": {
|
|
|
+ "hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "nbformat": 4,
|
|
|
+ "nbformat_minor": 2
|
|
|
+}
|