Part 1 Sonnets - Background

Sonnets are poems which have the following form 1 (Shakespeare's sonnet 116):

Let me not to the marriage of true minds (A)
Admit impediments, love is not love (B)
Which alters when it alteration finds, (A)
Or bends with the remover to remove. (B)

O no, it is an ever fixèd mark (C)
That looks on tempests and is never shaken; (D)
It is the star to every wand'ring bark, (C)
Whose worth's unknown although his height be taken. (D)

Love's not time's fool, though rosy lips and cheeks (E)
Within his bending sickle's compass come, (F)
Love alters not with his brief hours and weeks, (E)
But bears it out even to the edge of doom: (F)

If this be error and upon me proved, (G)
I never writ, nor no man ever loved. (G)

There are 3 quatrains (group of 4 lines) and a couplet (2 lines) making a total of 14 lines. The rhyming pattern is shown with the letters at the end of each line

Each line is in iambic pentameter (weak-strong). A standard line of iambic pentameter is five iambic feet in a row:

da DUM da DUM da DUM da DUM da DUM
but SOFT | what LIGHT | through YON | der WIN | dow BREAKS

Shakespeare has written some 154 sonnets together with many plays - doubt (Craig & Kinney, 2009; Holmes & Kardos, 2003; James & Rubinstein, 2006; Jarmusch et al., 2013; Rubbo et al., 2008) exists as to whether, the person known to be called Shakespeare, was the actual author of all the work presented under this name.

There is a considerable prize still to be claimed by anyone who can prove or disprove this.

Your Task - explore possible authorship

Even though we have just become familiar with Python, there are three very simple tests that we can apply to authorship - and we have the means, with lists and strings in Python, to implement them:

1. Count the occurrences of each letter in the text.
2. Print the number of one-letter, two-letter, three-letter words and so on.
3. Print the number of occurrences of each different word in the text.

The first pass might be to see if there is consistency across all the sonnets.

Use the text from the sonnets and apply these three metrics. (We shall leave the actual plan and algorithm up to you - discuss it with your lecturer/tutor if you wish)

Three possible authors who might have written under Shakespeare's name are: Francis Bacon, Ben Jonson and Christopher Marlowe. Their works are readily available online.

Part 2: Doublets

Doublets (or word ladders) are often found in magazines and newspapers together with cryptic crosswords and other puzzles.

The idea is very simple: you might be given two words - often they are antonyms and your task is to create a ladder of words with these two words at the top and bottom of the ladder.

For example:

HEADER
HEAL
TEAL
TELL
TALL
TAIL

The aim is to make the number of words joining HEAD and TAIL as few as possible.

In this assignment you are given a file 5 of some 5700 words together with the pairs of words below (to use as a start and end); you are asked to use your Python skills to find the fewest words that will link them.

Use the following pairs of words:

i. FLOUR-BREAD
ii. CHAOS-PEACE
iii. TEARS-SMILE
iv. WITCH-FAIRY
v. BLACK-WHITE
vi. SLEEP-DREAM
vii. RIVER-SHORE

Then, choose 3 different pairs of words from the file and use these as well.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.