Leonardo Canova преди 1 година
родител
ревизия
36eb767ca4
променени са 2 файла, в които са добавени 39 реда и са изтрити 268 реда
  1. 18 225
      flask_be/engine/test/test_contesti_singoli_notebook.ipynb
  2. 21 43
      flask_be/engine/test/test_cooccorrenze_notebook.ipynb

+ 18 - 225
flask_be/engine/test/test_contesti_singoli_notebook.ipynb

@@ -53,7 +53,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 4,
+   "execution_count": 8,
    "metadata": {},
    "outputs": [
     {
@@ -63,7 +63,7 @@
        "        <iframe\n",
        "            width=\"100%\"\n",
        "            height=\"475\"\n",
-       "            src=\"http://MacBook-Air-di-Leonardo-2.local:40000/dtale/iframe/6\"\n",
+       "            src=\"http://MacBook-Air-di-Leonardo-2.local:40000/dtale/iframe/10\"\n",
        "            frameborder=\"0\"\n",
        "            allowfullscreen\n",
        "            \n",
@@ -71,7 +71,7 @@
        "        "
       ],
       "text/plain": [
-       "<IPython.lib.display.IFrame at 0x1682b3b80>"
+       "<IPython.lib.display.IFrame at 0x167eb02e0>"
       ]
      },
      "metadata": {},
@@ -81,7 +81,7 @@
      "data": {
       "text/plain": []
      },
-     "execution_count": 4,
+     "execution_count": 8,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -95,7 +95,7 @@
     "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, 0, 3, 0, listOcc, path)\n",
+    "context = singlecontexts(contexts, 0, 0, 0, 4, listOcc, path)\n",
     "links = findlinks(context, path)\n",
     "bibliocontext = singlefindbib(links, path)\n",
     "dtale.show(bibliocontext)"
@@ -121,39 +121,9 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 14,
+   "execution_count": null,
    "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/14\"\n",
