{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Cadence\n",
    "\n",
    "A rhythm analysis toolkit, gathering multiple parsing engines:\n",
    "* [Prosodic](https://github.com/quadrismegistus/prosodic) for fast English and Finnish metrical scansion.\n",
    "* Cadence itself for slower but exhaustive, MaxEnt-able metrical scansion."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Quickstart"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Install\n",
    "\n",
    "#### 1. Install python package\n",
    "```\n",
    "# install from pypi\n",
    "pip install -U cadences\n",
    "\n",
    "# or from github very latest\n",
    "pip install -U git+https://github.com/quadrismegistus/cadence\n",
    "```\n",
    "\n",
    "#### 2. Insteall espeak (TTS)\n",
    "\n",
    "Install espeak, free TTS software, to 'sound out' unknown words. See [here](http://espeak.sourceforge.net/download.html) for all downloads. For Mac or Linux, you can use:\n",
    "```\n",
    "apt-get install espeak     # linux\n",
    "brew install espeak        # mac\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Load texts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [],
   "source": [
    "sonnetXIV = \"\"\"Not from the stars do I my judgement pluck;\n",
    "And yet methinks I have astronomy,\n",
    "But not to tell of good or evil luck,\n",
    "Of plagues, of dearths, or seasons' quality;\n",
    "Nor can I fortune to brief minutes tell,\n",
    "Pointing to each his thunder, rain and wind,\n",
    "Or say with princes if it shall go well\n",
    "By oft predict that I in heaven find:\n",
    "But from thine eyes my knowledge I derive,\n",
    "And constant stars in them I read such art\n",
    "As 'truth and beauty shall together thrive,\n",
    "If from thyself, to store thou wouldst convert';\n",
    "    Or else of thee this I prognosticate:\n",
    "    'Thy end is truth's and beauty's doom and date.'\n",
    "\"\"\"\n",
    "\n",
    "melville=\"\"\"Is it that by its indefiniteness it shadows forth the heartless voids and immensities of the universe, and thus stabs us from behind with the thought of annihilation, when beholding the white depths of the milky way? Or is it, that as in essence whiteness is not so much a colour as the visible absence of colour; and at the same time the concrete of all colours; is it for these reasons that there is such a dumb blankness, full of meaning, in a wide landscape of snows: a colourless, all-colour of atheism from which we shrink?\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [],
   "source": [
    "# this should work following installation\n",
    "import cadence as cd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [],
   "source": [
    "# These are identical\n",
    "sonnet = cd.Text(sonnetXIV, verse=True)\n",
    "sonnet = cd.Text(sonnetXIV, linebreaks=True, phrasebreaks=False)\n",
    "sonnet = cd.Poem(sonnetXIV)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [],
   "source": [
    "# So are these\n",
    "para = cd.Text(melville, prose=True)\n",
    "para = cd.Text(melville, linebreaks=False, phrasebreaks=True)\n",
    "para = cd.Prose(melville)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Syllabify"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Iterating over line scansions [x1]: 100%|██████████| 14/14 [00:00<00:00, 56.28it/s]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>is_funcword</th>\n",
       "      <th>is_heavy</th>\n",
       "      <th>is_light</th>\n",
       "      <th>is_peak</th>\n",
       "      <th>is_stressed</th>\n",
       "      <th>is_syll</th>\n",
       "      <th>is_trough</th>\n",
       "      <th>is_unstressed</th>\n",
       "      <th>line_num_syll</th>\n",
       "      <th>prom_strength</th>\n",
       "      <th>prom_stress</th>\n",
       "      <th>prom_weight</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>stanza_i</th>\n",
       "      <th>line_i</th>\n",
       "      <th>linepart_i</th>\n",
       "      <th>line_str</th>\n",
       "      <th>word_i</th>\n",
       "      <th>word_str</th>\n",
       "      <th>word_ipa_i</th>\n",
       "      <th>word_ipa</th>\n",
       "      <th>syll_i</th>\n",
       "      <th>syll_str</th>\n",
       "      <th>syll_ipa</th>\n",
       "      <th>syll_stress</th>\n",
       "      <th>syll_weight</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"11\" valign=\"top\">1</th>\n",
       "      <th rowspan=\"5\" valign=\"top\">1</th>\n",
       "      <th rowspan=\"5\" valign=\"top\">1</th>\n",
       "      <th rowspan=\"5\" valign=\"top\">Not from the stars do I my judgement pluck;</th>\n",
       "      <th rowspan=\"2\" valign=\"top\">1</th>\n",
       "      <th rowspan=\"2\" valign=\"top\">Not</th>\n",
       "      <th>1</th>\n",
       "      <th>'nɑt</th>\n",
       "      <th>1</th>\n",
       "      <th>Not</th>\n",
       "      <th>'nɑt</th>\n",
       "      <th>P</th>\n",
       "      <th>H</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>10</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>nɑt</th>\n",
       "      <th>1</th>\n",
       "      <th>Not</th>\n",
       "      <th>nɑt</th>\n",
       "      <th>U</th>\n",
       "      <th>H</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>from</th>\n",
       "      <th>1</th>\n",
       "      <th>frʌm</th>\n",
       "      <th>1</th>\n",
       "      <th>from</th>\n",
       "      <th>frʌm</th>\n",
       "      <th>U</th>\n",
       "      <th>H</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <th>the</th>\n",
       "      <th>1</th>\n",
       "      <th>ðə</th>\n",
       "      <th>1</th>\n",
       "      <th>the</th>\n",
       "      <th>ðə</th>\n",
       "      <th>U</th>\n",
       "      <th>L</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <th>stars</th>\n",
       "      <th>1</th>\n",
       "      <th>'stɑrz</th>\n",
       "      <th>1</th>\n",
       "      <th>stars</th>\n",
       "      <th>'stɑrz</th>\n",
       "      <th>P</th>\n",
       "      <th>H</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>10</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"5\" valign=\"top\">14</th>\n",
       "      <th rowspan=\"5\" valign=\"top\">1</th>\n",
       "      <th rowspan=\"5\" valign=\"top\">'Thy end is truth's and beauty's doom and date.'</th>\n",
       "      <th rowspan=\"2\" valign=\"top\">6</th>\n",
       "      <th rowspan=\"2\" valign=\"top\">beauty's</th>\n",
       "      <th rowspan=\"2\" valign=\"top\">1</th>\n",
       "      <th rowspan=\"2\" valign=\"top\">'bjʉː.tɪz</th>\n",
       "      <th>1</th>\n",
       "      <th>beau</th>\n",
       "      <th>'bjʉː</th>\n",
       "      <th>P</th>\n",
       "      <th>L</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>10</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>ty's</th>\n",
       "      <th>tɪz</th>\n",
       "      <th>U</th>\n",
       "      <th>H</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <th>doom</th>\n",
       "      <th>1</th>\n",
       "      <th>'duːm</th>\n",
       "      <th>1</th>\n",
       "      <th>doom</th>\n",
       "      <th>'duːm</th>\n",
       "      <th>P</th>\n",
       "      <th>H</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>10</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <th>and</th>\n",
       "      <th>1</th>\n",
       "      <th>ænd</th>\n",
       "      <th>1</th>\n",
       "      <th>and</th>\n",
       "      <th>ænd</th>\n",
       "      <th>U</th>\n",
       "      <th>H</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <th>date.'</th>\n",
       "      <th>1</th>\n",
       "      <th>'deɪt</th>\n",
       "      <th>1</th>\n",
       "      <th>date.'</th>\n",
       "      <th>'deɪt</th>\n",
       "      <th>P</th>\n",
       "      <th>H</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>10</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>156 rows × 12 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                                                                                                                   is_funcword  is_heavy  ...  prom_stress  prom_weight\n",
       "stanza_i line_i linepart_i line_str                                         word_i word_str word_ipa_i word_ipa  syll_i syll_str syll_ipa syll_stress syll_weight                         ...                          \n",
       "1        1      1          Not from the stars do I my judgement pluck;      1      Not      1          'nɑt      1      Not      'nɑt     P           H                      1         1  ...          1.0            1\n",
       "                                                                                            2          nɑt       1      Not      nɑt      U           H                      1         1  ...          0.0            1\n",
       "                                                                            2      from     1          frʌm      1      from     frʌm     U           H                      1         1  ...          0.0            1\n",
       "                                                                            3      the      1          ðə        1      the      ðə       U           L                      1         0  ...          0.0            0\n",
       "                                                                            4      stars    1          'stɑrz    1      stars    'stɑrz   P           H                      0         1  ...          1.0            1\n",
       "...                                                                                                                                                                        ...       ...  ...          ...          ...\n",
       "         14     1          'Thy end is truth's and beauty's doom and date.' 6      beauty's 1          'bjʉː.tɪz 1      beau     'bjʉː    P           L                      0         0  ...          1.0            0\n",
       "                                                                                                                 2      ty's     tɪz      U           H                      0         1  ...          0.0            1\n",
       "                                                                            7      doom     1          'duːm     1      doom     'duːm    P           H                      0         1  ...          1.0            1\n",
       "                                                                            8      and      1          ænd       1      and      ænd      U           H                      1         1  ...          0.0            1\n",
       "                                                                            9      date.'   1          'deɪt     1      date.'   'deɪt    P           H                      0         1  ...          1.0            1\n",
       "\n",
       "[156 rows x 12 columns]"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# scansion by syllable\n",
    "sonnet.scan()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Iterating over line scansions [x1]: 100%|██████████| 11/11 [00:00<00:00, 54.91it/s]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>is_funcword</th>\n",
       "      <th>is_heavy</th>\n",
       "      <th>is_light</th>\n",
       "      <th>is_peak</th>\n",
       "      <th>is_stressed</th>\n",
       "      <th>is_syll</th>\n",
       "      <th>is_trough</th>\n",
       "      <th>is_unstressed</th>\n",
       "      <th>line_num_syll</th>\n",
       "      <th>prom_strength</th>\n",
       "      <th>prom_stress</th>\n",
       "      <th>prom_weight</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>stanza_i</th>\n",
       "      <th>line_i</th>\n",
       "      <th>linepart_i</th>\n",
       "      <th>line_str</th>\n",
       "      <th>word_i</th>\n",
       "      <th>word_str</th>\n",
       "      <th>word_ipa_i</th>\n",
       "      <th>word_ipa</th>\n",
       "      <th>syll_i</th>\n",
       "      <th>syll_str</th>\n",
       "      <th>syll_ipa</th>\n",
       "      <th>syll_stress</th>\n",
       "      <th>syll_weight</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"11\" valign=\"top\">1</th>\n",
       "      <th rowspan=\"5\" valign=\"top\">1</th>\n",
       "      <th rowspan=\"5\" valign=\"top\">1</th>\n",
       "      <th rowspan=\"5\" valign=\"top\">Is it that by its indefiniteness it shadows forth the heartless voids and immensities of the universe,</th>\n",
       "      <th>1</th>\n",
       "      <th>Is</th>\n",
       "      <th>1</th>\n",
       "      <th>ɪz</th>\n",
       "      <th>1</th>\n",
       "      <th>Is</th>\n",
       "      <th>ɪz</th>\n",
       "      <th>U</th>\n",
       "      <th>H</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>28</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>it</th>\n",
       "      <th>1</th>\n",
       "      <th>ɪt</th>\n",
       "      <th>1</th>\n",
       "      <th>it</th>\n",
       "      <th>ɪt</th>\n",
       "      <th>U</th>\n",
       "      <th>H</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>28</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">3</th>\n",
       "      <th rowspan=\"2\" valign=\"top\">that</th>\n",
       "      <th>1</th>\n",
       "      <th>'ðæt</th>\n",
       "      <th>1</th>\n",
       "      <th>that</th>\n",
       "      <th>'ðæt</th>\n",
       "      <th>P</th>\n",
       "      <th>H</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>28</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>ðət</th>\n",
       "      <th>1</th>\n",
       "      <th>that</th>\n",
       "      <th>ðət</th>\n",
       "      <th>U</th>\n",
       "      <th>H</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>28</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <th>by</th>\n",
       "      <th>1</th>\n",
       "      <th>baɪ</th>\n",
       "      <th>1</th>\n",
       "      <th>by</th>\n",
       "      <th>baɪ</th>\n",
       "      <th>U</th>\n",
       "      <th>L</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>28</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"5\" valign=\"top\">2</th>\n",
       "      <th rowspan=\"5\" valign=\"top\">8</th>\n",
       "      <th rowspan=\"5\" valign=\"top\">all-colour of atheism from which we shrink?</th>\n",
       "      <th>4</th>\n",
       "      <th>from</th>\n",
       "      <th>1</th>\n",
       "      <th>frʌm</th>\n",
       "      <th>1</th>\n",
       "      <th>from</th>\n",
       "      <th>frʌm</th>\n",
       "      <th>U</th>\n",
       "      <th>H</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">5</th>\n",
       "      <th rowspan=\"2\" valign=\"top\">which</th>\n",
       "      <th>1</th>\n",
       "      <th>'wɪʧ</th>\n",
       "      <th>1</th>\n",
       "      <th>which</th>\n",
       "      <th>'wɪʧ</th>\n",
       "      <th>P</th>\n",
       "      <th>H</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>wɪʧ</th>\n",
       "      <th>1</th>\n",
       "      <th>which</th>\n",
       "      <th>wɪʧ</th>\n",
       "      <th>U</th>\n",
       "      <th>H</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <th>we</th>\n",
       "      <th>1</th>\n",
       "      <th>wiː</th>\n",
       "      <th>1</th>\n",
       "      <th>we</th>\n",
       "      <th>wiː</th>\n",
       "      <th>U</th>\n",
       "      <th>L</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <th>shrink?</th>\n",
       "      <th>1</th>\n",
       "      <th>'ʃrɪŋk</th>\n",
       "      <th>1</th>\n",
       "      <th>shrink?</th>\n",
       "      <th>'ʃrɪŋk</th>\n",
       "      <th>P</th>\n",
       "      <th>H</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>12</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>152 rows × 12 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                                                                                                                    is_funcword  is_heavy  ...  prom_stress  prom_weight\n",
       "stanza_i line_i linepart_i line_str                                           word_i word_str word_ipa_i word_ipa syll_i syll_str syll_ipa syll_stress syll_weight                         ...                          \n",
       "1        1      1          Is it that by its indefiniteness it shadows for... 1      Is       1          ɪz       1      Is       ɪz       U           H                      1         1  ...          0.0            1\n",
       "                                                                              2      it       1          ɪt       1      it       ɪt       U           H                      1         1  ...          0.0            1\n",
       "                                                                              3      that     1          'ðæt     1      that     'ðæt     P           H                      1         1  ...          1.0            1\n",
       "                                                                                              2          ðət      1      that     ðət      U           H                      1         1  ...          0.0            1\n",
       "                                                                              4      by       1          baɪ      1      by       baɪ      U           L                      1         0  ...          0.0            0\n",
       "...                                                                                                                                                                         ...       ...  ...          ...          ...\n",
       "         2      8           all-colour of atheism from which we shrink?       4      from     1          frʌm     1      from     frʌm     U           H                      1         1  ...          0.0            1\n",
       "                                                                              5      which    1          'wɪʧ     1      which    'wɪʧ     P           H                      1         1  ...          1.0            1\n",
       "                                                                                              2          wɪʧ      1      which    wɪʧ      U           H                      1         1  ...          0.0            1\n",
       "                                                                              6      we       1          wiː      1      we       wiː      U           L                      1         0  ...          0.0            0\n",
       "                                                                              7      shrink?  1          'ʃrɪŋk   1      shrink?  'ʃrɪŋk   P           H                      0         1  ...          1.0            1\n",
       "\n",
       "[152 rows x 12 columns]"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "para.scan()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Parse text"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "Not <i><b>fróm</b></i> the <b>stárs</b> do <i><b>Í</b></i> my <b>júdge</b>ment <b>plúck</b>;"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "And <b>yét</b> me<b>thínks</b> I <b>háve</b> as<b>trón</b>o<i><b>mý</b></i>,"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "But <b>nót</b> to <b>téll</b> of <b>góod</b> or <b>év</b>il <b>lúck</b>,"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "Of <b>plágues</b>, of <b>déarths</b>, or <b>séa</b>son <b>qúal</b>i<i><b>tý</b></i>;"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "Nor <i><b>cán</b></i> I <b>fór</b>tune <i><b>tó</b></i> <i>brief</i> <b>mín</b>utes <b>téll</b>,"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "<b>Póint</b><i>ing</i> <i>to</i> <b>éach</b> his <b>thún</b>der, <b>ráin</b> and <b>wínd</b>,"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "Or <b>sáy</b> with <b>prí</b>nces <i><b>íf</b></i> it <b>sháll</b> <i>go</i> <b>wéll</b>"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "By <b>óft</b> pre<b>díct</b> that <i><b>Í</b></i> in <b>héav</b>en <b>fínd</b>:"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "But <i><b>fróm</b></i> thine <b>éyes</b> my <b>knówl</b>edge <i><b>Í</b></i> de<b>ríve</b>,"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "And <b>cón</b>stant <b>stárs</b> in <i><b>thém</b></i> I <b>réad</b> such <b>árt</b>"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "As <b>'trúth</b> and <b>béau</b>ty <b>sháll</b> to<b>géth</b>er <b>thríve</b>,"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "If <i><b>fróm</b></i> thy<b>sélf</b>, to <b>stóre</b> thou <b>wóuldst</b> con<b>vért'</b>;"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "Or <b>élse</b> of <i><b>thée</b></i> this <i><b>Í</b></i> <i>prog</i><b>nós</b>ti<b>cáte</b>:"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "'Thy <b>énd</b> is <b>trúth's</b> and <b>béau</b>ty's <b>dóom</b> and <b>dáte</b>.'"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Parse lines (verse)\n",
    "sonnet.parse()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "<i><b>Ís</b></i> it <b>thát</b> by <i><b>íts</b></i> in<b>déf</b>i<i><b>níte</b></i><i>ness</i> <i>it</i> <b>shád</b><i>ows</i> <b>fórth</b> the <b>héart</b>less <b>vóids</b> <i>and</i> <i>im</i><b>mén</b>si<i><b>tíes</b></i> <i>of</i> <i>the</i> <b>úni</b>ver<b>sé</b>, and <i><b>thús</b></i> <i><b>stábs</b></i> us <i><b>fróm</b></i> be<b>hínd</b> <i>with</i> <i>the</i> <b>thóught</b> <i>of</i> <i>an</i><b>ní</b>hi<b>lá</b>tion, <b>whén</b> be<b>hóld</b>ing <i><b>thé</b></i> <i>white</i> <b>dépths</b> <i>of</i> <i>the</i> <b>mí</b>lky <b>wáy</b>?"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "Or <i><b>ís</b></i> it, <b>thát</b> <i>as</i> <i>in</i> <b>éss</b>ence <b>whíte</b><i>ness</i> <i>is</i> <b>nót</b> so <b>múch</b> a <b>cól</b>our <i><b>ás</b></i> the <b>vís</b><i>i</i><i>ble</i> <b>áb</b><i>sence</i> <i>of</i> <b>cól</b>our; and <b>át</b> the <i><b>sáme</b></i> <i><b>tíme</b></i> the <b>cón</b>crete <i><b>óf</b></i> all <b>cólo</b>urs; <i><b>ís</b></i> it <i><b>fór</b></i> these <b>réa</b>sons <b>thát</b> there <i><b>ís</b></i> such <i><b>á</b></i> <i>dumb</i> <b>blánk</b>ness, <b>fúll</b> of <b>méan</b>ing, <b>ín</b> a <b>wíde</b> <i>land</i><b>scápe</b> of <b>snóws</b>: a <b>cólour</b>le<i><b>ss</b></i>, al<b>l</b>-colour <i><b>óf</b></i> athe<b>í</b><i>sm</i> <i>from</i> <b>whích</b> we <b>shrínk</b>?"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Parse sentences (prose)\n",
    "para.parse()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>*total</th>\n",
       "      <th>*s/unstressed</th>\n",
       "      <th>*w-res</th>\n",
       "      <th>*w/stressed</th>\n",
       "      <th>*clash</th>\n",
       "      <th>*f-res</th>\n",
       "      <th>*w/peak</th>\n",
       "      <th>*lapse</th>\n",
       "      <th>is_funcword</th>\n",
       "      <th>is_heavy</th>\n",
       "      <th>is_light</th>\n",
       "      <th>is_peak</th>\n",
       "      <th>is_s</th>\n",
       "      <th>is_stressed</th>\n",
       "      <th>is_syll</th>\n",
       "      <th>is_trough</th>\n",
       "      <th>is_unstressed</th>\n",
       "      <th>is_w</th>\n",
       "      <th>line_num_syll</th>\n",
       "      <th>parse_num_pos</th>\n",
       "      <th>parse_num_syll</th>\n",
       "      <th>parse_rank_dense</th>\n",
       "      <th>parse_rank_min</th>\n",
       "      <th>prom_strength</th>\n",
       "      <th>prom_stress</th>\n",
       "      <th>prom_weight</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>stanza_i</th>\n",
       "      <th>line_i</th>\n",
       "      <th>linepart_i</th>\n",
       "      <th>line_str</th>\n",
       "      <th>parse_rank</th>\n",
       "      <th>parse_str</th>\n",
       "      <th>parse</th>\n",
       "      <th>parse_i</th>\n",
       "      <th>combo_stress</th>\n",
       "      <th>combo_ipa</th>\n",
       "      <th>combo_i</th>\n",
       "      <th>parse_is_bounded</th>\n",
       "      <th>parse_bounded_by</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"14\" valign=\"top\">1</th>\n",
       "      <th>1</th>\n",
       "      <th>1</th>\n",
       "      <th>Not from the stars do I my judgement pluck;</th>\n",
       "      <th>1</th>\n",
       "      <th>not FROM* the STARS do I* my JUDGE ment PLUCK;</th>\n",
       "      <th>w s w s w s w s w s</th>\n",
       "      <th>1</th>\n",
       "      <th>U U U P U U U P U P</th>\n",
       "      <th>nɑt frʌm ðə 'stɑrz duː aɪ maɪ 'ʤʌʤ.mənt 'plʌk</th>\n",
       "      <th>1</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6</td>\n",
       "      <td>6</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>1</th>\n",
       "      <th>And yet methinks I have astronomy,</th>\n",
       "      <th>1</th>\n",
       "      <th>and YET me THINKS i HAVE as TRON o MY,*</th>\n",
       "      <th>w s w s w s w s w s</th>\n",
       "      <th>0</th>\n",
       "      <th>U P U P U P U P U U</th>\n",
       "      <th>ænd 'jɛt mi.'θɪŋks aɪ 'hæv ə.'strɑ.nʌ.miː</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>6</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>10</td>\n",
       "      <td>3</td>\n",
       "      <td>6</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <th>1</th>\n",
       "      <th>But not to tell of good or evil luck,</th>\n",
       "      <th>1</th>\n",
       "      <th>but NOT to TELL of GOOD or EV il LUCK,</th>\n",
       "      <th>w s w s w s w s w s</th>\n",
       "      <th>0</th>\n",
       "      <th>U P U P U P U P U P</th>\n",
       "      <th>bət 'nɑt tuː 'tɛl ʌv 'gʊd ɔːr 'iː.vəl 'lək</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5</td>\n",
       "      <td>8</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <th>1</th>\n",
       "      <th>Of plagues, of dearths, or seasons' quality;</th>\n",
       "      <th>1</th>\n",
       "      <th>of PLAGUES, of DEARTHS, or SEA son QUAL i TY;*</th>\n",
       "      <th>w s w s w s w s w s</th>\n",
       "      <th>0</th>\n",
       "      <th>U P U P U P U P U U</th>\n",
       "      <th>ʌv 'pleɪgz ʌv 'dəːθs ɔːr 'siː.zənz 'kwɑ.lə.tiː</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3</td>\n",
       "      <td>6</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>10</td>\n",
       "      <td>2</td>\n",
       "      <td>6</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <th>1</th>\n",
       "      <th>Nor can I fortune to brief minutes tell,</th>\n",
       "      <th>1</th>\n",
       "      <th>nor CAN* i FOR tune TO* brief* MIN utes TELL,</th>\n",
       "      <th>w s w s w s w s w s</th>\n",
       "      <th>0</th>\n",
       "      <th>U U U P U U P P U P</th>\n",
       "      <th>nɔːr kæn aɪ 'fɔːr.ʧən tuː 'briːf 'mɪ.nʌts 'tɛl</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>3.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4</td>\n",
       "      <td>7</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>10</td>\n",
       "      <td>2</td>\n",
       "      <td>6</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <th>1</th>\n",
       "      <th>Pointing to each his thunder, rain and wind,</th>\n",
       "      <th>1</th>\n",
       "      <th>POINT ing.to* EACH his THUN der, RAIN and WIND,</th>\n",
       "      <th>s w w s w s w s w s</th>\n",
       "      <th>0</th>\n",
       "      <th>P U U P U P U P U P</th>\n",
       "      <th>'pɔɪn.tɪŋ tuː 'iːʧ hɪz 'θʌn.dɛː 'reɪn ænd 'waɪnd</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4</td>\n",
       "      <td>8</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>9</td>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <th>1</th>\n",
       "      <th>Or say with princes if it shall go well</th>\n",
       "      <th>1</th>\n",
       "      <th>or SAY with PRI nces IF* it SHALL go* WELL</th>\n",
       "      <th>w s w s w s w s w s</th>\n",
       "      <th>0</th>\n",
       "      <th>U P U P U U U P P P</th>\n",
       "      <th>ɔːr 'seɪ wɪð 'prɪn.səz ɪf ɪt 'ʃæl 'goʊ 'wɛl</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4</td>\n",
       "      <td>8</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <th>1</th>\n",
       "      <th>By oft predict that I in heaven find:</th>\n",
       "      <th>1</th>\n",
       "      <th>by OFT pre DICT that I* in HEAV en FIND:</th>\n",
       "      <th>w s w s w s w s w s</th>\n",
       "      <th>0</th>\n",
       "      <th>U P U P U U U P U P</th>\n",
       "      <th>baɪ 'ɔːft prɪ.'dɪkt ðət aɪ ɪn 'hɛ.vən 'faɪnd</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4</td>\n",
       "      <td>6</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>10</td>\n",
       "      <td>2</td>\n",
       "      <td>6</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <th>1</th>\n",
       "      <th>But from thine eyes my knowledge I derive,</th>\n",
       "      <th>1</th>\n",
       "      <th>but FROM* thine EYES my KNOWL edge I* de RIVE,</th>\n",
       "      <th>w s w s w s w s w s</th>\n",
       "      <th>0</th>\n",
       "      <th>U U U P U P U U U P</th>\n",
       "      <th>bət frʌm ðaɪn 'aɪz maɪ 'nɑ.ləʤ aɪ dɛː.'aɪv</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>2.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>10</td>\n",
       "      <td>2</td>\n",
       "      <td>7</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <th>1</th>\n",
       "      <th>And constant stars in them I read such art</th>\n",
       "      <th>1</th>\n",
       "      <th>and CON stant STARS in THEM* i READ such ART</th>\n",
       "      <th>w s w s w s w s w s</th>\n",
       "      <th>0</th>\n",
       "      <th>U P U P U U U P U P</th>\n",
       "      <th>ænd 'kɑn.stənt 'stɑrz ɪn ðɛm aɪ 'rɛd səʧ 'ɑrt</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5</td>\n",
       "      <td>9</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>6</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <th>1</th>\n",
       "      <th>As 'truth and beauty shall together thrive,</th>\n",
       "      <th>1</th>\n",
       "      <th>as 'TRUTH and BEAU ty SHALL to GETH er THRIVE,</th>\n",
       "      <th>w s w s w s w s w s</th>\n",
       "      <th>0</th>\n",
       "      <th>U P U P U P U P U P</th>\n",
       "      <th>æz 'truːθ ænd 'bjuː.tiː 'ʃæl tʌ.'gɛ.ðɛː 'θraɪv</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <th>1</th>\n",
       "      <th>If from thyself, to store thou wouldst convert';</th>\n",
       "      <th>1</th>\n",
       "      <th>if FROM* thy SELF, to STORE thou WOULDST con VERT';</th>\n",
       "      <th>w s w s w s w s w s</th>\n",
       "      <th>0</th>\n",
       "      <th>U U U P U P U P U P</th>\n",
       "      <th>ɪf frʌm θaɪ.'sɛlf tuː 'stɔːr ðaʊ 'wʊədst kən.'vɛːt</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4</td>\n",
       "      <td>7</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>10</td>\n",
       "      <td>2</td>\n",
       "      <td>6</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <th>1</th>\n",
       "      <th>Or else of thee this I prognosticate:</th>\n",
       "      <th>1</th>\n",
       "      <th>or ELSE of THEE* this I* prog* NOS ti CATE:</th>\n",
       "      <th>w s w s w s w s w s</th>\n",
       "      <th>0</th>\n",
       "      <th>U P U U U U S P U S</th>\n",
       "      <th>ɔːr 'ɛls ʌv ðiː ðɪs aɪ `prɑg.'nɑ.stə.`keɪt</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>3.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>10</td>\n",
       "      <td>2</td>\n",
       "      <td>6</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <th>1</th>\n",
       "      <th>'Thy end is truth's and beauty's doom and date.'</th>\n",
       "      <th>1</th>\n",
       "      <th>'thy END is TRUTH'S and BEAU ty's DOOM and DATE.'</th>\n",
       "      <th>w s w s w s w s w s</th>\n",
       "      <th>0</th>\n",
       "      <th>U P U P U P U P U P</th>\n",
       "      <th>ðaɪ 'ɛnd ɪz 'truːθs ænd 'bjʉː.tɪz 'duːm ænd 'deɪt</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4</td>\n",
       "      <td>8</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                                                                                                                                                                                                                                        *total  ...  prom_weight\n",
       "stanza_i line_i linepart_i line_str                                         parse_rank parse_str                                          parse               parse_i combo_stress        combo_ipa                                          combo_i parse_is_bounded parse_bounded_by          ...             \n",
       "1        1      1          Not from the stars do I my judgement pluck;      1          not FROM* the STARS do I* my JUDGE ment PLUCK;     w s w s w s w s w s 1       U U U P U U U P U P nɑt frʌm ðə 'stɑrz duː aɪ maɪ 'ʤʌʤ.mənt 'plʌk      1       False                                 2.0  ...            6\n",
       "         2      1          And yet methinks I have astronomy,               1          and YET me THINKS i HAVE as TRON o MY,*            w s w s w s w s w s 0       U P U P U P U P U U ænd 'jɛt mi.'θɪŋks aɪ 'hæv ə.'strɑ.nʌ.miː          0       False                                 1.0  ...            4\n",
       "         3      1          But not to tell of good or evil luck,            1          but NOT to TELL of GOOD or EV il LUCK,             w s w s w s w s w s 0       U P U P U P U P U P bət 'nɑt tuː 'tɛl ʌv 'gʊd ɔːr 'iː.vəl 'lək         0       False                                 0.0  ...            8\n",
       "         4      1          Of plagues, of dearths, or seasons' quality;     1          of PLAGUES, of DEARTHS, or SEA son QUAL i TY;*     w s w s w s w s w s 0       U P U P U P U P U U ʌv 'pleɪgz ʌv 'dəːθs ɔːr 'siː.zənz 'kwɑ.lə.tiː     0       False                                 1.0  ...            6\n",
       "         5      1          Nor can I fortune to brief minutes tell,         1          nor CAN* i FOR tune TO* brief* MIN utes TELL,      w s w s w s w s w s 0       U U U P U U P P U P nɔːr kæn aɪ 'fɔːr.ʧən tuː 'briːf 'mɪ.nʌts 'tɛl     0       False                                 3.0  ...            7\n",
       "         6      1          Pointing to each his thunder, rain and wind,     1          POINT ing.to* EACH his THUN der, RAIN and WIND,    s w w s w s w s w s 0       P U U P U P U P U P 'pɔɪn.tɪŋ tuː 'iːʧ hɪz 'θʌn.dɛː 'reɪn ænd 'waɪnd   0       False                                 2.0  ...            8\n",
       "         7      1          Or say with princes if it shall go well          1          or SAY with PRI nces IF* it SHALL go* WELL         w s w s w s w s w s 0       U P U P U U U P P P ɔːr 'seɪ wɪð 'prɪn.səz ɪf ɪt 'ʃæl 'goʊ 'wɛl        0       False                                 2.0  ...            8\n",
       "         8      1          By oft predict that I in heaven find:            1          by OFT pre DICT that I* in HEAV en FIND:           w s w s w s w s w s 0       U P U P U U U P U P baɪ 'ɔːft prɪ.'dɪkt ðət aɪ ɪn 'hɛ.vən 'faɪnd       0       False                                 1.0  ...            6\n",
       "         9      1          But from thine eyes my knowledge I derive,       1          but FROM* thine EYES my KNOWL edge I* de RIVE,     w s w s w s w s w s 0       U U U P U P U U U P bət frʌm ðaɪn 'aɪz maɪ 'nɑ.ləʤ aɪ dɛː.'aɪv         0       False                                 2.0  ...            6\n",
       "         10     1          And constant stars in them I read such art       1          and CON stant STARS in THEM* i READ such ART       w s w s w s w s w s 0       U P U P U U U P U P ænd 'kɑn.stənt 'stɑrz ɪn ðɛm aɪ 'rɛd səʧ 'ɑrt      0       False                                 1.0  ...            9\n",
       "         11     1          As 'truth and beauty shall together thrive,      1          as 'TRUTH and BEAU ty SHALL to GETH er THRIVE,     w s w s w s w s w s 0       U P U P U P U P U P æz 'truːθ ænd 'bjuː.tiː 'ʃæl tʌ.'gɛ.ðɛː 'θraɪv     0       False                                 0.0  ...            5\n",
       "         12     1          If from thyself, to store thou wouldst convert'; 1          if FROM* thy SELF, to STORE thou WOULDST con VE... w s w s w s w s w s 0       U U U P U P U P U P ɪf frʌm θaɪ.'sɛlf tuː 'stɔːr ðaʊ 'wʊədst kən.'vɛːt 0       False                                 1.0  ...            7\n",
       "         13     1          Or else of thee this I prognosticate:            1          or ELSE of THEE* this I* prog* NOS ti CATE:        w s w s w s w s w s 0       U P U U U U S P U S ɔːr 'ɛls ʌv ðiː ðɪs aɪ `prɑg.'nɑ.stə.`keɪt         0       False                                 3.0  ...            6\n",
       "         14     1          'Thy end is truth's and beauty's doom and date.' 1          'thy END is TRUTH'S and BEAU ty's DOOM and DATE.'  w s w s w s w s w s 0       U P U P U P U P U P ðaɪ 'ɛnd ɪz 'truːθs ænd 'bjʉː.tɪz 'duːm ænd 'deɪt  0       False                                 0.0  ...            8\n",
       "\n",
       "[14 rows x 26 columns]"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# get parse data as dataframe\n",
    "sonnet.parses()                  # plausible (unbounded) parses\n",
    "sonnet.unbounded_parses()        # same as above\n",
    "sonnet.all_parses()              # all parses, plausible or no\n",
    "sonnet.best_parses()             # only top ranking parse per line"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>*total</th>\n",
       "      <th>*s/unstressed</th>\n",
       "      <th>*w-res</th>\n",
       "      <th>*w/stressed</th>\n",
       "      <th>*clash</th>\n",
       "      <th>*f-res</th>\n",
       "      <th>*w/peak</th>\n",
       "      <th>*lapse</th>\n",
       "      <th>is_funcword</th>\n",
       "      <th>is_heavy</th>\n",
       "      <th>is_light</th>\n",
       "      <th>is_peak</th>\n",
       "      <th>is_s</th>\n",
       "      <th>is_stressed</th>\n",
       "      <th>is_syll</th>\n",
       "      <th>is_trough</th>\n",
       "      <th>is_unstressed</th>\n",
       "      <th>is_w</th>\n",
       "      <th>line_num_syll</th>\n",
       "      <th>parse_num_pos</th>\n",
       "      <th>parse_num_syll</th>\n",
       "      <th>prom_strength</th>\n",
       "      <th>prom_stress</th>\n",
       "      <th>prom_weight</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>stanza_i</th>\n",
       "      <th>line_i</th>\n",
       "      <th>linepart_i</th>\n",
       "      <th>line_str</th>\n",
       "      <th>parse_rank</th>\n",
       "      <th>parse_str</th>\n",
       "      <th>parse</th>\n",
       "      <th>parse_i</th>\n",
       "      <th>combo_stress</th>\n",
       "      <th>combo_ipa</th>\n",
       "      <th>combo_i</th>\n",
       "      <th>parse_is_bounded</th>\n",
       "      <th>parse_bounded_by</th>\n",
       "      <th>parse_pos_i</th>\n",
       "      <th>parse_pos</th>\n",
       "      <th>word_i</th>\n",
       "      <th>word_str</th>\n",
       "      <th>word_ipa_i</th>\n",
       "      <th>word_ipa</th>\n",
       "      <th>syll_i</th>\n",
       "      <th>syll_str</th>\n",
       "      <th>syll_ipa</th>\n",
       "      <th>syll_stress</th>\n",
       "      <th>syll_weight</th>\n",
       "      <th>parse_syll_i</th>\n",
       "      <th>parse_syll</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"10\" valign=\"top\">1</th>\n",
       "      <th rowspan=\"10\" valign=\"top\">1</th>\n",
       "      <th rowspan=\"10\" valign=\"top\">1</th>\n",
       "      <th rowspan=\"10\" valign=\"top\">Not from the stars do I my judgement pluck;</th>\n",
       "      <th rowspan=\"10\" valign=\"top\">1</th>\n",
       "      <th rowspan=\"10\" valign=\"top\">not FROM* the STARS do I* my JUDGE ment PLUCK;</th>\n",
       "      <th rowspan=\"10\" valign=\"top\">w s w s w s w s w s</th>\n",
       "      <th rowspan=\"10\" valign=\"top\">1</th>\n",
       "      <th rowspan=\"10\" valign=\"top\">U U U P U U U P U P</th>\n",
       "      <th rowspan=\"10\" valign=\"top\">nɑt frʌm ðə 'stɑrz duː aɪ maɪ 'ʤʌʤ.mənt 'plʌk</th>\n",
       "      <th rowspan=\"10\" valign=\"top\">1</th>\n",
       "      <th rowspan=\"10\" valign=\"top\">False</th>\n",
       "      <th rowspan=\"10\" valign=\"top\"></th>\n",
       "      <th>0</th>\n",
       "      <th>w</th>\n",
       "      <th>1</th>\n",
       "      <th>Not</th>\n",
       "      <th>2</th>\n",
       "      <th>nɑt</th>\n",
       "      <th>1</th>\n",
       "      <th>Not</th>\n",
       "      <th>nɑt</th>\n",
       "      <th>U</th>\n",
       "      <th>H</th>\n",
       "      <th>1</th>\n",
       "      <th>w</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <th>s</th>\n",
       "      <th>2</th>\n",
       "      <th>from</th>\n",
       "      <th>1</th>\n",
       "      <th>frʌm</th>\n",
       "      <th>1</th>\n",
       "      <th>from</th>\n",
       "      <th>frʌm</th>\n",
       "      <th>U</th>\n",
       "      <th>H</th>\n",
       "      <th>1</th>\n",
       "      <th>s</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>w</th>\n",
       "      <th>3</th>\n",
       "      <th>the</th>\n",
       "      <th>1</th>\n",
       "      <th>ðə</th>\n",
       "      <th>1</th>\n",
       "      <th>the</th>\n",
       "      <th>ðə</th>\n",
       "      <th>U</th>\n",
       "      <th>L</th>\n",
       "      <th>1</th>\n",
       "      <th>w</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <th>s</th>\n",
       "      <th>4</th>\n",
       "      <th>stars</th>\n",
       "      <th>1</th>\n",
       "      <th>'stɑrz</th>\n",
       "      <th>1</th>\n",
       "      <th>stars</th>\n",
       "      <th>'stɑrz</th>\n",
       "      <th>P</th>\n",
       "      <th>H</th>\n",
       "      <th>1</th>\n",
       "      <th>s</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <th>w</th>\n",
       "      <th>5</th>\n",
       "      <th>do</th>\n",
       "      <th>2</th>\n",
       "      <th>duː</th>\n",
       "      <th>1</th>\n",
       "      <th>do</th>\n",
       "      <th>duː</th>\n",
       "      <th>U</th>\n",
       "      <th>L</th>\n",
       "      <th>1</th>\n",
       "      <th>w</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <th>s</th>\n",
       "      <th>6</th>\n",
       "      <th>I</th>\n",
       "      <th>1</th>\n",
       "      <th>aɪ</th>\n",
       "      <th>1</th>\n",
       "      <th>I</th>\n",
       "      <th>aɪ</th>\n",
       "      <th>U</th>\n",
       "      <th>L</th>\n",
       "      <th>1</th>\n",
       "      <th>s</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <th>w</th>\n",
       "      <th>7</th>\n",
       "      <th>my</th>\n",
       "      <th>1</th>\n",
       "      <th>maɪ</th>\n",
       "      <th>1</th>\n",
       "      <th>my</th>\n",
       "      <th>maɪ</th>\n",
       "      <th>U</th>\n",
       "      <th>L</th>\n",
       "      <th>1</th>\n",
       "      <th>w</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <th>s</th>\n",
       "      <th>8</th>\n",
       "      <th>judgement</th>\n",
       "      <th>1</th>\n",
       "      <th>'ʤʌʤ.mənt</th>\n",
       "      <th>1</th>\n",
       "      <th>judge</th>\n",
       "      <th>'ʤʌʤ</th>\n",
       "      <th>P</th>\n",
       "      <th>H</th>\n",
       "      <th>1</th>\n",
       "      <th>s</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <th>w</th>\n",
       "      <th>8</th>\n",
       "      <th>judgement</th>\n",
       "      <th>1</th>\n",
       "      <th>'ʤʌʤ.mənt</th>\n",
       "      <th>2</th>\n",
       "      <th>ment</th>\n",
       "      <th>mənt</th>\n",
       "      <th>U</th>\n",
       "      <th>H</th>\n",
       "      <th>1</th>\n",
       "      <th>w</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <th>s</th>\n",
       "      <th>9</th>\n",
       "      <th>pluck;</th>\n",
       "      <th>1</th>\n",
       "      <th>'plʌk</th>\n",
       "      <th>1</th>\n",
       "      <th>pluck;</th>\n",
       "      <th>'plʌk</th>\n",
       "      <th>P</th>\n",
       "      <th>H</th>\n",
       "      <th>1</th>\n",
       "      <th>s</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>19</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                                                                                                                                                                                                                                                                                                                                                               *total  ...  prom_weight\n",
       "stanza_i line_i linepart_i line_str                                    parse_rank parse_str                                      parse               parse_i combo_stress        combo_ipa                                     combo_i parse_is_bounded parse_bounded_by parse_pos_i parse_pos word_i word_str  word_ipa_i word_ipa  syll_i syll_str syll_ipa syll_stress syll_weight parse_syll_i parse_syll          ...             \n",
       "1        1      1          Not from the stars do I my judgement pluck; 1          not FROM* the STARS do I* my JUDGE ment PLUCK; w s w s w s w s w s 1       U U U P U U U P U P nɑt frʌm ðə 'stɑrz duː aɪ maɪ 'ʤʌʤ.mənt 'plʌk 1       False                             0           w         1      Not       2          nɑt       1      Not      nɑt      U           H           1            w              0.0  ...            1\n",
       "                                                                                                                                                                                                                                                                         1           s         2      from      1          frʌm      1      from     frʌm     U           H           1            s              1.0  ...            1\n",
       "                                                                                                                                                                                                                                                                         2           w         3      the       1          ðə        1      the      ðə       U           L           1            w              0.0  ...            0\n",
       "                                                                                                                                                                                                                                                                         3           s         4      stars     1          'stɑrz    1      stars    'stɑrz   P           H           1            s              0.0  ...            1\n",
       "                                                                                                                                                                                                                                                                         4           w         5      do        2          duː       1      do       duː      U           L           1            w              0.0  ...            0\n",
       "                                                                                                                                                                                                                                                                         5           s         6      I         1          aɪ        1      I        aɪ       U           L           1            s              1.0  ...            0\n",
       "                                                                                                                                                                                                                                                                         6           w         7      my        1          maɪ       1      my       maɪ      U           L           1            w              0.0  ...            0\n",
       "                                                                                                                                                                                                                                                                         7           s         8      judgement 1          'ʤʌʤ.mənt 1      judge    'ʤʌʤ     P           H           1            s              0.0  ...            1\n",
       "                                                                                                                                                                                                                                                                         8           w         8      judgement 1          'ʤʌʤ.mənt 2      ment     mənt     U           H           1            w              0.0  ...            1\n",
       "                                                                                                                                                                                                                                                                         9           s         9      pluck;    1          'plʌk     1      pluck;   'plʌk    P           H           1            s              0.0  ...            1\n",
       "\n",
       "[10 rows x 24 columns]"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# any of the above can return syllable level data as well\n",
    "sonnet.all_parses(by_syll=True)\n",
    "sonnet.best_parses(by_syll=True)\n",
    "sonnet.best_parses(by_syll=True).query('line_i==1') # first line"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>*total</th>\n",
       "      <th>*s/unstressed</th>\n",
       "      <th>*w-res</th>\n",
       "      <th>*w/stressed</th>\n",
       "      <th>*clash</th>\n",
       "      <th>*f-res</th>\n",
       "      <th>*w/peak</th>\n",
       "      <th>*lapse</th>\n",
       "      <th>is_funcword</th>\n",
       "      <th>is_heavy</th>\n",
       "      <th>is_light</th>\n",
       "      <th>is_peak</th>\n",
       "      <th>is_s</th>\n",
       "      <th>is_stressed</th>\n",
       "      <th>is_syll</th>\n",
       "      <th>is_trough</th>\n",
       "      <th>is_unstressed</th>\n",
       "      <th>is_w</th>\n",
       "      <th>line_num_syll</th>\n",
       "      <th>parse_num_pos</th>\n",
       "      <th>parse_num_syll</th>\n",
       "      <th>parse_rank_dense</th>\n",
       "      <th>parse_rank_min</th>\n",
       "      <th>prom_strength</th>\n",
       "      <th>prom_stress</th>\n",
       "      <th>prom_weight</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>stanza_i</th>\n",
       "      <th>line_i</th>\n",
       "      <th>linepart_i</th>\n",
       "      <th>line_str</th>\n",
       "      <th>parse_rank</th>\n",
       "      <th>parse_str</th>\n",
       "      <th>parse</th>\n",
       "      <th>parse_i</th>\n",
       "      <th>combo_stress</th>\n",
       "      <th>combo_ipa</th>\n",
       "      <th>combo_i</th>\n",
       "      <th>parse_is_bounded</th>\n",
       "      <th>parse_bounded_by</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"11\" valign=\"top\">1</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">1</th>\n",
       "      <th>1</th>\n",
       "      <th>Is it that by its indefiniteness it shadows forth the heartless voids and immensities of the universe,</th>\n",
       "      <th>1</th>\n",
       "      <th>is.it* THAT by ITS* in DEF i NITE.NESS* it SHAD ows* FORTH the HEART less VOIDS and IM.MEN* si TIES.OF* the UNI ver SE,</th>\n",
       "      <th>w w s w s w s w s s w s w s w s w s w s s w s s w s w s</th>\n",
       "      <th>40</th>\n",
       "      <th>U U P U U U P U U U U P S P U P U P U U P U U U U P U S</th>\n",
       "      <th>ɪz ɪt 'ðæt baɪ ɪts ɪn.'dɛ.fɪ.nʌt.nʌs ɪt 'ʃæ.`doʊz 'fɔːrθ ðə 'hɑrt.ləs 'vɔɪdz ænd ɪ.'mɛn.sɪ.tɪz ʌv ðə 'juː.nʌ.`vɛːs</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>16.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>10</td>\n",
       "      <td>18</td>\n",
       "      <td>10</td>\n",
       "      <td>6</td>\n",
       "      <td>15</td>\n",
       "      <td>10</td>\n",
       "      <td>28</td>\n",
       "      <td>7</td>\n",
       "      <td>18</td>\n",
       "      <td>13</td>\n",
       "      <td>28</td>\n",
       "      <td>24</td>\n",
       "      <td>55</td>\n",
       "      <td>6</td>\n",
       "      <td>66</td>\n",
       "      <td>6.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>and thus stabs us from behind with the thought of annihilation,</th>\n",
       "      <th>1</th>\n",
       "      <th>AND* thus* STABS us FROM* be HIND with THE* thought* OF* an NI hi LA tion,</th>\n",
       "      <th>s w s w s w s w s w s w s w s w</th>\n",
       "      <th>4</th>\n",
       "      <th>U P P U U U P U U P U U S U P U</th>\n",
       "      <th>ænd 'ðʌs 'stæbz əs frʌm bɪ.'haɪnd wɪð ðə 'θɔːt ʌv ə.`naɪ.ə.'leɪ.ʃən</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>6.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6</td>\n",
       "      <td>10</td>\n",
       "      <td>6</td>\n",
       "      <td>3</td>\n",
       "      <td>8</td>\n",
       "      <td>6</td>\n",
       "      <td>16</td>\n",
       "      <td>4</td>\n",
       "      <td>10</td>\n",
       "      <td>8</td>\n",
       "      <td>16</td>\n",
       "      <td>16</td>\n",
       "      <td>31</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.5</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <th>when beholding the white depths of the milky way?</th>\n",
       "      <th>1</th>\n",
       "      <th>WHEN be HOLD ing THE* white* DEPTHS of.the* MI lky WAY?</th>\n",
       "      <th>s w s w s w s w w s w s</th>\n",
       "      <th>0</th>\n",
       "      <th>P U P U U P P U U P U P</th>\n",
       "      <th>'wɛn bɪ.'hoʊl.dɪŋ ðə 'waɪt 'dɛpθs ʌv ðə 'mɪl.kiː 'weɪ</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>4.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4</td>\n",
       "      <td>7</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>6</td>\n",
       "      <td>6</td>\n",
       "      <td>12</td>\n",
       "      <td>3</td>\n",
       "      <td>6</td>\n",
       "      <td>6</td>\n",
       "      <td>12</td>\n",
       "      <td>11</td>\n",
       "      <td>23</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"8\" valign=\"top\">2</th>\n",
       "      <th>1</th>\n",
       "      <th>Or is it,</th>\n",
       "      <th>1</th>\n",
       "      <th>or IS* it,</th>\n",
       "      <th>w s w</th>\n",
       "      <th>0</th>\n",
       "      <th>U U U</th>\n",
       "      <th>ɔːr ɪz ɪt</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>that as in essence whiteness is not so much a colour as the visible absence of colour;</th>\n",
       "      <th>1</th>\n",
       "      <th>that AS* in ESS ence WHITE ness.is* NOT so MUCH a COL our AS* the VIS i BLE* ab* SENCE* of COL our;</th>\n",
       "      <th>w s w s w s w w s w s w s w s w s w s w s w s w</th>\n",
       "      <th>16</th>\n",
       "      <th>U U U P U P U U P U P U P U U U P U U P U U P U</th>\n",
       "      <th>ðət æz ɪn 'ɛ.səns 'waɪt.nəs ɪz 'nɑt soʊ 'mʌʧ eɪ 'kʌ.lʌ æz ðə 'vɪ.zʌ.bəl 'æb.səns ʌv 'kʌ.lʌ</th>\n",
       "      <th>2</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>8.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>10</td>\n",
       "      <td>14</td>\n",
       "      <td>10</td>\n",
       "      <td>6</td>\n",
       "      <td>11</td>\n",
       "      <td>8</td>\n",
       "      <td>24</td>\n",
       "      <td>6</td>\n",
       "      <td>16</td>\n",
       "      <td>13</td>\n",
       "      <td>24</td>\n",
       "      <td>23</td>\n",
       "      <td>47</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>6.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <th>and at the same time the concrete of all colours;</th>\n",
       "      <th>1</th>\n",
       "      <th>and AT the SAME.TIME* the CON crete OF* all COLO urs;</th>\n",
       "      <th>w s w s s w s w s w s w</th>\n",
       "      <th>0</th>\n",
       "      <th>U P U P P U P U U U P U</th>\n",
       "      <th>ænd 'æt ðə 'seɪm 'taɪm ðə 'kɑn.kriːt ʌv ɔːl 'kʌ.lʌz</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>3.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7</td>\n",
       "      <td>9</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>6</td>\n",
       "      <td>5</td>\n",
       "      <td>12</td>\n",
       "      <td>2</td>\n",
       "      <td>7</td>\n",
       "      <td>6</td>\n",
       "      <td>12</td>\n",
       "      <td>11</td>\n",
       "      <td>23</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <th>is it for these reasons that there is such a dumb blankness,</th>\n",
       "      <th>1</th>\n",
       "      <th>IS* it FOR* these REA sons THAT there IS* such A* dumb* BLANK ness,</th>\n",
       "      <th>s w s w s w s w s w s w s w</th>\n",
       "      <th>0</th>\n",
       "      <th>U U U U P U P U U U U P P U</th>\n",
       "      <th>ɪz ɪt fɔːr ðiːz 'riː.zənz 'ðæt ðɛr ɪz səʧ eɪ 'dəm 'blæŋk.nʌs</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>5.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9</td>\n",
       "      <td>12</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>7</td>\n",
       "      <td>4</td>\n",
       "      <td>14</td>\n",
       "      <td>2</td>\n",
       "      <td>10</td>\n",
       "      <td>7</td>\n",
       "      <td>14</td>\n",
       "      <td>14</td>\n",
       "      <td>27</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <th>full of meaning,</th>\n",
       "      <th>1</th>\n",
       "      <th>FULL of MEAN ing,</th>\n",
       "      <th>s w s w</th>\n",
       "      <th>0</th>\n",
       "      <th>P U P U</th>\n",
       "      <th>'fʊl ʌv 'miː.nɪŋ</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <th>in a wide landscape of snows:</th>\n",
       "      <th>1</th>\n",
       "      <th>IN a WIDE land* SCAPE of SNOWS:</th>\n",
       "      <th>s w s w s w s</th>\n",
       "      <th>0</th>\n",
       "      <th>P U P P S U P</th>\n",
       "      <th>'ɪn eɪ 'waɪd 'lænd.`skeɪp ʌv 'snoʊz</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>7</td>\n",
       "      <td>7</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>4.5</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <th>a colourless,</th>\n",
       "      <th>1</th>\n",
       "      <th>a COLOUR le SS,*</th>\n",
       "      <th>w s w s</th>\n",
       "      <th>0</th>\n",
       "      <th>U P U U</th>\n",
       "      <th>eɪ 'kʌ.lʌ.lʌs</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <th>all-colour of atheism from which we shrink?</th>\n",
       "      <th>1</th>\n",
       "      <th>al L- colour OF* athe I sm.from* WHICH we SHRINK?</th>\n",
       "      <th>w s w s w s w w s w s</th>\n",
       "      <th>0</th>\n",
       "      <th>U P U U U P U U P U P</th>\n",
       "      <th>ɔːl.'kʌ.lʌ ʌv ə.'θaɪ.səm frʌm 'wɪʧ wiː 'ʃrɪŋk</th>\n",
       "      <th>0</th>\n",
       "      <th>False</th>\n",
       "      <th></th>\n",
       "      <td>3.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4</td>\n",
       "      <td>6</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>11</td>\n",
       "      <td>4</td>\n",
       "      <td>7</td>\n",
       "      <td>6</td>\n",
       "      <td>12</td>\n",
       "      <td>10</td>\n",
       "      <td>21</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                                                                                                                                                                                                                                                                                                        *total  ...  prom_weight\n",
       "stanza_i line_i linepart_i line_str                                           parse_rank parse_str                                          parse                                              parse_i combo_stress                                       combo_ipa                                          combo_i parse_is_bounded parse_bounded_by          ...             \n",
       "1        1      1          Is it that by its indefiniteness it shadows for... 1          is.it* THAT by ITS* in DEF i NITE.NESS* it SHAD... w w s w s w s w s s w s w s w s w s w s s w s s... 40      U U P U U U P U U U U P S P U P U P U U P U U U... ɪz ɪt 'ðæt baɪ ɪts ɪn.'dɛ.fɪ.nʌt.nʌs ɪt 'ʃæ.`do... 0       False                                16.0  ...           18\n",
       "                2           and thus stabs us from behind with the thought... 1          AND* thus* STABS us FROM* be HIND with THE* tho... s w s w s w s w s w s w s w s w                    4       U P P U U U P U U P U U S U P U                    ænd 'ðʌs 'stæbz əs frʌm bɪ.'haɪnd wɪð ðə 'θɔːt ... 0       False                                 6.0  ...           10\n",
       "                3           when beholding the white depths of the milky way? 1          WHEN be HOLD ing THE* white* DEPTHS of.the* MI ... s w s w s w s w w s w s                            0       P U P U U P P U U P U P                            'wɛn bɪ.'hoʊl.dɪŋ ðə 'waɪt 'dɛpθs ʌv ðə 'mɪl.ki... 0       False                                 4.0  ...            7\n",
       "         2      1          Or is it,                                          1          or IS* it,                                         w s w                                              0       U U U                                              ɔːr ɪz ɪt                                          0       False                                 1.0  ...            3\n",
       "                2           that as in essence whiteness is not so much a ... 1          that AS* in ESS ence WHITE ness.is* NOT so MUCH... w s w s w s w w s w s w s w s w s w s w s w s w    16      U U U P U P U U P U P U P U U U P U U P U U P U    ðət æz ɪn 'ɛ.səns 'waɪt.nəs ɪz 'nɑt soʊ 'mʌʧ eɪ... 2       False                                 8.0  ...           14\n",
       "                3           and at the same time the concrete of all colours; 1          and AT the SAME.TIME* the CON crete OF* all COL... w s w s s w s w s w s w                            0       U P U P P U P U U U P U                            ænd 'æt ðə 'seɪm 'taɪm ðə 'kɑn.kriːt ʌv ɔːl 'kʌ... 0       False                                 3.0  ...            9\n",
       "                4           is it for these reasons that there is such a d... 1          IS* it FOR* these REA sons THAT there IS* such ... s w s w s w s w s w s w s w                        0       U U U U P U P U U U U P P U                        ɪz ɪt fɔːr ðiːz 'riː.zənz 'ðæt ðɛr ɪz səʧ eɪ 'd... 0       False                                 5.0  ...           12\n",
       "                5           full of meaning,                                  1          FULL of MEAN ing,                                  s w s w                                            0       P U P U                                            'fʊl ʌv 'miː.nɪŋ                                   0       False                                 0.0  ...            3\n",
       "                6           in a wide landscape of snows:                     1          IN a WIDE land* SCAPE of SNOWS:                    s w s w s w s                                      0       P U P P S U P                                      'ɪn eɪ 'waɪd 'lænd.`skeɪp ʌv 'snoʊz                0       False                                 2.0  ...            6\n",
       "                7           a colourless,                                     1          a COLOUR le SS,*                                   w s w s                                            0       U P U U                                            eɪ 'kʌ.lʌ.lʌs                                      0       False                                 1.0  ...            1\n",
       "                8           all-colour of atheism from which we shrink?       1          al L- colour OF* athe I sm.from* WHICH we SHRINK?  w s w s w s w w s w s                              0       U P U U U P U U P U P                              ɔːl.'kʌ.lʌ ʌv ə.'θaɪ.səm frʌm 'wɪʧ wiː 'ʃrɪŋk      0       False                                 3.0  ...            6\n",
       "\n",
       "[11 rows x 26 columns]"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Best prose parses\n",
    "para.best_parses()"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "96e96d1fcde428da9c8322daedfd0e8890a2dfa3c4fb6b7de685db4b856c7b39"
  },
  "kernelspec": {
   "display_name": "Python 3",
   "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.8.5"
  },
  "widgets": {
   "application/vnd.jupyter.widget-state+json": {
    "state": {},
    "version_major": 2,
    "version_minor": 0
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
