{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Populating the interactive namespace from numpy and matplotlib\n" ] } ], "source": [ "# Boring preliminaries\n", "%pylab inline\n", "import re\n", "import math\n", "import string\n", "from collections import Counter\n", "from __future__ import division" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
pairs: | Ø+wird w+ird | wi+rd | wir+d | wird+Ø | Notes: (a, b) pair\n",
" | deletions: | Ø+ird | w+rd | wi+d | wir+Ø | Delete first char of b\n",
" | transpositions: | Ø+iwrd | w+rid | wi+dr | Swap first two chars of b\n",
" | replacements: | Ø+?ird | w+?rd | wi+?d | wir+? | Replace char at start of b\n",
" | insertions: | Ø+?+wird | w+?+ird | wi+?+rd | wir+?+d | wird+?+Ø | Insert char between a and b\n",
" | |