-       "            frameborder=\"0\"\n",
-       "            allowfullscreen\n",
-       "            \n",
-       "        ></iframe>\n",
-       "        "
-      ],
-      "text/plain": [
-       "<IPython.lib.display.IFrame at 0x1613e5c00>"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "data": {
-      "text/plain": []
-     },
-     "execution_count": 14,
-     "metadata": {},
-     "output_type": "execute_result"
-    }
-   ],
+   "outputs": [],
    "source": [
     "parola = \"tarda\"\n",
     "path = \"/Users/leonardocanova/Library/CloudStorage/OneDrive-ConsiglioNazionaledelleRicerche/TIGRO/Ricerche/db/first_db\"\n",
@@ -179,7 +149,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 15,
+   "execution_count": 4,
    "metadata": {},
    "outputs": [
     {
@@ -189,7 +159,7 @@
        "        <iframe\n",
        "            width=\"100%\"\n",
        "            height=\"475\"\n",
-       "            src=\"http://MacBook-Air-di-Leonardo-2.local:40000/dtale/iframe/15\"\n",
+       "            src=\"http://MacBook-Air-di-Leonardo-2.local:40000/dtale/iframe/6\"\n",
        "            frameborder=\"0\"\n",
        "            allowfullscreen\n",
        "            \n",
@@ -197,7 +167,7 @@
        "        "
       ],
       "text/plain": [
-       "<IPython.lib.display.IFrame at 0x1619c97b0>"
+       "<IPython.lib.display.IFrame at 0x16a4b65c0>"
       ]
      },
      "metadata": {},
@@ -207,7 +177,7 @@
      "data": {
       "text/plain": []
      },
-     "execution_count": 15,
+     "execution_count": 4,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -221,7 +191,7 @@
     "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",
+    "context = singlecontexts(contexts, 28, 0, 0, 1, listOcc, path)\n",
     "links = findlinks(context, path)\n",
     "bibliocontext = singlefindbib(links, path)\n",
     "dtale.show(bibliocontext)"
@@ -245,39 +215,9 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 16,
+   "execution_count": null,
    "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/16\"\n",
-       "            frameborder=\"0\"\n",
-       "            allowfullscreen\n",
-       "            \n",
-       "        ></iframe>\n",
-       "        "
-      ],
-      "text/plain": [
-       "<IPython.lib.display.IFrame at 0x1619e5c00>"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "data": {
-      "text/plain": []
-     },
-     "execution_count": 16,
-     "metadata": {},
-     "output_type": "execute_result"
-    }
-   ],
+   "outputs": [],
    "source": [
     "parola = \"orgoglia\"\n",
     "path = \"/Users/leonardocanova/Library/CloudStorage/OneDrive-ConsiglioNazionaledelleRicerche/TIGRO/Ricerche/db/first_db\"\n",
@@ -303,7 +243,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 17,
+   "execution_count": null,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -318,7 +258,7 @@
     "context = singlecontexts(contexts, 0, 30, 0, 0, listOcc, path)\n",
     "links = findlinks(context, path)\n",
     "bibliocontext = singlefindbib(links, path)\n",
-    "dtale.show(bibliocontext).open_browser()"
+    "dtale.show(bibliocontext)"
    ]
   },
   {
@@ -332,39 +272,9 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 18,
+   "execution_count": null,
    "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/18\"\n",
-       "            frameborder=\"0\"\n",
-       "            allowfullscreen\n",
-       "            \n",
-       "        ></iframe>\n",
-       "        "
-      ],
-      "text/plain": [
-       "<IPython.lib.display.IFrame at 0x161845600>"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "data": {
-      "text/plain": []
-     },
-     "execution_count": 18,
-     "metadata": {},
-     "output_type": "execute_result"
-    }
-   ],
+   "outputs": [],
    "source": [
     "parola = \"pennace\"\n",
     "path = \"/Users/leonardocanova/Library/CloudStorage/OneDrive-ConsiglioNazionaledelleRicerche/TIGRO/Ricerche/db/first_db\"\n",
@@ -379,123 +289,6 @@
     "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",
-    "![](img/coocco6.0.png)\n",
-    "\n",
-    "![](img/coocco6.1.png)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 19,
-   "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/19\"\n",
-       "            frameborder=\"0\"\n",
-       "            allowfullscreen\n",
-       "            \n",
-       "        ></iframe>\n",
-       "        "
-      ],
-      "text/plain": [
-       "<IPython.lib.display.IFrame at 0x161a14250>"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "data": {
-      "text/plain": []
-     },
-     "execution_count": 19,
-     "metadata": {},
-     "output_type": "execute_result"
-    }
-   ],
-   "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": 20,
-   "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/20\"\n",
-       "            frameborder=\"0\"\n",
-       "            allowfullscreen\n",
-       "            \n",
-       "        ></iframe>\n",
-       "        "
-      ],
-      "text/plain": [
-       "<IPython.lib.display.IFrame at 0x161a452a0>"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "data": {
-      "text/plain": []
-     },
-     "execution_count": 20,
-     "metadata": {},
-     "output_type": "execute_result"
-    }
-   ],
-   "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",
-    "![](img/coocco7.0.png)\n",
-    "\n",
-    "![](img/coocco7.1.png)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 21,
-   "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": {

+ 21 - 43
flask_be/engine/test/test_cooccorrenze_notebook.ipynb

@@ -30,9 +30,17 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 4,
+   "execution_count": 2,
    "metadata": {},
-   "outputs": [],
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Trovati=1 Occorrenze=42\n"
+     ]
+    }
+   ],
    "source": [
     "import sqlite3\n",
     "import pandas as pd\n",
@@ -79,43 +87,13 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 10,
+   "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/4\"\n",
-       "            frameborder=\"0\"\n",
-       "            allowfullscreen\n",
-       "            \n",
-       "        ></iframe>\n",
-       "        "
-      ],
-      "text/plain": [
-       "<IPython.lib.display.IFrame at 0x151f380a0>"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "data": {
-      "text/plain": []
-     },
-     "execution_count": 10,
-     "metadata": {},
-     "output_type": "execute_result"
-    }
-   ],
+   "outputs": [],
    "source": [
     "ricerca = [[\"cavaliere\", \"0\", 0, 0], [\"corte\", \"0\", 0, 0]]\n",
     "cooccorrenze = ricerca_cooccorrenze(ricerca, 10, 1, 0, \"/Users/leonardocanova/Library/CloudStorage/OneDrive-ConsiglioNazionaledelleRicerche/TIGRO/Ricerche/db/first_db\")\n",
-    "dtale.show(cooccorrenze)"
+    "dtale.show(cooccorrenze).open_browser()"
    ]
   },
   {
@@ -360,7 +338,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 17,
+   "execution_count": 5,
    "metadata": {},
    "outputs": [
     {
@@ -370,7 +348,7 @@
        "        <iframe\n",
        "            width=\"100%\"\n",
        "            height=\"475\"\n",
-       "            src=\"http://MacBook-Air-di-Leonardo-2.local:40000/dtale/iframe/10\"\n",
+       "            src=\"http://MacBook-Air-di-Leonardo-2.local:40000/dtale/iframe/6\"\n",
        "            frameborder=\"0\"\n",
        "            allowfullscreen\n",
        "            \n",
@@ -378,7 +356,7 @@
        "        "
       ],
       "text/plain": [
-       "<IPython.lib.display.IFrame at 0x1569f5e70>"
+       "<IPython.lib.display.IFrame at 0x1078e04c0>"
       ]
      },
      "metadata": {},
@@ -388,7 +366,7 @@
      "data": {
       "text/plain": []
      },
-     "execution_count": 17,
+     "execution_count": 5,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -413,7 +391,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 19,
+   "execution_count": 6,
    "metadata": {},
    "outputs": [
     {
@@ -423,7 +401,7 @@
        "        <iframe\n",
        "            width=\"100%\"\n",
        "            height=\"475\"\n",
-       "            src=\"http://MacBook-Air-di-Leonardo-2.local:40000/dtale/iframe/12\"\n",
+       "            src=\"http://MacBook-Air-di-Leonardo-2.local:40000/dtale/iframe/7\"\n",
        "            frameborder=\"0\"\n",
        "            allowfullscreen\n",
        "            \n",
@@ -431,7 +409,7 @@
        "        "
       ],
       "text/plain": [
-       "<IPython.lib.display.IFrame at 0x156a1f010>"
+       "<IPython.lib.display.IFrame at 0x172d55e70>"
       ]
      },
      "metadata": {},
@@ -441,7 +419,7 @@
      "data": {
       "text/plain": []
      },
-     "execution_count": 19,
+     "execution_count": 6,
      "metadata": {},
      "output_type": "execute_result"
     }