Removing files from data analysis directory
[ou-summer-of-code-2017.git] / 08-word-chains / build-word-lists.ipynb
index d12df7877222bf4e3793fa7e1a9f17bd1b90f4a9..393845cb71695b1aba9a8079fcbea7c0feef6eaa 100644 (file)
@@ -2,7 +2,7 @@
  "cells": [
   {
    "cell_type": "code",
-   "execution_count": 3,
+   "execution_count": 1,
    "metadata": {
     "collapsed": true
    },
@@ -14,7 +14,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 4,
+   "execution_count": 2,
    "metadata": {
     "collapsed": true
    },
@@ -25,7 +25,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 5,
+   "execution_count": 3,
    "metadata": {
     "collapsed": true
    },
@@ -40,7 +40,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 6,
+   "execution_count": 4,
    "metadata": {
     "collapsed": true
    },
   },
   {
    "cell_type": "code",
-   "execution_count": 7,
+   "execution_count": 5,
    "metadata": {},
-   "outputs": [
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "/usr/share/dict/british-english\n",
-      "find: ‘/usr/share/doc/google-chrome-stable’: Permission denied\n",
-      "/usr/share/man/man5/british-english.5.gz\n"
-     ]
-    }
-   ],
+   "outputs": [],
    "source": [
     "# !find /usr -type f -iname 'british-english*'"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 8,
+   "execution_count": 6,
    "metadata": {},
-   "outputs": [
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "total 2.3M\r\n",
-      "drwxr-xr-x   2 root root 4.0K Dec 29 12:37 .\r\n",
-      "drwxr-xr-x 640 root root  20K Apr 13 17:05 ..\r\n",
-      "-rw-r--r--   1 root root 917K Oct 23  2011 american-english\r\n",
-      "-rw-r--r--   1 root root 917K Oct 23  2011 british-english\r\n",
-      "-rw-r--r--   1 root root 467K Aug 25  2016 cracklib-small\r\n",
-      "-rw-r--r--   1 root root  199 Aug 29  2016 README.select-wordlist\r\n",
-      "lrwxrwxrwx   1 root root   30 Nov 10  2014 words -> /etc/dictionaries-common/words\r\n",
-      "lrwxrwxrwx   1 root root   16 Jun 18  2014 words.pre-dictionaries-common -> american-english\r\n"
-     ]
-    }
-   ],
+   "outputs": [],
    "source": [
     "# !ls -lah /usr/share/dict"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 17,
+   "execution_count": 7,
    "metadata": {
     "collapsed": true
    },
   },
   {
    "cell_type": "code",
-   "execution_count": 18,
+   "execution_count": 8,
    "metadata": {},
    "outputs": [
     {
        "True"
       ]
      },
-     "execution_count": 18,
+     "execution_count": 8,
      "metadata": {},
      "output_type": "execute_result"
     }
   },
   {
    "cell_type": "code",
-   "execution_count": 19,
+   "execution_count": 9,
    "metadata": {
     "collapsed": true
    },
   },
   {
    "cell_type": "code",
-   "execution_count": 20,
+   "execution_count": 10,
    "metadata": {},
    "outputs": [
     {
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "2336 4-letter words\n",
       "4566 5-letter words\n",
-      "7223 6-letter words\n"
+      "7223 6-letter words\n",
+      "9815 7-letter words\n",
+      "10328 8-letter words\n"
      ]
     }
    ],
    "source": [
     "dicts = {}\n",
     "\n",
-    "for n in [4, 5, 6]:\n",
+    "for n in [5, 6, 7, 8]:\n",
     "    dicts[n] = words_with_len(n)\n",
     "    print('{} {}-letter words'.format(len(dicts[n]), n))\n",
     "    with open('words{}.txt'.format(n), 'w') as f:\n",